Skip to main content

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​

ParameterTypeDescription
idStringRequired. The ID of the price list.
productIdStringRequired. The ID of the product to update.

Request Body​

Send the new prices.

FieldTypeRequiredDescription
priceNumberNoNew price of the product in this price list.
discountNumberNoDiscount percentage off the product's regular price. Used when price is not sent.
tierPriceArrayNoNew quantity-based prices for the product.
variantsArrayNoVariant 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, 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 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​

FieldTypeDescription
successBooleanWhether the request succeeded.
messageStringResult message.
dataObjectThe 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.