跳至內容
ShopentlyLearn

設定數位庫存

Professional及以上方案可啟用獨立兌換碼或檔案。停用後仍保留先前購買的存取權限。

PATCH/api/v1/inventory/products/{product_id}/digital-pool

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/inventory/products/example/digital-pool \
  --header 'Authorization: Bearer EXAMPLE_ACCESS_TOKEN' \
  --header 'Idempotency-Key: ee843b03-c1d6-520f-b617-e14f9ca773eb' \
  --header 'Content-Type: application/json' \
  --data-raw '{"email_mode":"order_link","enabled":true,"expected_version":0,"retention_days":null}'

回應

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

所需權限

身份驗證
存取權杖
最低方案
STANDARD
金鑰權限
變更數位資源池設定inventory.digital_pool:manage