跳至内容
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