Skip to content

API that gets information from Modatex, adding filters, ordering methods and validation

License

Notifications You must be signed in to change notification settings

wokcito/modatex-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MODATEX API

API made with Express that increment the number of filters and ordering methods for Modatex's API, obtaining relevant information about stores and products

NOTE
This is a personal project carried out merely for educational purposes

Table of Contents

Installation

Clone the repository and install the dependencies

npm install
pnpm install

Environment variables

Create a new .env file in the project root and add the next variables

MEDIA_SERVER=https://netivooregon.s3.amazonaws.com/
BASE_URL=https://www.modatex.com.ar/modatexrosa3/
ACCEPTED_ORIGINS=https://yourweb.com,https://yourotherweb.com

Endpoints

Stores

GET /stores/{Section}

Gets the information from Modatex's stores

Parameters:

  • Section¹: 'woman' | 'man' | 'kids' | 'xl' | 'accessories'

Query:

  • ranks¹ ²: 'premium' | 'black' | 'platinum' | 'gold' | 'blue'
  • name: string
  • minSales: number
  • minSalesPercent: number
  • minReputation: number
  • maxMinimum: number
  • minMinimum: number
  • flashDiscount: 1 if true
  • start: number
  • limit: number
  • order: 'asc' | 'desc'
  • fieldOrder: 'reputation' | 'minimum' | 'name' | 'sales' | 'sales_percent'
Cites
  1. required
  2. you can pass several of them separated by commas

Example

const SECTION = 'woman'
const RANKS = 'premium,black,platinum,gold,blue'
const NAME = 'holic'

fetch(`http://localhost:3000/stores/${SECTION}?ranks=${RANKS}&name=${NAME}`)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.log(error))

Response

{
  "recordsFiltered": 1,
  "data": [
    {
      "store_id": 1354,
      "name": "holic",
      "reputation": 85,
      "completed_sales": 445,
      "completed_sales_percent": 72,
      "attempted_sales": 613,
      "background": "https://netivooregon.s3.amazonaws.com/common/img/cover/holic_1693247988_woman_black.webp",
      "logo": "https://netivooregon.s3.amazonaws.com/common/img/logo/holic_1547479126.webp",
      "minimum": 25000,
      "flash_discount": false,
      "leader": false,
      "slides": []
    }
  ]
}

About

API that gets information from Modatex, adding filters, ordering methods and validation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published