# Check out order

Pays every line item of an order as separate purchases through the policy engine and returns each intent's result, waiting up to wait_seconds (max 60) per purchase. Agent credential only; safe to retry, since each item unit uses a fixed idempotency key.

`POST /v1/orders/{id}/checkout`

Pays every line item of an order as separate purchases through the policy engine and returns each intent's result, waiting up to wait_seconds (max 60) per purchase. Agent credential only; safe to retry, since each item unit uses a fixed idempotency key.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | Order id (ord_...). |

## Request body

```json
{
  "task_id": "weekly-report-42",
  "wait_seconds": 1
}
```

## Responses

- **200**: Success.
- **400**: Invalid request: a field is missing or malformed (VALIDATION_ERROR).
- **401**: No valid session, API key or agent credential (UNAUTHENTICATED, AGENT_CREDENTIAL_INVALID).
- **404**: The resource does not exist or belongs to another organization.

Example 200 response:

```json
{
  "order": {
    "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "org_id": "org_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "agent_id": "agt_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "merchant_id": "mch_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "status": "active",
    "total_base_units": "50000",
    "created_at": "2026-11-16T12:00:00Z",
    "items": [
      {
        "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
        "service_id": "svc_01jd2x3k4m5n6p7q8r9s0t1v2w",
        "quantity": 1,
        "amount_base_units": "50000",
        "intent_id": "pi_01jd2x3k4m5n6p7q8r9s0t1v2w",
        "intent_ids": [
          null
        ],
        "fulfillment_status": "string"
      }
    ]
  },
  "intents": [
    {}
  ]
}
```
