Remove Price List Products
Removes products from a price list. You can remove a whole product, or remove only the prices of selected variants.
HTTP Request
- URL:
/priceList/{id}/product - Method:
DELETE - 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 the products to remove in one of these formats:
| Format | Example | Result |
|---|---|---|
| Array of product IDs | ["663a0cbe516313e5bc94aa8c"] | Removes each product. |
Object with productIds | { "productIds": ["663a0cbe516313e5bc94aa8c"] } | Removes each product. |
| Mixed array | ["663a...", { "product": "66b4...", "variants": ["66d5..."] }] | IDs remove whole products. Objects remove only the listed variants. |
Variant Removal Object
| Field | Type | Required | Description |
|---|---|---|---|
product | String | Yes | ID of the product. |
variants | Array | No | IDs of the variants to remove. If empty, the whole product is removed. |
cURL Example
curl --location --request DELETE '<BASE_URL>/priceList/66ad153dbf8641f96544341d/product' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '[
"663a0cbe516313e5bc94aa8c",
{ "product": "66b4a01249e6ce3d41c428fa", "variants": ["66d5a286fcb786834cebb168"] },
"663a0cbe516313e5bc94aa99"
]'
Response
- 200 OK: The request was processed. If the price list was not found, or none of the products or variants were found in it,
successisfalseandmessageexplains why. - 400 Bad Request: The access token is missing or invalid, or the request body is empty or not valid.
Sample JSON Response
{
"success": true,
"message": "1 product removed, 1 variant removed from 1 product from 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"
},
"removedProducts": ["663a0cbe516313e5bc94aa8c"],
"removedVariants": [
{
"product": "66b4a01249e6ce3d41c428fa",
"variants": ["66d5a286fcb786834cebb168"]
}
],
"warnings": ["1 product not found"],
"notFoundProducts": ["663a0cbe516313e5bc94aa99"]
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request succeeded. |
message | String | Summary of what was removed. |
data | Object | The price list's id, name, status and timestamps. |
removedProducts | Array | IDs of the products that were removed. |
removedVariants | Array | The variants that were removed, grouped by product. |
warnings | Array | Returned only when some items were not found. |
notFoundProducts | Array | Returned only when some products are not in the price list. |
notFoundVariants | Array | Returned only when some variants were not found, grouped by product. |
Notes
- If you remove all of a product's variant prices, the whole product is removed from the price list.