Update Product Price List
Adds products to a price list, or updates their prices if they are already in it. You can send one product or a list of products.
HTTP Request
- URL:
/priceList/{id}/product - Method:
PUT - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_PRICELIST
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the price list. |
Request Body
Send a single product object, or an array of product objects.
| Field | Type | Required | Description |
|---|---|---|---|
product | String | Yes | ID of the product. |
price | Number | No | Price of the product in this price list. |
discount | Number | No | Discount percentage off the product's regular price. Used when price is not sent. |
tierPrice | Array | No | Quantity-based prices for the product. |
variants | Array | No | Variant prices. When sent, replaces the product's variant prices. Leave out to keep them. |
The variant and tier price objects are the same as in Create Price List.
cURL Example
curl --location --request PUT '<BASE_URL>/priceList/66ad153dbf8641f96544341d/product' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '[
{
"product": "663a0cbe516313e5bc94aa8c",
"price": 56
},
{
"product": "66b4a01249e6ce3d41c428fa",
"variants": [
{
"variantId": "66d5a286fcb786834cebb167",
"price": 120,
"tierPrice": [{ "quantity": 4, "discount": 4 }]
}
]
}
]'
Response
- 200 OK: The request was processed. If the price list was not found,
successisfalseandmessageisPriceList not found. - 400 Bad Request: The access token is missing or invalid, the request body is empty or not valid, or a product or variant was not found.
Sample JSON Response
{
"success": true,
"message": "1 products added, 1 products updated in price list",
"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
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request succeeded. |
message | String | How many products were added and updated. For a single product, Product added to price list successfully or Product price updated successfully. |
data | Object | The price list's id, name, status and timestamps. |
Notes
- When you send
variants, include each product's full set of variant prices. - To see the saved prices, use Get Price List.