REST API Product Replacements Import (V1)

This source is used to product data import in Quant. Input and output format is JSON.

Use the  Automatic Tasks section to create and set up an import. Once created, the task list will have the ID that you pass in the request URL.

Automatic Tasks in Quant

 

Task ID
  • Settings

Before using the API, you must edit the following attributes in the Settings tab:

  • Check the Enabled attribute to enable the task
  • In the Users with API Access Permission, select one or more users with the Robot role who will have permission to run the task.
  • In the Product Replacement Attribute Mapping, select the attributes to import and optionally modify their JSON keys
  • Attributes
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
Emails for Notifications

One or more email addresses to which emails with error conditions will be sent.

list of strings
Users with API Access Permission
Users with the Robot role who are authorized to run the task.
list of users
Replace in Prepared Planograms
Determines whether replacements should also be made in prepared planograms.
yes/no
Implementation time in Days
Implementation time in days for the replaced implemented planogram.
yes/no
Implementation Photo Required
Specifies whether to require a photo of the implementation when there is a replacement in the implemented planogram.
yes/no
Matching Attribute
A product attribute in Quant that will be used to match import items with products in Quant.
selection
Delay in Seconds before Retrying
Recommended delay in seconds before retrying the request in case of a 503 error.
whole number
Product Replacement Attribute Mapping
A mapping containing an entry for each attribute to be imported.
complex type


Settings
  • Request

/v1/import/product-replacement/{task_id}

Parameter
Value
URL
?debug added to the URL will also display warnings in the response. Without it, only errors are listed.
Header
Accept: application/json
Header
Content-type: application/json
Header

Authorization: Bearer  <TOKEN>

TOKEN se získává pomocí /authenticate (see Login).

Method
POST

The content of the request is an array of JSON objects containing the keys defined in the Product Replacement Attribute Mapping setting. 

  • Response
Key
Value
Status
A string describing the final state of the import.
  • SUCCESS = error-free import process
  • PARTIAL_SUCCESS = import completed but generated one or more warnings
  • FAILURE = one or more errors occurred during the import
Warnings
It is optional, ie. is included only if the ?debug parameter is in the URL and the import generated at least one warning.
List of warning strings.
Errors
Optional - included only if the import generated at least one error.
List of warning strings.
Total Lines
Optional - is included only if the import did not end with the status "FAILURE"
Number of records on input.
Missing Products
Optional - only included if the import did not end with a "FAILURE" status
The number of records that were skipped because the product the record references was not found.
Duplicated Products
Optional - is included only if the import did not end with the status "FAILURE"
The number of records that were skipped because this product was already imported in the same request.
Number of Missing Stores
Optional - is included only if the import did not end with the status "FAILURE"
Number of records where the referenced store was not found.
Empty IDs
Optional - is included only if the import did not end with the status "FAILURE"
Number of records where some IDs were empty.
  • Status Codes
Status
Value
200 OK
Import successful with "SUCCESS" or "PARTIAL_SUCCESS" status. The response may contain warnings or minor errors.
400 Bad Request
Incorrect task settings or incorrect request.
401 Unauthorized
The authorization token is invalid, or the user who is logged on with the token does not have permission to run this task.
404 Not Found
No task was found with the ID specified in the URL.
500 Internal Server Error

A critical server-side error occurred during the import.

503 Service Unavailable

The task is already running. Retry launching the task after count of seconds given in response header Retry-After.

  • Execution Log

In Quant, in addition to task settings, you can also view records of individual imports, including statistics, errors, and warnings.

Execution Log

If we select a specific record, we can display its details by clicking the Show Items button.

Show Items 


  • Request

curl -X POST --location "http://[YOUR_COMPANY].iquant.eu/v1/import/product-replacements/54?debug" \ 

    -H "Authorization: Bearer ywJqq25pXO6oaCPqgEAiTioBVwM8Ih2kOwzzd3eWK3R2oDSA5n" \ 

    -H "Accept: application/json" \ 

    -H "Content-Type: application/json" \ 

    -H "Cache-Control: no-cache" \ 

-d '[{ "Primary Product ID": "100001", "Replacement ID": "12345"", "Store ID": "Prague 1" }]' 

  • Response

  "Status": "SUCCESS",  

  "Total Lines": 1, 

  "Missing Products": 0, 

  "Empty IDs": 0, 

  "Duplicated Products": 0, 

  "Number of Missing Stores": 0