Update Single Price List Product
Updates the price, tier prices and variant prices of one product that is already in a price list. The product is given in the URL, so the body holds only the prices.
HTTP Request
- URL:
/priceList/{id}/product/{productId} - 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. |
productId | String | Required. The ID of the product to update. |
Request Body
Send the new prices.
| Field | Type | Required | Description |
|---|---|---|---|
price | Number | No | New 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 | New 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/663a0cbe516313e5bc94aa8c' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"price": 52.75,
"tierPrice": [
{ "quantity": 10, "price": 50, "tierPricingType": "fixed" },
{ "quantity": 50, "price": 47.5, "tierPricingType": "fixed" }
]
}'
Response
- 200 OK: The request was processed. If the price list was not found, or the product is not in the price list,
successisfalseandmessageexplains why. - 400 Bad Request: The access token is missing or invalid, the request body is empty or not valid, or a variant was not found.
Sample JSON Response
{
"success": true,
"message": "Product price updated 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
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request succeeded. |
message | String | Result message. |
data | Object | The price list's id, name, status and timestamps. |
Notes
- When you send
variants, include the product's full set of variant prices. - To add a product that is not in the price list yet, use Add Product to Price List.