Update Products

POST REST API request for suppliers, requiring a JSON body and an authorization token, in order to update products.

Request

HTTP MethodPOST
URLStagehttps://api.qa2.ananastest.com/ws-inventory/api/v1/supplier-integration/products/update
Productionhttps://api.ananas.rs/ws-inventory/api/v1/supplier-integration/products/update
HTTP Headers
Header nameHeader value
AuthorizationBearer {access_token}

Request Body:

Fields nameTypeDescription
productsForUpdateList<UpdateProductRequest>List of products for update

UpdateProductRequest

Fields nameTypeDescriptionMandatory
eanStringEAN (European Article Number)Yes
specificationsStringProduct specificationsNo
coverImageStringURL to the imageNo
galleryStringList of URLs to the imagesNo
stockLevelIntegerStock levelNo
purchasePriceBigDecimalPurchase price of productNo
skuStringSKUNo

Example of the request:

Click to copy
Success!
{
    "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 NameTypeDescription
eanStringEAN (European Article Number)
externalIdStringUnique ID in supplier's system
skuStringSKU
successBooleanIndicates if update is successful
errorsList<String>List of error messages in case of failed product update

Example of response:

JSON:

Click to copy
Success!
[
    {
        "ean": "700222111331",
        "externalId": "externalId1",
        "sku": "sku1",
        "success": true,
        "errors": null
    },
    {
        "ean": "123123123123",
        "externalId": "externalId2",
        "sku": "sku2",
        "success": false,
        "errors": [
            "Product name is required."
        ]
    }
]
Copyright © Ananas 2023. All right reserved.