Import Products

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

Request

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

Request Body:

Fields nameTypeDescription
productsForImportList<ImportProductRequest>List of products for import

ImportProductRequest

Fields nameTypeDescriptionMandatory
eanStringEAN (European Article Number)Yes
externalIdStringUnique ID in supplier's systemYes
nameStringProduct nameYes
descriptionStringProduct descriptionYes
brandStringProduct brandYes
specificationsStringProduct specificationsNo
coverImageStringURL to the imageYes
galleryStringList of URLs to the imagesYes
stockLevelIntegerStock levelYes
purchasePriceBigDecimalPurchase price of productYes
skuStringSKUNo

Example of the request:

Click to copy
Success!
{
    "productsForImport":[
        {
            "ean": "700222111331",
            "externalId": "samsungevoakvafor1",
            "name": "Samsung EVO",
            "description": "SSD disk.",
            "brand": "Samsung",
            "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 import.

Field NameTypeDescription
eanStringEAN (European Article Number)
externalIdStringUnique ID in supplier's system
skuStringSKU
successBooleanIndicates if import is successful
errorsList<String>List of error messages in case of failed product import

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.