Cancel Order

🚧

Breaking Changes

Jul. 30, 2025 API 異動公告 API Breaking Change

Function

Merchants can cancel order via cancel order API.

店家可以透過 cancel order API 取消訂單。

📘

After return_order_revamp feature key on/啟用「return_order_revamp」功能後

  • 送貨狀態為已發貨/已到達/已取貨,不可取消訂單。
  • 此訂單下任一筆新退貨單狀態為非取消,不可取消訂單。

URL

PATCH <<api_domain>>/v1/orders/:order_id/cancel

Request Parameters

ParameterTypeDescriptionExample
order_id
*Required
StringOrder Id
訂單ID
"id": "62a9c50634e470204d99fa0a"
cancelled_reason
*Required
HashCancelled Reason
取消原因
## "cancelled_reason": { "key": "expensive_price", "message": "expensive" }"key" options:other
change_mind
expensive_price
repeat_purchase
wait_too_long
change_item
incorrect_customer_info

- "message": Please type any sentence you want.
revert_creditsHashRevert credits information
回補購物金資訊
"revert_credits": { "strategy": "revert"}
"strategy" options:
revert
none
Default use none option
此參數如果沒有帶值,會看 設定 >訂單設定>允許顧客取消訂單 是否自動回補購物金
revert_member_pointsHashRevert credits information
回補點數資訊
"revert_member_points": { "strategy": "revert"}
"strategy" options:
revert
none
Default use none option
此參數如果沒有帶值,會看 設定 >訂單設定>允許顧客取消訂單 是否自動回補點數
operated_byStringwho cancel the order
(default is customer )
從哪裡取消訂單,預設是 customer
"operatedby": "customer"
Only accept merchant or customer
refund_orderBoolean## Do you want to refund the order? 是否要退款此筆訂單?(Default: true)Note:目前僅支援台新 tappy 付款方式的自動退款"refund_order": false
mail_notifyBooleanDo you want to notify the customer via email with the change?此筆訂單取消之後是否要通知顧客?(Default: true)"mail_notify": false

Request Example

curl -X PATCH \
  <<api_domain>>/v1/orders/5b2b66599a76f0196a000a54/cancel \
  -H 'Accept: application/json' \
  -H 'Authorization: access_token' \
  -H 'Content-Type: application/json' \
  -d '{
    "cancelled_reason": { "key": "expensive_price", "message": "expensive" }
  }'・

Response Field

FieldTypeDescriptionExample
order_items_stock_tagArrayOrder items stock tag to indicate increasing or reducing stock failed. If there is no stock error, the field value will be null.
Only provided when order_decoupling_product_revamp key is enabled.
訂單商品庫存標籤,用來標示庫存增加或減少失敗。若沒有庫存增加或減少錯誤,則此欄位為空。
僅於order_decoupling_product_revamp key啟用才會顯示。

Response Example

{
    "order_items_stock_tag": []
}
{
    "order_items_stock_tag": [
        {
            "product_id": "6768d20b0f9fe1005ef8958d",
            "sku_id": "6846688044889d001b55db53",
            "order_item_id": "68467eee8191ad00612272cf",
            "stock_tag": "INCREASE_FAILED"
        }
    ]
}