REST API Import Action Products

This source is used to import action products into Quant. Through this import process, you can create promotional events in Quant that affect orders or product placement in planograms, for example. You can also use actions to print prepared shelf labels. This enables stores to print changed shelf labels before action products go on sale. The input and output format is JSON. 

Use the Automatic Task section to create and configure an import. Once the task has been created, its ID will appear in the task list. You will need to include this ID in the request URL.

Automatic Task
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 Action Product Attribute Mapping, select the attributes to import and optionally modify their JSON keys.
  • We also recommend filling in the Emails for Notifications field, where you can enter one or more email addresses to which error notifications will be sent.
  • Attributes 
Atribute
Description
Type
Enabled
Specifies whether the automated task is active and data can be sent 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
Delay in Seconds before Retrying
This is the number of seconds that the client should wait before retrying the import in the event of a long queue of requests to the server.
complex type
Action Product Attribute Mapping
A mapping that includes fields for Action Name, Action Type, Start Date, End Date, Store ID, and Product ID.
selection
Measure Unit
Measure unit such as cm, mm etc.
selection
Date Format
Date entry format, eg 31.12.19.
selection
Date and Time Format
Date and time entry format, eg 19.12.31 23:59:59
selection
List Item Separator
This is the separator for items in a list of values.
selection
All Stores for Empty Store List
Check this box if you want the event to be set for all stores if no specific store is selected.
yes/no
Reset Contained Products and Stores
Before importing, all products from the included stores will be removed and only those included in the current task run will be reassigned to the action.
yes/no
Remove Zero Prefix from Store ID
It removes all leading zeros from the store ID. For example, the ID 0012 would become 12 during import.
yes/no

 

Settings
  • Request
/v1/import/action-products/{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 is received via /authenticate (see Login).

Method
POST


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

It is important that the request complies with JSON standards. Defined, for example, here. Please send numerical attribute values without quotation marks, see example.

 

  • 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.

 

  • 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.


  • Latest Logs

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

Latest Logs

 We can view the details of a specific record by selecting it and clicking the Download Files button.

Record Details


  • Request

curl -X POST --location "https://[YOUR_COMPANY].iquant.eu/v1/import/action-products/311028?debug" \

    -H "Authorization: Bearer ywJqq25pXO6oaCPqgEAiTioBVwM8Ih2kOwzzd3eWK3R2oDSA5n" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
-d "[{"Start Date":"1.11.24","End Date":"31.12.24","Primary Product ID":"100006","Name":"Promo 2 2024","Stores":"12,12564", "Action Type":"Flyer","Action valid until (Store Specific)":"1.11.24","Basic Sales Price":15.5,"Basic Sales Price (Default)":20},
{"Start Date":"1.11.24","End Date":"31.12.24","Primary Product ID":"100030","Name":"Promo 2 2024","Stores":"12,12564", "Action Type":"Flyer"}

]"
  • Response

{
  "Status": "SUCCESS", 
}