Bulk Update Price List Products
The PUT endpoint updates multiple products within a price list with the specified details.
Endpoint
- URL:
/priceList/bulk - Method:
PUT
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Request Headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | Must be application/json. |
accessToken | string | Access token for authentication. (required) |
Request Body
The request body should include an array of price list updates. Below are the fields required for each update:
| Field | Type | Description |
|---|---|---|
id | string | The unique identifier of the price list. |
products | array | List of products and their updated details. |
Products Object:
Each item in the products array should include:
| Field | Type | Description |
|---|---|---|
product | string | The unique identifier of the product. |
variants | array | List of variant objects for the product (optional) |
discount | number | Discount applied to the product. |
price | number | Base price of the product. |
tierPrice | array | List of updated tier pricing objects for the product. |
Variant Object (Optional):
| Field | Type | Description |
|---|---|---|
variantId | string | The unique identifier of the product variant. |
discount | number | Discount applied to the variant. |
price | number | Price of the variant. |
tierPrice | array | List of tier pricing objects for the variant. |
Tier Price Object:
| Field | Type | Description |
|---|---|---|
quantity | number | Minimum quantity for tier pricing. |
price | number | Price at this tier. |
tierPricingType | string | Type of tier pricing (e.g., "fixed"). |
Sample Request Body
[
{
"id": "675a966b3cb7c7674fde7cd4",
"products": [
{
"tierPrice": [
{
"quantity": 1.0,
"tierPricingType": "fixed",
"price": 26.03
},
{
"quantity": 10.0,
"tierPricingType": "fixed",
"price": 18.13
}
],
"variants": [
{
"variantId": "67add68161145c61b8efc049",
"discount": 0,
"price": 0,
"tierPrice": []
}
],
"discount": 0,
"price": 0,
"product": "67ade7af5bc93d43bdce0fc4"
},
{
"tierPrice": [
{
"quantity": 1.0,
"tierPricingType": "fixed",
"price": 26.03
},
{
"quantity": 10.0,
"tierPricingType": "fixed",
"price": 18.13
}
],
"product": "65b0d13f98539a33577ac4ec"
}
]
}
]
Response
- Status Code: 200 OK
Sample Response Body
{
"success": true,
"message": "Price List Products updated successfully"
}
Success Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the success status of the request. |
message | string | A message conveying the outcome of the operation, e.g., "Price List Products updated successfully". |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Invalid input data. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 500 | Internal Server Error: An error occurred on the server. |
Notes
- Ensure your request body is formatted according to the specified structure.
- Provide a valid and active access token in the request header to authenticate your request.