Upsert (Update/Insert) Products

The third endpoint is one of the most important endpoint. This is the endpoint to send your items that will be used in our system to search your items. This is a bulk insert/update endpoint, so you can give multiple items at once (max 500 items at once to give best performance).

note

All attributes in the items must be provided by the mapping fields, which you add in the first step.

POST#

https://api.altoshift.com/api/upsert/products

Header#

FieldTypeDescription
x-tokenStringtoken Users unique token

Request Header Example#

{
"x-token": "2b46ad0b537229cf450777dcc655a8620571e18556c473f065f44739"
}

Request Body#

FieldTypeDescription
itemsObject[]Items
idStringUnique id of the item
title optionalStringTitle of the item, our search widget and client panel will use this field to show the name of product
link optionalStringOur search widget need this field to go to the product page after user click
image_link optionalStringUrl of image, our search widget and client panel will use this field to show the picture of product
thumb_link optionalStringUrl of image (smaller than image_link or same one with image_link), our search widget and client panel will use this field to show the picture of product
availability optionalStringBoolean to detect the availability of the items (this will used in our search widget)
categoryIds optionalStringYou didnt need to add this in mappingSync, we already provide this and hide it from client panel. Array of categoryId, this field will be used for autosuggestion and filter category espcially if you used our search widget
price optionalStringPrice of the product, our default search widget will use this field to show price
sale_price optionalStringSale price of the product, our default search widget will use this field to show sale price and will give strikethrough text to price
coordinates optionalObjectCoordinates of the product if you want to use geolocation feature

Body Request Example#

{
"items": [
{
"availability": true,
"brand": "AQUA",
"description": "SPECIFICATION Door Dua Pintu Capacity Net Total Liter 425 Liter Capacity Net for Freezer Liter Capacity Net for Fridge Liter Tempered Glass Shelves Yes Cooling System Inverter Technology Yes Frost No Consumption W 170 Watt Color Silver Dimension WxDXH mm 700 x 610 x 1770",
"image_link": "https://www.test.com/images/thumbnails/42/320/320/AQR-460R.png",
"link": "https://www.test.com/en/aqua-big-2-door-refrigerator-aqr-460r.html",
"price": 6839000,
"productId": "81899",
"sale_price": 6659000,
"sku": "AQR-460R",
"thumb_link": "https://www.test.com/images/thumbnails/42/320/320/AQR-460R.png",
"title": "BIG 2 DOOR REFRIGERATOR AQR-460R",
"coordinates": {
"lat": 38.8951,
"lon": -77.0364
}
}
]
}

Success 200#

FieldTypeDescription
successBooleanRequest was successful
insertedNumberNumber of total success inserted items
failedObject[]Reasons of fail inserted items
    reasonStringUnique id of the items

Success Response Example#

{
"success": true,
"response": {
"inserted": 1,
"failed": [
{
"reason": "failed to parse field [price] of type [double]"
}
]
}
}