---
title: "confirm sales order"
method: POST
path: "/api/v1/sales/orders/{order_id}/confirm"
tags: ["orders"]
---

# confirm sales order

`POST /api/v1/sales/orders/{order_id}/confirm`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/sales/orders/{order_id}/confirm`
- Auth: HTTP bearer

Records what you are agreeing to on every line of a `draft` order and opens it, or moves it straight to `allocated` where the organisation holds stock for orders. Each line is accepted as asked, accepted at a different quantity, or rejected; every line must carry one, so nothing is agreed to on your behalf. On an order that arrived over EDI the acknowledgement (855) goes back to the account where they take one, and where they do not the decision is recorded and nothing is sent. A line the account named with a code that is not on their product list has to be matched or rejected first; until it is, the confirm is refused with how many lines are waiting.

Scope: `orders:write`, which includes `orders:read`.

## Path parameters

- `order_id` string, required

## Headers

- `Tightly-Version` string
- `Idempotency-Key` string

## Request body

- object
  - `lines` object[], required
    - `order_line_item_id` string, required
    - `quantity` integer: Required with `quantity_changed`; ignored otherwise.
    - `reason` string: Your own words, carried onto the book line and the acknowledgement.
    - `verdict` 'accepted' | 'quantity_changed' | 'rejected', required

## Response `200`

The order, open, with every verdict on its lines.

## Other responses

- `400`: A line has no verdict (`verdict_missing_on_a_line`); a changed quantity is not a whole number above zero (`quantity_not_positive`); the body names a line the order does not have (`line_not_on_order`); the body could not be read.
- `401`: No usable key: malformed, unknown, revoked, expired or stopped.
- `403`: The key does not hold Orders (`scope_missing`), or the organisation's plan does not include wholesale and the draft arrived over EDI, or the key is issued to one account and the order is another's (`account_mismatch`).
- `404`: No order with that id is on file.
- `409`: `order_not_a_draft`, `draft_has_unmatched_lines`, `order_already_cancelled`.
- `429`: The key has spent its allowance for this minute. 600 reads and 120 writes a minute, counted per key, refused calls included. `Retry-After` says how long to wait.
- `503`: The database is briefly out of reach, which is what a failover or a full connection pool looks like from outside. Wait the seconds `Retry-After` names and send the request again. A read is safe to repeat. A write is not, because the connection was lost in the middle of it, so read the object back before sending it a second time. Branch on the status rather than on `code`, which is `POSTGRES_UNAVAILABLE` from one of the two seams that raise this and `SERVICE_UNAVAILABLE` from the other.

---

[API](https://skmtc.dev/tightly/apis/tightly-api.md) · [All operations](https://skmtc.dev/tightly/apis/tightly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tightly/apis/tightly-api/revisions/199f7eb35afb?raw)
