Get Price Lists by Products
Returns, for each product you send, the price lists that contain it and the prices they set.
HTTP Request
- URL:
/priceList/products/query - Method:
POST - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_PRICELISTorREAD_WRITE_PRICELIST
Request Body
Send the IDs of the products to look up.
| Field | Type | Required | Description |
|---|---|---|---|
productIds | Array | Yes | IDs of the products. Send at least one ID. |
cURL Example
curl --location '<BASE_URL>/priceList/products/query' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"productIds": ["663a0cbe516313e5bc94aa8c", "65b0d13f98539a33577ac4ec"]
}'
Response
- 200 OK: The price lists were returned successfully.
- 400 Bad Request: The access token is missing or invalid,
productIdsis missing or empty, or a product ID is not valid.
Sample JSON Response
{
"success": true,
"data": [
{
"id": "663a0cbe516313e5bc94aa8c",
"pricelists": [
{
"id": "66ad153dbf8641f96544341d",
"name": "Wholesale Tier A",
"status": true,
"price": 58.5,
"discount": 0,
"tierPrice": [
{
"_id": "66fe7afb32aceb199725ae1f",
"quantity": 10,
"discount": 0,
"price": 55,
"tierPricingType": "fixed"
}
],
"variants": [],
"createdAt": "2024-08-02T17:19:57.270Z",
"updatedAt": "2024-10-03T11:07:39.081Z"
}
]
},
{
"id": "65b0d13f98539a33577ac4ec",
"pricelists": []
}
]
}
Response Details
Product Data
| Field | Type | Description |
|---|---|---|
id | String | ID of the product you sent. |
pricelists | Array | Price lists that contain the product. Empty if there are none. |
Price List Object
| Field | Type | Description |
|---|---|---|
id | String | ID of the price list. |
name | String | Name of the price list. |
status | Boolean | Whether the price list is active. |
price | Number | Price of the product in this price list. |
discount | Number | Discount percentage for the product. |
tierPrice | Array | Quantity-based prices. See Get Price List. |
variants | Array | Variant prices. See Get Price List. |
createdAt | String | Date and time the price list was created (ISO 8601). |
updatedAt | String | Date and time the price list was last updated (ISO 8601). |
Notes
- Results are returned in the same order as
productIds. - Both active and inactive price lists are included. Check
statusto tell them apart.