Edit products in bulk
PUT REST API request that requires a JSON body with authorization token in order to acquire, edit desired product.
Request
Request:HTTP Method | PUT | |||||
URL | Stage | https://api.stage.ananastest.com/product/api/v1/merchant- integration/product/bulk | ||||
Production | https://api.ananas.rs/product/api/v1/merchant-integration/product/bulk | |||||
HTTP Headers |
|
The request body represents an array of elements that have the following fields:
Fields name | Type | Description |
id | Long | Product id |
packageWeightValue | BigDecimal/Double | Package weight of product |
packageWeightUnit | String | Product weight package unit |
basePrice | BigDecimal/Double | Product price with VAT included |
stockLevel | integer | Product available stock level |
serviceable | boolean | Serviceable flag |
sku | String | SKU value |
Example of request body:
[
{
"id": 1770663,
"stockLevel": 11,
"basePrice": 155.3,
"vat": 0,
"packageWeightValue": 2.55,
"packageWeightUnit": "kg",
"serviceable": true,
"sku": "00280106"
},
{
"id": 123,
"stockLevel": 11,
"basePrice": 155.3,
"vat": 0,
"packageWeightValue": 2.55,
"packageWeightUnit": "kg",
"serviceable": true,
"sku": "00280107"
},
{
"id": 1770662,
"stockLevel": 11,
"basePrice": 155.3,
"vat": 4,
"packageWeightValue": 2.55,
"packageWeightUnit": "kg",
"serviceable": true,
"sku": "00280108"
}
]
Response
If the product with the ID does not exist, the endpoint will return a status of 404. Otherwise, it returns status 200 with the corresponding message
Response Body:The response body represents an array of elements that have the following fields:
Fields name | Type | Description |
status | String | Action status. Values: “SUCCESS” or “FAIL” |
errors | Array of string | Errors if action failed |
myProductId | Long | Product id |
Example of response:
[
{
status: "SUCCESS",
errors: [],
myProductId: 1770663,
},
{
status: "FAIL",
errors: ["Proizvod ne postoji"],
myProductId: 123,
},
{
status: "FAIL",
errors: [
"PDV mora biti jedan od sledecih vrednosti: 0, 10, 20. Prosleđena vrednost je 4",
],
myProductId: 1770662,
},
];