v1

latestOpenAPI 3.0.02026-07-24189145350.1 KB
Orders

Add 1 or more orders

Endpoint to add Orders

post/orders

Request body

poiIdinteger required

Poi id

codestring required

Order code

datestring date required

Order date with the format YYYY-MM-DD

operation'PEDIDO' | 'RETIRO' | 'COBRANZA' required

Order type

totalAmountnumber

Order total amount with taxes

totalAmountWithoutTaxesnumber

Order total amount without taxes

labelstring

Order label

prioritynumber

Order priority from 0 to 9

assignedDeviceIdinteger

Order assigned device id. Is used to group orders by device in the optimizer application

statusIdnumber

Status for the order

Example request

[
  {
    "date": "2022-12-31",
    "timeWindow": [
      {
        "from": "08:00",
        "to": "13:00"
      }
    ],
    "merchants": [
      {
        "_id": 1
      }
    ]
  }
]

Response

Order/s added On Error, meta object will contain an error array with these possible values

Error codes:

CodeDescriptionField
1001Wrong time window objecttimeWindow
2002Wrong time window values, must be stringtimeWindow
2003Wrong time window, 'from' must be less than 'to'timeWindow
2004Wrong time window, times are overlappedtimeWindow
2020Order code already present for this usercode
2021Order code not found or not allowed for this usercode
2026Invalid operation typeoperation
2032Poi id not found or not allowed for this userpoiId
2037totalAmount must be greater than zero and not emptytotalAmount
2038orderItems and orderMeasures are not allowed for collection ordersorderItems, orderMeasures
2039orderStatus not found or not allowed for this userstatusId
2051Merchant id not found or not allowed for this usermerchants
2052Exceeded limit of 3 emails per ordermerchants
2054subStatus not found or not allowed for this usersubSstatusId
{"stackTrail":"paths:/orders:post:responses:200:content:application/json:schema:properties:meta","oasType":"schema","type":"unknown"}

Example response

{
  "data": [
    {
      "date": "2022-12-31",
      "qtn": "ABC123",
      "timeWindow": [
        {
          "from": "08:00",
          "to": "13:00"
        }
      ],
      "merchants": [
        {
          "_id": 1
        }
      ]
    }
  ]
}