Skip to main content

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​

ParameterTypeDescription
idStringRequired. The ID of the price list.

Request Body​

Send the products to remove in one of these formats:

FormatExampleResult
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​

FieldTypeRequiredDescription
productStringYesID of the product.
variantsArrayNoIDs 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, success is false and message explains 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​

FieldTypeDescription
successBooleanWhether the request succeeded.
messageStringSummary of what was removed.
dataObjectThe price list's id, name, status and timestamps.
removedProductsArrayIDs of the products that were removed.
removedVariantsArrayThe variants that were removed, grouped by product.
warningsArrayReturned only when some items were not found.
notFoundProductsArrayReturned only when some products are not in the price list.
notFoundVariantsArrayReturned 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.