Skip to main content

Insert or Update Product


This API facilitates the insertion or updating of product details. If the product already exists in the system, the API will update the provided information; otherwise, it will insert the new product.

While certain details in the API body are optional, it is recommended to include as much information as possible to enhance the accuracy of the analysis.

Request

Method: POST
Endpoint: /2.8/UpdateProductDetails
curl --location 'https://RECS_API_BASE_URL/2.8/UpdateProductDetails' \
--header 'Authorization: Bearer THE_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
    "Event": "UpdateProductDetails",
    "WebPropertyID": "CLIENT_WEBSITE_ID"
    "Products": [
        {
            "SKU": "PRODUCT_SKU",
            "LanguageTag": "en-AU",
            "Description": "Product 1",
            "RefId": "15172",
            "Name": "PRODUCT_NAME",
            "Url": "PRODUCT_URL",
            "IsInStock": true,
            "ImageURL": [
                "PRODUCT_IMAGE_URL"
            ],
            "Price": "$29.9",
            "DiscountedPrice": "$25.3",
            "Brand": {
                "name": "PRODUCT_BRAND_NAME",
                "url": "PRODUCT_BRAND_URL"
            },
            "Attributes": [
                {
                    "name": "Additional_Info",
                    "type": 5003,
                    "options": [
                        {
                            "value": "{\"attributeName\":\"attribute[15300]\",\"attributeValue\":\"19883\",\"size\":\"200ml\"}"
                        }
                    ]
                },
                {
                    "name": "NumberOfRating",
                    "type": 5001,
                    "scalarValue": 2
                },
                {
                    "name": "ProductRating",
                    "type": 5001,
                    "scalarValue": 5
                }
            ]            
        },
        {
            "SKU": "PRODUCT_SKU",
            "LanguageTag": "en-AU",
            "Description": "product-2",
            "RefId": "15173",
            "Name": "PRODUCT_NAME",
            "Url": "PRODUCT_URL",
            "IsInStock": true,
            "ImageURL": [
                "PRODUCT_IMAGE_URL"
            ],
            "Price": "$29.9",
            "DiscountedPrice": "$25.3",
            "Brand": {
                "name": "PRODUCT_BRAND_NAME",
                "url": "PRODUCT_BRAND_URL"
            },
            "Attributes": [
                {
                    "name": "Additional_Info",
                    "type": 5003,
                    "options": [
                        {
                            "value": "{\"attributeName\":\"attribute[15301]\",\"attributeValue\":\"19887\",\"size\":\"200ml\"}"
                        }
                    ]
                },
                {
                    "name": "NumberOfRating",
                    "type": 5001,
                    "scalarValue": 10
                },
                {
                    "name": "ProductRating",
                    "type": 5001,
                    "scalarValue": 4.6
                },
                {
                    "name": "Menu_Category_Level_1",
                    "type": 5000,
                    "stringValue": "Beauty & Body"
                }
            ]
        }
    ]    
}'

Request Header

To generate the access token follow the token API doc.

Request Body Parameters

NameTypeDescriptionRequirements
EventStringEvent NameRequired. Predefined value for this API it is fixed, UpdateProductDetails
WebPropertyIDGUIDWebsite IDRequired. Value can be get from web portal or ask concern person for it.
Products[x].SKUStringProduct SKUNot required.
Products[x].LanguageTagStringProduct Language TagRequired. Follow IETF language tag
Example: en-AU
Products[x].DescriptionStringProduct DescriptionNot required.
Products[x].RefIdStringProduct Ref IdRequired. This is unique identifier of the product. This should be uniqe for the whole product list of the store. Sometimes it is same as SKU
Products[x].NameStringProduct NameRequired.
Products[x].UrlStringProduct URLRequired. Must have the full domain name, i.e. has to start with http or https
Products[x].IsInStockBooleanProduct Stock InformationNot required. True/False value based on the availability of the product
Products[x].ImageURLString ArrayProduct Image URLsNot required. This is an array of image urls.
Products[x].PriceStringProduct PriceNot required.
Products[x].DiscountedPriceStringProduct discounted PriceNot required. If the product has discount the discounted price should be send in this field.
Products[x].BrandObjectProduct brand information.Not required.
Products[x].Brand.nameStringBrand nameNot Required.
Products[x].Brand.urlStringBrand list page URLNot Required.
Products[x].AttributesObject ArrayProduct Attributes like color, size, variants, etc.Not required.
Products[x].Attributes.nameStringThis is a unique value. PA will provide the name or see the link for available namesRequired.
Products[x].Attributes.typeNumberThis value needs to be greater than 0 and unique for each attribute.
Ex. Colour: 1, Size: 2, Rating: 3, etc. Always same value needs to be used for a given attribute name. For example, if "2" is used for "Size", this will always needs to be the same.
Required.
Products[x].Attributes.stringValueStringValue of the attributeOne of the following three are required stringValue or scalarValue or options.
Products[x].Attributes.scalarValueNumericValue of the attributeOne of the following three are required stringValue or scalarValue or options.
Products[x].Attributes.optionsObject ArrayAttributes should have string value or option. The option value will be a aobject array.One of the following three are required stringValue or scalarValue or options.

Response

{
    "type": 1,
    "code": 0
}

Fields

Field NameUsage
typeType 1 means ok. Other possible values Error: -30, NetworkError: -31, SystemError: -32, UnspecifiedError: -100. Any value start with - means there may be an error.