REST API Store Specific Product Data Import
Use this resource to update Quant product data that is specific to each store. It currently uses JSON as both input and output.
Only a Quant user with the Robot role who has this Import enabled in the settings can access the import (see the Store Specific Data Import attribute in picture 1). Otherwise, the import will not be performed and the status attribute in the response will contain an error message:
HTTP 401 {"token":<TOKEN>,"status":"User is not authorized for this Resource."}
- Request
Parameter | Value |
URL | /storeSpecificProductDataImport/json |
Debug | ?debug=true added to the URL will also display a warning in the response. Without it, only errors are listed. |
Header | Accept: application/json |
Header | Content-type: application/json |
Header | Authorization: Bearer <TOKEN> TOKEN is obtained by /authenticate (see Login). |
Method | POST |
Payload | [{id1:value1, id2:value2}, {id1:value3, id2:value4}] An array of JSON objects, in which each JSON object describes the attributes of one product in one store. |
- Attributes
Import settings are also entered on the user (see Figure 1).
Attribute | Description | Type |
Enabled | Specifies whether the automated task is active and can send data through it. | yes/no |
Title | Custom name of the automated task. | text |
Description | Custom description of the automatic task function. | formatted text |
Notes | Notes. | long text |
Matching Attribute | A product attribute in Quant that will help to match items from the import with products in Quant. | selection |
Create New Products | If enabled, the import will create new products for non-existent product IDs. This option is active only when the Primary Product Id is selected in the Matching attribute. | yes/no |
Set New Products for Planogramming | If enabled, newly created products will be designed to create planograms. This option is active only when Create New Products is activated. | yes/no |
Ignore Deleted Products | If the import does not find an active product for a given ID, it searches among the deleted products by default. If it finds a deleted one, it will reactivate it. Enabling this option ignores deleted products instead of recovering them. | yes/no |
Product Attribute Mapping | A mapping containing an entry for each product attribute to be imported. This item defines the way the values from the input are interpreted (viz. picture below). For more details see Mapping Attribute. | complex type |
Measure Unit | Measure units as cm, mm etc. | selection |
Decimal Point | Character separating the whole and decimal part of numbers. If a comma is selected, numeric values must also be enclosed in quotation marks because the comma separates attributes in JSON. | symbol |
String value for TRUE | Text that will be considered (regardless of case) as "Yes" for yes / no attributes. All other values are translated to "No". | text |
Date format | Date entry format, eg 31.12.19 | selection |
Remove Zero Prefix from Store ID | If enabled, leading zeros are removed from the store ID. The ID "00123" from the input is converted to "123" and the store in Quant is searched based on it. | yes/no |
Store Specific Attributes to Clear | A list of store specific attributes that are deleted from all products for all stores before the import is performed. | selection |
Launch Price Change Detection | If enabled, detection of price tag changes is triggered if the import has made any changes. | yes/no |
- Product Attribute Mapping
- Mapping Attribute
Attribute | Description | Type |
Store Specific Product Attribute | A product attribute that is updated with this value. | selection |
Key | Keys texts are in JSON | text |
Values Replacement | Defines a mapping list where the text value from the input is replaced by another value before conversion to a specific attribute type. | complex type |
Product ID and Store ID must have mappings. Otherwise, the import ends with an error:
HTTP 409 {"token":<TOKEN>,"status":"Check Execution Log in Quant for details"}
The record value for the Product Id matches the product value for the Matching attribute.
The record value for the Store Id matches the store value for the External Id attribute.
- Response
Parameter | Value |
Body | {"token":"<TOKEN>","status":"<STATUS>,"Total Lines":<LINE_COUNT>,"Ignored Products":<IGNORED>, "Unknown Store IDs":<UNKNOWN>","Errors":[ERRORS],"Warnings":[WARNINGS]"} |
Atribut | Description | Type |
Token | User authorization token. | text |
Status | SUCCESS if everything was imported correctly and PARTIAL_SUCCESS if the import was successful but some records were not imported and FAILURE if there was an unexpected error that stopped the import prematurely. | text |
Total Lines | Number of records on input. | number |
Ignored Products | Number of records not imported due to:
| number |
Unknown Store IDs | The number of records that contain a store Id that does not exist in Quant. | number |
Errors | An array of JSON objects describing errors. | JSON Array |
Warnings | An array of JSON objects describing the warning (only if the request contained the parameter debug = true). | JSON Array |
- Execution Log
In Quant, in addition to the import settings on the Robot, you can also view records of individual imports, including statistics, errors, warnings and general information.
If we select a specific record, we can display its details by clicking the Show items button. After marking the selected items, cllick on Download files. These files contain the input data for the given import run.
- Request
curl -H "accept: application/json" -H 'content-type: application/json' -H 'Authorization: Bearer i37YKbgCnJSXe2nvIrHA1fE8bLIE4RqROu4l1A- OTzHZXSmZ3CX'
https://[YOUR_COMPANY].iquant.eu/storeSpecificProductDataImport/json?debug=true -d
'[{"productId":"500001","Store_ID":"1","Sales Price":"1.23"},{"productId":"500001","Store_ID":"2","Sales Price":"2.34"}]'
This example shows the update of the price of one product in two stores after previously obtaining TOKEN by logging in.
- Response
{"token":"i37YKbgCnJSXe2nvIrHA1fE8bLIE4RqROu4l1AOTzHZXSmZ3CX","status":"SUCCESS","Total Lines":2,"Ignored Products":0, "Unknwon Store IDs":0,"Warnings":["There is a mapping with empty REST Element for attribute: Club Price"]}
This response indicates a successful import with one warning. Details and statistics can then be found in Quant.