Update Products
POST REST API request for suppliers, requiring a JSON body and an authorization token, in order to update products.
Request
HTTP Method | POST | |||||
URL | Stage | https://api.qa2.ananastest.com/ws-inventory/api/v1/supplier-integration/products/update | ||||
Production | https://api.ananas.rs/ws-inventory/api/v1/supplier-integration/products/update | |||||
HTTP Headers |
|
Request Body:
Fields name | Type | Description |
productsForUpdate | List<UpdateProductRequest> | List of products for update |
UpdateProductRequest
Fields name | Type | Description | Mandatory |
ean | String | EAN (European Article Number) | Yes |
specifications | String | Product specifications | No |
coverImage | String | URL to the image | No |
gallery | String | List of URLs to the images | No |
stockLevel | Integer | Stock level | No |
purchasePrice | BigDecimal | Purchase price of product | No |
sku | String | SKU | No |
Example of the request:
{
"productsForUpdate":[
{
"ean": "700222111331",
"specifications": "{\"color\": \"Red\", \"size\": \"M\"}",
"coverImage": "https://ananas.rs/_next/image?url=https%3A%2F%2Fstatic.ananas.rs%2Fassets%2FProduct_Images%2F8718863041659_1.png&w=1648&q=75",
"gallery": [
"https://ananas.rs/_next/image?url=https%3A%2F%2Fstatic.ananas.rs%2Fassets%2FProduct_Images%2F8718863041659_1.png&w=1648&q=75"
],
"stockLevel": 100,
"purchasePrice": 6999,
"sku": "sku1"
}
]
}
Response
Response is a collection of responses for each product sent for update.
Field Name | Type | Description |
ean | String | EAN (European Article Number) |
externalId | String | Unique ID in supplier's system |
sku | String | SKU |
success | Boolean | Indicates if update is successful |
errors | List<String> | List of error messages in case of failed product update |
Example of response:
JSON:
[
{
"ean": "700222111331",
"externalId": "externalId1",
"sku": "sku1",
"success": true,
"errors": null
},
{
"ean": "123123123123",
"externalId": "externalId2",
"sku": "sku2",
"success": false,
"errors": [
"Product name is required."
]
}
]