Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

1.6 KB
Raw Blame
---
title: "Cancel Order"
api: "POST /vendor/orders/{id}/cancel"
description: "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
curl -X POST 'http://localhost:9000/vendor/orders/order_01HXYZABCDEF/cancel' \
  -H 'Authorization: Bearer <token>' \
  -H 'x-seller-id: <seller_id>'
```

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

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