Orders

The order model contains all the information about order created by users.

GET/v1/orders/{orderID}

Get exact order


POST/v1/brands/{brandID}/outstock

Upload out-of-stock products

This endpoint allows brands to upload their out-of-stock products either by uploading a CSV file or by sending an array of objects via POST request.

Upload via CSV

Brands can upload a CSV file containing the details of the out-of-stock products.

id,title,brand,sellPrice,size,quantity, ...images
productID1,Product Title 1,Brand 1,29.99,M,0, ...
productID2,Product Title 2,Brand 2,49.99,L,0, ...
productID3,Product Title 3,,19.99,S,0, ...

Upload via JSON

Brands can send an array of objects containing the details of the out-of-stock products.

Required attributes (for JSON)

  • Name
    products
    Type
    array
    Description

    An array of product objects.

    • Name
      id
      Type
      ObjectId
      Description

      The unique identifier of the product.

    • Name
      title
      Type
      string
      Description

      The title of the product.

    • Name
      brand
      Type
      string
      Description

      The brand of the product.

    • Name
      sellPrice
      Type
      number
      Description

      The selling price of the product.

    • Name
      size
      Type
      string
      Description

      The size of the product.

    • Name
      quantity
      Type
      number
      Description

      The quantity of the product that is out of stock.

Request (CSV Upload)

POST
/v1/brands/{brandID}/outstock
curl -X POST https://api.thefashionpeople.com/v1/brands/{brandID}/outstock \
  -H "Authorization: Bearer {token}" \
  -F "file=@outstock.csv"

Request (JSON Upload)

POST
/v1/brands/{brandID}/outstock
curl -X POST https://api.thefashionpeople.com/v1/brands/{brandID}/outstock \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "products": [
      {
        "id": "productID1",
        "title": "Product Title 1",
        "brand": "Brand 1",
        "sellPrice": 29.99,
        "size": "M",
        "quantity": 0
      },
      {
        "id": "productID2",
        "title": "Product Title 2",
        "brand": "Brand 2",
        "sellPrice": 49.99,
        "size": "L",
        "quantity": 0
      }
    ]
  }'

Response

{
  "message": "Out-of-stock products have been uploaded successfully.",
  "outstock_products": [
    {
      "id": "productID1",
      "title": "Product Title 1",
      "brand": "Brand 1",
      "sellPrice": 29.99,
      "size": "M",
      "quantity": 0
    },
    {
      "id": "productID2",
      "title": "Product Title 2",
      "brand": "Brand 2",
      "sellPrice": 49.99,
      "size": "L",
      "quantity": 0
    }
  ]
}