跳至内容
ShopentlyLearn

列出库存单元

每页读取最多100个单元。列表仅显示元数据,不披露兑换码。

GET/api/v1/inventory/products/{product_id}/digital-units

cURL 请求

curl --disable --globoff --fail-with-body --silent --show-error \
  --proto '=https' --connect-timeout 5 --max-time 30 \
  --request GET \
  --url https://shop.onshopently.com/api/v1/inventory/products/example/digital-units \
  --header 'Authorization: Bearer EXAMPLE_ACCESS_TOKEN'

响应

{
  "data": {
    "order_version": 2,
    "total": 1,
    "units": [
      {
        "content_state": "present",
        "delivery_id": "delivery-example",
        "filename": null,
        "id": "00000000-0000-4000-8000-000000000003",
        "issued_at": null,
        "kind": "code",
        "location_id": "location-digital",
        "mime_type": null,
        "payload_id": "00000000-0000-4000-8000-000000000004",
        "product_id": "example",
        "size_bytes": null,
        "sort_order": 1,
        "state": "available",
        "version": 1,
        "warehouse_id": "warehouse-main"
      }
    ]
  },
  "meta": {
    "pagination": {
      "has_more": false,
      "limit": 50,
      "next_cursor": null
    },
    "request_id": "example-request"
  }
}

所需权限

身份验证
访问令牌
最低套餐
STANDARD
密钥权限
查看资源池中的代码和文件inventory.digital_unit:read