コンテンツにスキップ
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