## Get the delivered and invoiced quantities of an order (tenant:trade:sales:read)

`GET /api/trade/v1/sales/order-confirmations/{id}/fulfilment`

Module: Trade · operationId: `getOrderFulfilment` · Tag: Transactions · Auth: access token (`Authorization: Bearer <accessToken>`)

Ordered, delivered (delivery notes) and invoiced (invoices minus credit notes) quantity per deliverable line
(normal and selected optional lines), computed when read. Cancelled documents and superseded revisions do not
count. Any revision id of the order answers for its newest revision (`orderId`).

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string (uuid) | yes |  |

### Responses

- **200** Fulfilment of the order (`application/json`)
- **401** No valid session or bearer token (no body).
- **404** Not found in the tenant. (`application/json`)

Fields of the 200 answer:

- `lines` (array of object): Quantities per order line.
  - `delivered` (number): Quantity on delivery notes (not cancelled).
  - `invoiced` (number): Quantity invoiced.
  - `lineId` (string (uuid)): Id of the order line.
  - `ordered` (number): Quantity ordered.
- `orderId` (string (uuid)): The newest revision of the order.
- `status` (string): `INVOICED` when every line is invoiced in full (also without delivery), `DELIVERED` when every line is delivered in full, `PARTIALLY_DELIVERED` when anything is delivered. (one of `OPEN`, `PARTIALLY_DELIVERED`, `DELIVERED`, `INVOICED`)

Example 200 answer:

```json
{
  "lines": [
    {
      "delivered": 6,
      "invoiced": 6,
      "lineId": "9c2d3e4f-5a6b-4c7d-8e8f-1a2b3c4d5e01",
      "ordered": 6
    },
    {
      "delivered": 1,
      "invoiced": 1,
      "lineId": "9c2d3e4f-5a6b-4c7d-8e8f-1a2b3c4d5e02",
      "ordered": 1
    },
    {
      "delivered": 20,
      "invoiced": 20,
      "lineId": "9c2d3e4f-5a6b-4c7d-8e8f-1a2b3c4d5e03",
      "ordered": 20
    },
    {
      "delivered": 0,
      "invoiced": 0,
      "lineId": "9c2d3e4f-5a6b-4c7d-8e8f-1a2b3c4d5e04",
      "ordered": 10
    },
    {
      "delivered": 0,
      "invoiced": 0,
      "lineId": "9c2d3e4f-5a6b-4c7d-8e8f-1a2b3c4d5e05",
      "ordered": 2
    }
  ],
  "orderId": "2f6b1d84-7c3e-4a5b-9e21-6a0c4d8b1e02",
  "status": "PARTIALLY_DELIVERED"
}
```

### Example request

```bash
curl -X GET 'https://api.mbcom.cloud/api/trade/v1/sales/order-confirmations/3f2b8c1e-7d4a-4e9b-9c2a-5b1d6e8f0a12/fulfilment' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
