跳至內容
ShopentlyLearn

建立匯入

建立最多1000個兌換碼或100個檔案的草稿。此時不會增加可售庫存。

POST/api/v1/inventory/products/{product_id}/digital-imports

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-imports \
  --header 'Authorization: Bearer EXAMPLE_ACCESS_TOKEN' \
  --header 'Idempotency-Key: 220d9f39-b8d9-5f28-9c9c-b85f003679fa' \
  --header 'Content-Type: application/json' \
  --data-raw '{"count":2,"kind":"code"}'

回應

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

所需權限

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