---
title: "Update order by id"
method: PATCH
path: "/orders/{id}"
tags: ["Orders"]
---

# Update order by id

`PATCH /orders/{id}`

## Request

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

Update order by id

## Path parameters

- `id` integer, required

## Request body

- object
  - `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

## Response `200`

Updated order

- object
  - `meta` object
    - `error` number: Error number
    - `message` string: Error message
  - `data` object
    - `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

## Other responses

- `400`: On Error, response will contain an error and message 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
- `403`: Not authorized access
- `404`: Not found

---

[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)
