Cancel Order
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
Parameter | Type | Description | Example |
---|---|---|---|
order_id *Required | String | Order Id 訂單ID | "id": "62a9c50634e470204d99fa0a" |
cancelled_reason *Required | Hash | Cancelled 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_credits | Hash | Revert credits information 回補購物金資訊 | "revert_credits": { "strategy": "revert"} "strategy" options: revert none Default use none option此參數如果沒有帶值,會看 設定 >訂單設定>允許顧客取消訂單 是否自動回補購物金 |
revert_member_points | Hash | Revert credits information 回補點數資訊 | "revert_member_points": { "strategy": "revert"} "strategy" options: revert none Default use none option此參數如果沒有帶值,會看 設定 >訂單設定>允許顧客取消訂單 是否自動回補點數 |
operated_by | String | who cancel the order (default is customer ) 從哪裡取消訂單,預設是 customer | "operatedby": "customer" Only accept merchant or customer |
refund_order | Boolean | Do you want to refund the order? 是否要退款此筆訂單?(Default: true) - Note: 目前僅支援台新 tappy 付款方式的自動退款 | "refund_order": false |
mail_notify | Boolean | Do 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
Response Example
Updated 9 months ago