跳至內容
ShopentlyLearn

替換可用單位

替換兌換碼或檔案而不改變順序。修改記錄保留在倉庫歷程中。

POST/api/v1/inventory/products/{product_id}/digital-units/{unit_id}/replacement

cURL 請求

curl --disable --globoff --fail-with-body --silent --show-error \
  --proto '=https' --connect-timeout 5 --max-time 30 \
  --request POST \
  --url https://shop.onshopently.com/api/v1/inventory/products/example/digital-units/00000000-0000-4000-8000-000000000003/replacement \
  --header 'Authorization: Bearer EXAMPLE_ACCESS_TOKEN' \
  --header 'Idempotency-Key: b8d3ed25-9cdc-581d-9008-5d215c7cd1c3' \
  --header 'Content-Type: application/json' \
  --data-raw '{"code":"SYNTHETIC-REPLACEMENT","expected_version":1,"reason":"Replace an invalid activation code"}'

回應

{
  "data": {
    "deleted": false,
    "id": "00000000-0000-4000-8000-000000000003",
    "version": 2
  },
  "meta": {
    "request_id": "example-request"
  }
}

所需權限

身份驗證
存取權杖
最低方案
STANDARD
金鑰權限
管理可用代碼和檔案inventory.digital_unit:write