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

# Cancel Order

> Cancel the order.

Cancels the order on behalf of the seller and returns the updated order.

<Note>An order can only be canceled if it has no fulfillments or captured payments that block cancellation.</Note>

## Path parameters

<ParamField path="id" type="string" required>The order's ID.</ParamField>

## Query parameters

<ParamField query="fields" type="string">Comma-separated list of fields to include in the returned order, prefix with `+`/`-` to add or remove from defaults.</ParamField>

## Response

<ResponseField name="order" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">The order's ID.</ResponseField>
    <ResponseField name="status" type="string">The order's status, now `canceled`.</ResponseField>
    <ResponseField name="canceled_at" type="string">Cancellation timestamp.</ResponseField>
    <ResponseField name="items" type="object[]">The order's line items.</ResponseField>
    <ResponseField name="summary" type="object">Order totals summary.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'http://localhost:9000/vendor/orders/order_01HXYZABCDEF/cancel' \
    -H 'Authorization: Bearer <token>' \
    -H 'x-seller-id: <seller_id>'
  ```

  ```ts JS Client theme={null}
  const { order } = await client.vendor.orders.$id.cancel.mutate({
    $id: "order_01HXYZABCDEF",
  })
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "order": {
      "id": "order_01HXYZABCDEF",
      "display_id": 42,
      "status": "canceled",
      "canceled_at": "2026-06-05T10:00:00.000Z"
    }
  }
  ```
</ResponseExample>
