---
title: "Add 1 or more orders"
method: POST
path: "/orders"
tags: ["Orders"]
---

# Add 1 or more orders

`POST /orders`

## Request

- Base URL: `https://flash-api.quadminds.com/api/v2`
- URL: `https://flash-api.quadminds.com/api/v2/orders`
- Auth: API key in header `x-saas-apikey`

Endpoint to add Orders

## Request body

- object[]: Orders to add
  - `poiId` integer: Poi id
  - `code` string: Order code
  - `date` string, date: Order date
  - `totalAmount` number: Order total amount with taxes
  - `totalAmountWithoutTaxes` number: Order total amount without taxes
  - `operation` 'PEDIDO' | 'RETIRO': Order type
  - `label` string: Order label
  - `timeWindow` object[]: Order time windows (use User TimeZone)
    - `from` string: Window Start time
    - `to` string: Window End time
  - `priority` number: Order priority from 0 to 9
  - `statusId` number: Status for the order
  - `merchants` object[]: Merchants to attach to the order
    - `_id` integer: Merchant id
  - `orderItems` object[]: Order items
    - `productId` integer: Product id
    - `productCode` string: Product code
    - `quantity` integer: Product amount
    - `unitPrice` number: Product price
  - `orderMeasures` object[]: Order measures
    - `constraintId` integer: Constraint id
    - `value` number: Value

## Response `200`

Order/s added
On Error, meta object will contain an error array with these posible values
### Error codes:
Code | Description | Field
----------------|-------------|-------------
1001 | Wrong time window object | timeWindow
2002 | Wrong time window values, must be string | timeWindow
2003 | Wrong time window, 'from' must be less than 'to' | timeWindow
2004 | Wrong time window, times are overlapped | timeWindow
2020 | Order code already present for this user | code
2021 | Order code not found or not allowed for this user | code
2026 | Invalid operation type | operation
2032 | Poi id not found or not allowed for this user | poiId
2038 | subStatus not found or not allowed for this user | subSstatusId
2039 | orderStatus not found or not allowed for this user | statusId
2051 | Merchant id not found or not allowed for this user | merchants
2052 | Exceeded limit of 3 emails per order | merchants

- object
  - `meta` unknown
  - `data` object[]: Orders added
    - `poiId` integer: Poi id
    - `code` string: Order code
    - `date` string, date: Order date
    - `totalAmount` number: Order total amount with taxes
    - `totalAmountWithoutTaxes` number: Order total amount without taxes
    - `operation` 'PEDIDO' | 'RETIRO': Order type
    - `label` string: Order label
    - `timeWindow` object[]: Order time windows (use User TimeZone)
      - `from` string: Window Start time
      - `to` string: Window End time
    - `priority` number: Order priority from 0 to 9
    - `statusId` number: Status for the order
    - `merchants` object[]: Merchants to attach to the order
      - `_id` integer: Merchant id
    - `orderItems` object[]: Order items
      - `orderId` integer: Order id
      - `productId` integer: Product id
      - `productCode` string: Product code
      - `quantity` integer: Product amount
      - `deliveredQuantity` integer: Delivered product amount
      - `unitPrice` number: Product price
    - `orderMeasures` object[]: Order measures
      - `orderId` integer: Order id
      - `constraintId` integer: Constraint id
      - `value` number: Value

## Other responses

- `403`: Not authorized access

---

[API](https://skmtc.dev/quadminds/apis/cloudflash-api.md) - [All operations](https://skmtc.dev/quadminds/apis/cloudflash-api/llms.txt) - [OpenAPI document](https://skmtc.dev/quadminds/apis/cloudflash-api/revisions/7731f1076b80?raw)
