---
title: "Cancel an order"
method: POST
path: "/orders/{order_id}/cancel"
tags: ["Orders"]
---

# Cancel an order

`POST /orders/{order_id}/cancel`

## Request

- Base URL: `https://app-sandbox.resolvepay.com/api`
- URL: `https://app-sandbox.resolvepay.com/api/orders/{order_id}/cancel`
- Auth: one of:
  - HTTP bearer
  - HTTP basic
- TypeScript: <https://skmtc.dev/resolvepay/apis/resolve-api-reference/docs/orders/:order_id/cancel/post.ts> (a function with typed inputs; its response is checked against the schema)

Cancel an authorized order, releasing any remaining authorized amount. If the order has been partially captured, only the uncaptured portion of the authorization is canceled — previously captured amounts are not affected.

## Path parameters

- `order_id` string, required

## Response `200`

An object representing an order.

- Order
  - `id` string: Unique identifier for the order.
  - `checkout_id` string: ID of the checkout session associated with this order.
  - `number` string: Order number identifier.
  - `po_number` string: Purchase order number associated with the order.
  - `advance_requested` boolean: Whether an advance was requested for this order.
  - `source` string: Source channel that created the order.
  - `status` string: Current status of the order.
  - `amount_authorized` number, double: Total authorized amount for the order in USD.
  - `amount_captured` number, double: Total captured amount for the order in USD.
  - `amount_canceled` number, double: Total canceled amount for the order in USD.
  - `amount_remaining` number, double: Remaining authorized amount available for capture in USD.
  - `first_captured_at` string, date-time, nullable: Timestamp of the first capture event.
  - `line_items` OrderLineItem[]: Line items associated with the order.
    - `name` string: Name or description of the line item.
    - `quantity` number: Quantity of units.
    - `unit_price` number, double: Price per unit in USD.
    - `sku` string: SKU or product identifier.
    - `total_price` number, double: Total price for this line item in USD. Defaults to unit_price × quantity if omitted.
    - `type` string: Line item type. Common values: `product`, `shipping`, `subtotal`.
    - `tax_amount` number, double: Tax amount for this line item in USD.
  - `authorization_expires_at` string, date-time: Timestamp when the authorization expires.
  - `authorization_expiry_source` string: Source that determined the authorization expiry.
  - `capture_events` OrderCaptureEvent[]: List of capture events for this order.
    - `amount` number, double: Amount captured in this capture event in USD.
    - `idempotency_key` string: Idempotency key used for this capture.
    - `processed_at` string, date-time: Timestamp when this capture was processed.
    - `invoice_id` string: ID of the merchant invoice associated with this capture.
  - `authorized_at` string, date-time: Timestamp when the order was authorized.
  - `updated_at` string, date-time: Timestamp when the order was last updated.
  - `customer` OrderCustomer
    - `id` string: Unique identifier of the customer.
    - `name` string: Business name of the customer.
    - `remaining_credit` number, double: Remaining available credit for the customer in USD.

## Other responses

- `400`: Bad request error
- `401`: Unauthorized error
- `404`: Not found error
- `429`: Rate limit error

---

[API](https://skmtc.dev/resolvepay/apis/resolve-api-reference.md) - [All operations](https://skmtc.dev/resolvepay/apis/resolve-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/resolvepay/apis/resolve-api-reference/revisions/c62edc454aaa?raw)
