REST API Exportación de pedidos

Esta fuente se utiliza para exportar datos de pedidos a Quant. Esta tarea automatizada exporta todos los pedidos que se generaron el día en que se ejecutó por última vez la tarea automatizada de pedidos MinMax. El formato de entrada y salida es JSON.

Utilice la sección Tareas automáticas para crear y configurar una exportación. Una vez creada, la lista de tareas tendrá el ID que usted introduzca en la URL de la solicitud.

Tarea automática
ID de tarea
  • Configuración

Antes de utilizar la API, debe editar los siguientes atributos en la pestaña Configuración:

  • Marque el atributo Activado para habilitar la tarea.
  • En Usuarios con permiso de acceso a la API, seleccione uno o varios usuarios con el rol Robot que tendrán permiso para ejecutar la tarea.
  • En la Asignación de atributos de datos de pedido, seleccione los atributos que desea exportar y, si lo desea, modifique sus claves JSON.
  • En el atributo Estados del pedido, seleccione los estados del pedido que desea exportar.
  • Además, le recomendamos que rellene el campo Correos electrónicos para notificaciones, donde deberá introducir una o varias direcciones de correo electrónico a las que se enviarán los mensajes con los estados de error.
  • Atributos
Atributo
Descripción
Tipo
Activado
Specifies whether the user can access this resource.
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
Order States
Specifies which states are to be exported.
list of states
Delay in Seconds before Retrying
The number of seconds the client should wait before retrying the export in case of a long queue of requests to the server.
whole number
Order Data Attribute Mapping
A mapping containing an entry for each attribute to be exported.
complex type
Measure Unit
Unit of measure such as cm, mm, etc.
selection
Date Format
Date entry format, eg 31.12.19
selection
Date and Time Format
Date and time format, e.g. 31.12.19 23:59:59
selection
List Item Separator
Character for splitting the items of the list of values.
character


Configuración
  • Solicitud

/v1/export/order-data/{task_id}

Parámetro
Valor
URL
?debug 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 via /authenticate (see Login).

Method
POST
  • Respuesta
Key
Value
Status
A string describing the final state of the export.
  • SUCCESS = error-free export process
  • PARTIAL_SUCCESS = export completed but generated one or more warnings
  • FAILURE = one or more errors occurred during the export
Warnings
Optional - included only if the ?debug parameter is in the URL and the export generated at least one warning.
List of warning strings.
Errors
Optional - included only if the export generated at least one error.
List of error strings.
Record
Optional - is only included if the export did not end with a "FAILURE" status.

List of exported objects. Each object contains the keys defined by the mapping in the task settings.

  • Códigos de estado
Estado
Valor
200 OK
Export 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 export.

  • Registro de ejecución

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

Execution Log

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

Detalles de Mostrar artículos


  • Solicitud

curl -X POST --location "http://[YOUR_COMPANY].iquant.eu/v1/export/order-data/246?debug" \
    -H "Authorization: Bearer ywJqq25pXO6oaCPqgEAiTioBVwM8Ih2kOwzzd3eWK3R2oDSA5n" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Cache-Control: no-cache" \
    -d "{}"

  • Respuesta

{
  "Status": "SUCCESS", "Records": [
  {"QID": "933291", "Store ID": "198", "Primary Product Id": "100005", "Order Date": "10.10.23",           "Delivery Date": "11.10.23", "Suggested Volume": "30"},
  {"QID": "933291", "Store ID": "198", "Primary Product Id": "100018", "Order Date": "10.10.23",             "Delivery Date": "11.10.23", "Suggested Volume": "50"},
  ... ]
}