Update API provides a service to update the existing products in your product catalog. You can send any of the field requests to update your product catalogs directly.
Endpoint and Headers
Visit our Postman collection to test this request.
Headers
| Headers | Sample Value | Description |
|---|---|---|
| X-PARTNER-NAME | my-parter-name | This is your partner name. Navigate to InOne > Inone Settings > Account Settings to copy your partner name. The partner name should be lowercase. |
| X-REQUEST-TOKEN | 1a2b3c4d5e6f | This key is required to authorize your request. Refer to API Authentication Tokens to generate your Catalog API token. |
Query Parameters
As stated, the following product fields should be sent as parameters in the object, along with their field name and data type. If any of the required fields are not sent through the Catalog API, the respective product is not updated or inserted. At least one update field should be sent, except for the required fields.
| Field Name | Description | Data Type | Required |
|---|---|---|---|
| item_id | Unique product ID | String | Yes |
| locale | Language of the website | String | Yes |
| name | Name of the product | String | No |
| url | URL address of the product | String | No |
| image_url | URL address of the product image | String | No |
| category | Category tree of the product | Array (of string) | No |
| description | Product description | String | No |
| price | Unit price of the product. Object key is currency (string), and the value will be in float type. | Object {String:Float} | No |
| original_price | Original price of the product without any discount. Object key is currency (string), and the value will be in float type. | Object {String:Float} | No |
| in_stock | The stock status of the product | Integer | No |
| variants | Other variants of the given product ID | Array (of string) | No |
| brand | Brand information of the product | String | No |
| color | Color information of the product | String | No |
| size | Size information of the product | String | No |
| groupcode | Information for group product variants. | String | No |
| product_attributes | The object of the custom product attributes | Object {key:value} | No |
Sample Request 1
The sample below displays a request to update an existing product in your Product Catalog using the Update API.
You can send one or more product objects in JSON format (batched in a comma-separated list). Any field you provide in the request will be updated in the product catalog.
[{
"item_id": "2159967",
"locale": "en_US",
"in_stock": 1,
"price": {
"USD": 40.9
},
"original_price": {
"USD": 49.9
}
}]Sample Response 1
Catalog API returns responses with a status code 200 for successful requests. Successful responses display the number of valid products to be updated and the complete information about the failed products.
{
"success": true,
"message": {
"invalidRatio": 0,
"valid": {
"count": 1
},
"invalid": {
"count": 0,
"details": []
},
"warnings": {
"count": 0,
"details": []
}
}
}Sample Request 2
The sample below displays a request to update an existing product in your product catalog.
The Update API can return successful responses with warnings in cases where optional attributes are incorrectly entered. In such cases:
- The product(s) in the request are still being processed and updated.
- Attributes that triggered the warnings are ignored and not updated in your product catalog.
[{
"item_id": "Item-123",
"locale": "en_US",
"in_stock": 1,
"price": {
"USD": 35.5
},
"original_price": {
"USD": 35.5
},
"product_attributes": {
"stock_code": "01020304"
}
}]Sample Response 2
In this example, if the stock_code attribute is not defined as a Product Attribute for you before requesting the Catalog API, responses include a warning message as follows.
{
"success": true,
"message": {
"invalidRatio": 0,
"valid": {
"count": 1
},
"invalid": {
"count": 0,
"details": []
},
"warnings": {
"count": 1,
"details": [
{
"message": "Product attribute keys are not included in partners attribute.(stock_code)is not included in partner attribute map.",
"count": 1,
"document_ids": [
"Item-123:en_US"
]
}
]
}
}
}400 Invalid Data Exception; Couldn't Parse JSON
{
"status": false,
"message": "Request data is not in valid JSON format."
}400 Maximum Allowed Record Count
{
"status": false,
"message": "Maximum allowed request size is exceeded."
}400 Maximum Allowed Request Size
{
"status": false,
"message": "Maximum allowed request size is exceeded."
}401 Partner Cannot Be Validated
{
"status": false,
"message": "Partner does not have necessary integration settings for Catalog API."
}401 Wrong Token Usage
{
"status": false,
"message": "Partner token authentication failed."
}500 Internal Server Error
{
"status": false,
"message": "Internal server error."
}Limitations
- This API allows only existing data to be sent. If a non-existent product is sent, it will not be updated.
- For all the other limitations, refer to Catalog API Limitations.