Skip to main content

Add Product to Price List

Adds a single product to a price list. To change the prices of a product that is already in the list, use Update Single Price List Product.

HTTP Request​

  • URL: /priceList/{id}/product
  • Method: POST
  • Headers:
    • accessToken: Required. Your API access token.
    • Content-Type: application/json
  • Required scope: READ_WRITE_PRICELIST

Path Parameters​

ParameterTypeDescription
idStringRequired. The ID of the price list.

Request Body​

Send the product and its prices.

FieldTypeRequiredDescription
productStringYesID of the product to add.
priceNumberNoPrice of the product in this price list.
discountNumberNoDiscount percentage off the product's regular price. Used when price is not sent.
tierPriceArrayNoQuantity-based prices for the product.
variantsArrayNoVariant prices.

The variant and tier price objects are the same as in Create Price List.

cURL Example​

curl --location '<BASE_URL>/priceList/66ad153dbf8641f96544341d/product' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"product": "66b4a01249e6ce3d41c428fa",
"variants": [
{ "variantId": "66d5a286fcb786834cebb167", "price": 110 },
{ "variantId": "66d5a286fcb786834cebb168", "discount": 15 }
]
}'

Response​

  • 200 OK: The request was processed. If the price list was not found, or the product is already in the price list, success is false and message explains why.
  • 400 Bad Request: The access token is missing or invalid, the request body is empty or not valid, or the product or a variant was not found.

Sample JSON Response​

{
"success": true,
"message": "Product added to price list successfully",
"data": {
"_id": "66ad153dbf8641f96544341d",
"name": "Wholesale Tier A",
"status": true,
"createdAt": "2024-08-02T17:19:57.270Z",
"updatedAt": "2024-10-03T11:07:39.081Z",
"id": "66ad153dbf8641f96544341d"
}
}

Response Details​

FieldTypeDescription
successBooleanWhether the request succeeded.
messageStringResult message.
dataObjectThe price list's id, name, status and timestamps.

Notes​