> ## Documentation Index
> Fetch the complete documentation index at: https://developer.quickei.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Order

> Cancel a pending POS order

Cancel a pending POS order before it is paid or expires.

## Endpoint

`POST https://quickei.io/pay/sandbox/api/v1/orders/{order_id}/cancel`

## Path Parameters

<ParamField path="order_id" type="string" required>
  The POS order ID to cancel
</ParamField>

> **Important:** Only orders with `PENDING` status can be cancelled. Attempting to cancel a paid, expired, or already cancelled order will return an error.

## Example Request

```bash theme={null}
POST /merchant-api/pos/v1/orders/POS-20240115-A1B2C3/cancel
Authorization: Basic {base64_credentials}
```

## Success Response `200`

```json theme={null}
{
  "message": {
    "success": ["Order cancelled"]
  },
  "data": {
    "order_id": "POS-20240115-A1B2C3",
    "amount": "25.00 EUR",
    "raw_amount": 25.00,
    "currency": "EUR",
    "status": "CANCELLED",
    "reference": "INV-2024-001",
    "terminal_id": "terminal-01",
    "paid_at": null,
    "expires_at": "2024-01-15T14:05:00+00:00",
    "created_at": "2024-01-15T14:00:00+00:00"
  }
}
```

## Error Response `422`

```json theme={null}
{
  "message": {
    "error": ["Only pending orders can be cancelled"]
  }
}
```
