---
title: "Cancel a customer order"
method: POST
path: "/cancel-order"
tags: ["Customer Order"]
---

# Cancel a customer order

`POST /cancel-order`

## Request

- Base URL: `http://localhost:8000/api/shop`
- URL: `http://localhost:8000/api/shop/cancel-order`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-shop-api/docs/cancel-order/post.ts> (a function with typed inputs; its response is checked against the schema)

Cancels the given pending order owned by the authenticated customer. Returns success/failure status.

## Headers

- `X-STOREFRONT-KEY` string, required
- `X-Locale` string
- `X-Channel` string
- `X-Currency` string

## Request body

- object
  - `orderId` integer, required: The ID of the order to cancel.

## Response `201`

Order canceled.

## Other responses

- `400`: Order not found, not owned by the caller, or not in a cancelable state.
- `422`: Validation Error

---

[API](https://skmtc.dev/bagisto/apis/bagisto-shop-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-shop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-shop-api/revisions/f619df36bf29?raw)
