---
title: "Cancel Order"
method: PATCH
path: "/orders/{orderId}/cancel"
tags: ["Orders"]
---

# Cancel Order

`PATCH /orders/{orderId}/cancel`

To cancel order<br>取消訂單

## Path parameters

- `orderId` string, required

## Request body

- object
  - `cancelled_reason` object
    - `key` string
    - `message` string
  - `revert_credits` object — revert credits information<br>回補購物金資訊
    - `strategy` 'none' | 'revert' — determine revert credits or not, default do not revert<br>是否回補購物金，預設不回補
  - `revert_member_points` object — revert member points information<br>回補點數資訊
    - `strategy` 'none' | 'revert' — determine revert member points or not, default do not revert<br>是否回補點數，預設不回補
  - `operated_by` 'merchant' | 'customer' — where to cancel the order, the default is customer<br>從哪裡取消訂單，預設是 customer
  - `refund_order` boolean — Do you want to refund the order? <br>是否要退款此筆訂單<br>-<br>*Default:true
  - `mail_notify` boolean — Do you want to notify the customer via email when the order is cancelled? <br>此筆訂單取消之後是否要通知顧客？<br>-<br>*Default:true

## Response `200`

Success

- object
  - `order_items_stock_tag` object[] — Order items stock tag to indicate increasing or reducing stock failed<br> If there is no stock error, the field value will be an empty array. The field is omitted in no-op cancellations (e.g. skip_fulfillment or already cancelled).<br> 訂單商品庫存標籤，用來標示庫存增加或減少失敗<br> 若沒有庫存增加或減少錯誤，則此欄位為空陣列；訂單未觸發庫存處理（如 skip_fulfillment 或已取消）時不會出現此欄位
    - `product_id` string — ID of the product
    - `sku_id` string — ID of the SKU
    - `order_item_id` string — ID of the order item
    - `stock_tag` 'REDUCE_FAILED' | 'INCREASE_FAILED' — Stock tag for the order item

## Other responses

- `404` — Order not found
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/shoplineapp/apis/shopline-open-api.md) · [All operations](https://skmtc.net/shoplineapp/apis/shopline-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/shoplineapp/shopline-open-api/revisions/1675ac12cde7/schema)
