Skip to main content
POST
Orders can only be cancelled if they haven’t been shipped. Once shipped, use the return flow instead.

Overview

The cancel order endpoint allows you to cancel an existing order and automatically process refunds. This is useful for customer-requested cancellations, inventory issues, or fraud prevention.

Cancellation Rules

Can Cancel

  • Status: pending, processing, paid
  • No shipments created
  • Within cancellation window

Cannot Cancel

  • Status: shipped, delivered
  • Partial fulfillment started
  • Past cancellation deadline

Request

Path Parameters

string
required
The unique identifier of the order to cancelExample: ord_1a2b3c4d5e6f

Body Parameters

string
required
Reason for cancellationOptions:
  • customer_request - Customer initiated cancellation
  • out_of_stock - Item(s) no longer available
  • pricing_error - Incorrect pricing
  • fraud_suspected - Potential fraudulent order
  • duplicate_order - Duplicate order placed
  • other - Other reason (use notes)
number
Amount to refund. If not specified, full refund is processedExample: 99.99
string
Additional notes about the cancellationExample: "Customer changed mind about purchase"
boolean
default:"true"
Whether to send cancellation email to customer
boolean
default:"true"
Whether to return items to inventory

Response

object
The cancelled order object
object
Refund details if payment was processed
array
List of inventory adjustments made

Webhooks

This endpoint triggers the following webhook events:
  • order.cancelled - When order is successfully cancelled
  • refund.created - When refund is initiated
  • inventory.updated - When items are restocked

Best Practices

Set clear cancellation deadlines based on your fulfillment process:
For orders with multiple payment methods or partial payments:
Always provide clear communication about cancellations:

Create Refund

Process partial refunds without cancelling

Return Order

Handle returns for delivered orders

Update Order

Modify order details before fulfillment

List Orders

Query orders by status or customer