Curosa
Supplier Portal API Reference New

Fulfilment

配送中心库存

检索和更新配送中心持有的库存水平

概览

配送中心库存端点允许您按配送中心检索库存,并更新单个或多个产品的库存数量。

身份验证

所有端点都需要身份验证。请在 Authorization 请求头中包含您的 API 令牌。有关获取令牌的更多信息,请参阅身份验证指南

获取配送中心库存列表

检索各配送中心的库存水平。

端点: GET https://curosa.com/api/v1/distribution-centre-stocks

请求

curl --location 'https://curosa.com/api/v1/distribution-centre-stocks' \
--header 'Authorization: Bearer YOUR_API_TOKEN'

响应

返回 200 OK 响应:

{
    "data": [
        {
            "distribution_centre_code": "DEMO-DC",
            "sku": "DEMO001",
            "platform_sku": "201.228.141",
            "stock_quantity": 0,
            "stock_quantity_allocated": 0,
            "stock_quantity_free": 0,
            "inbound_quantity": 0,
            "inbound_quantity_allocated": 0,
            "inbound_quantity_free": 0
        }
    ],
    "links": {
        "first": null,
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "path": "https://curosa.test/api/v1/distribution-centre-stocks",
        "per_page": 100,
        "next_cursor": null,
        "prev_cursor": null
    }
}

更新配送中心库存

更新配送中心内单个产品的库存数量。

端点: POST https://curosa.com/api/v1/distribution-centre-stocks

请求

curl --location 'https://curosa.com/api/v1/distribution-centre-stocks' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
    "distribution_centre_code": "DEMO-DC",
    "sku": "DEMO001",
    "stock_quantity": 10
}'

请求体

字段 类型 是否必填 描述
distribution_centre_code 字符串 配送中心标识符
sku 字符串 供应商 SKU
stock_quantity 整数 新库存数量

响应

{
    "updated": [
        {
            "distribution_centre_code": "DEMO-DC",
            "platform_sku": "201.228.141",
            "sku": "DEMO001",
            "stock_quantity": 10
        }
    ],
    "errors": []
}

批量更新配送中心库存

在一次请求中更新多个物品的库存数量。

端点: POST https://curosa.com/api/v1/distribution-centre-stocks/bulk-update

请求

curl --location 'https://curosa.com/api/v1/distribution-centre-stocks/bulk-update' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '[
    {
        "distribution_centre_code": "DEMO-DC",
        "sku": "DEMO001",
        "stock_quantity": 0
    },
    {
        "distribution_centre_code": "DEMO-DC",
        "sku": "DEMO004",
        "stock_quantity": 0
    }
]'

请求体

包含库存更新对象的数组。每个对象需要:

  • distribution_centre_code (字符串)
  • sku (字符串)
  • stock_quantity (整数)

频率限制

配送中心库存端点的频率限制为 每小时 3,600 次请求。当前的限制和剩余请求次数将在响应头的 x-ratelimit-limitx-ratelimit-remaining 中返回。