## Show how a purchase order goes to its supplier (tenant:purchase-order:send)

`GET /api/trade/v1/purchase-orders/{id}/ordering`

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

The channel chosen from the supplier's masterdata distributor links and the tenant's connector settings, in the
order `egis` (EGIS set up) → `ingram` (ordering switched on) → `infinigate` (not available yet) → `mail` (the
supplier has an order mail address, `purchaseOrderEmail`, else `email`) → `manual`, and the channels the person may
switch to. An order made for a distributor by the cart optimizer prefers that distributor. Sends nothing. Masterdata
failing while the supplier is looked up is answered `502` (also by the preview, send and resend).

### Parameters

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

### Responses

- **200** The channel (`application/json`)
- **401** No valid session or bearer token (no body).
- **403** Missing permission, no active tenant in the token, or a missing CSRF token on a cookie write. (`application/json`)
- **404** Not found in the tenant. (`application/json`)
- **502** A dependent service (DMS, masterdata, a distributor) failed or is unreachable. (`application/json`)

Fields of the 200 answer:

- `available` (array of string): Channels that can send the order, in the order of preference; always ends with `manual`.
- `channel` (string): The chosen channel; `egis` is sent with `sendEgisOrder`. (one of `egis`, `ingram`, `infinigate`, `mail`, `manual`)
- `distributorId` (string): The supplier's id at the chosen API channel's distributor.
- `recipient` (string (email)): The supplier's order mail address (`purchaseOrderEmail`, else `email`).

Example 200 answer:

```json
{
  "available": [
    "mail",
    "manual"
  ],
  "channel": "mail",
  "recipient": "bestellung@kabelwerk-sued.example"
}
```

### Example request

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