跳至內容
ShopentlyLearn

變更訂單狀態

為訂單指定商店中的可用狀態。傳送新狀態的 ID 和目前訂單狀態的版本。

PATCH/api/v1/orders/{order_id}/status

cURL 請求

curl --disable --globoff --fail-with-body --silent --show-error \
  --proto '=https' --connect-timeout 5 --max-time 30 \
  --request PATCH \
  --url https://shop.onshopently.com/api/v1/orders/order-0000/status \
  --header 'Authorization: Bearer EXAMPLE_ACCESS_TOKEN' \
  --header 'Idempotency-Key: example-update_order_status_api_v1_orders__order_id__status_patch' \
  --header 'Content-Type: application/json' \
  --data-raw '{"expected_version":1,"status_id":"status-1"}'

回應

{
  "data": {
    "deleted": false,
    "id": "order-0000",
    "version": 2
  },
  "meta": {
    "request_id": "example"
  }
}

所需權限

身份驗證
存取權杖
最低方案
BASIC
金鑰權限
更改訂單狀態orders.order:change_status