Skip to content

Cancel one of the shopper's orders

DELETE
/tenant/stores/{storeRef}/customers/orders/{id}
curl --request DELETE \
--url https://apibase.ecomweb.app/api/v1/tenant/stores/example/customers/orders/1 \
--header 'Authorization: Bearer <token>' \
--header 'x-storefront-api-key: <x-storefront-api-key>'

Cancels an order of the signed-in shopper and returns it. Only an order that is pending, confirmed or processing and has not shipped can be cancelled; any other order is refused. An active carrier shipment is cancelled with it, and stock is put back. An order that belongs to someone else returns 404.

id
required
integer

The order ID.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
order_status
required

Lifecycle status of the order.

string
Allowed values: pending confirmed processing cancelled on_hold completed
previous_order_status

The status the order was in before it was put on hold, or null. Resuming restores it.

string
nullable
Allowed values: pending confirmed processing cancelled on_hold completed
fulfillment_status
required

Warehouse status: whether the items have been picked and packed, or returned.

string
Allowed values: unfulfilled fulfilled returned return_requested
shipping_status
required

Delivery status.

string
Allowed values: not_shipped shipped in_transit out_for_delivery delivered delivery_failed
payment_status
required

Payment status.

string
Allowed values: pending authorized paid captured failed refunded voided
id

Order ID.

number
user_id

ID of the signed-in user who placed the order, or null for a guest or a staff-keyed order.

string
nullable
cart_id

ID of the cart the order was created from, or null.

string
nullable
customer_id

ID of the customer the order is linked to, or null for a guest checkout.

number
nullable
order_number
required

Sequence number of the order, unique within the store.

number
order_code
required

Customer-facing order code, such as #1001. Prefer it for display.

string
customer_name
required

Customer name.

string
customer_email
required

Customer email, or null for a walk-in customer without one.

string
nullable
customer_phone

Customer phone number, or null.

string
nullable
customer_avatar

Customer avatar URL, or null.

string
nullable
store_sales_channel_id

ID of the sales channel the order is attributed to, or null.

number
nullable
status

Deprecated combined status. Use order_status, fulfillment_status, shipping_status and payment_status instead.

string
nullable
payment_method

Code of the payment method, as configured on the store, such as cod.

string
nullable
subtotal
required

Sum of the line totals, in the order’s currency.

number
shipping_fee
required

Shipping fee charged.

number
tax
required

Tax amount.

number
discount
required

Total discount applied to the order.

number
total
required

Amount due: subtotal plus shipping and tax, minus discounts.

number
currency_code

ISO 4217 currency code the amounts are in, such as VND.

string
original_subtotal

Subtotal before promotions, or null when it was not recorded.

number
nullable
original_shipping_fee

Shipping fee before promotions, or null when it was not recorded.

number
nullable
shipping_discount

Part of the discount that came off shipping, or null.

number
nullable
shipping_street
required

Street address to deliver to.

string
shipping_city
required

Province code of the delivery address.

string
shipping_city_name

Province name. Present only when a single order is fetched.

string
nullable
shipping_district

Deprecated district code. New orders use shipping_ward.

string
nullable
shipping_ward

Ward code of the delivery address, or null.

string
nullable
shipping_ward_name

Ward name. Present only when a single order is fetched.

string
nullable
shipping_postal_code

Postal code, or null.

string
nullable
tracking_number

Tracking number of the shipment, or null.

string
nullable
shipping_carrier

Name of the carrier, or null.

string
nullable
shipping_method_id

Deprecated: always null on new orders.

number
nullable
shipping_method_name

Name of the shipping method. Present only when include_order_shipping is true.

string
nullable
shipping_rate_id

ID of the shipping rate used. Present only when include_order_shipping is true.

number
nullable
notes

Free-text notes on the order, or null.

string
nullable
created_at

When the order was placed, as an ISO 8601 timestamp.

string
updated_at

When the order was last changed, as an ISO 8601 timestamp.

string
items
required

The order’s lines. Empty unless items are requested (the list omits them by default).

Array<object>
object
id

Order item ID.

number
order_id

ID of the order the line belongs to.

number
product_id

ID of the product, or null when the product has since been removed.

number
nullable
product_name
required

Product name as it was when the order was placed.

string
product_image

Product image URL as it was when the order was placed, or null.

string
nullable
variant_id

ID of the purchased variant, or null when the variant has since been removed.

number
nullable
variant_name

Variant label as it was when the order was placed, or null.

string
nullable
quantity
required

Units ordered.

number
original_price

Unit price before any promotion, or null when it was not recorded.

number
nullable
price
required

Unit price charged, after promotions.

number
total
required

Line total: the unit price times the quantity.

number
discount

Total discount applied to the whole line, or null when none.

number
nullable

Example

{
"order_status": "pending",
"previous_order_status": "pending",
"fulfillment_status": "unfulfilled",
"shipping_status": "not_shipped",
"payment_status": "pending"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}