Get goods list (get_goods)
About 728 words
Returns sellable goods in a "goods → SKU" hierarchy for downstream goods mapping imports; a single response carries every SKU, so you do not need to fetch details one by one.
- Permission:
catalog.read - Method:
GET - Idempotency: read-only
v1 draft
This page is part of the draft v1 integration contract; details may change along with the integration checklist, so rely on the official checklist published in the portal.
正在加载交互式结构…
Difference from the category catalog
get_categories returns the category catalog: only the category hierarchy, with no goods details.
get_goods returns the goods list: complete goods → SKU data. Each good carries its category_id, so it maps directly to the categories in the catalog. Build mappings by fetching the catalog first, then the goods list.
Request example
GET /dist/api/v1/get_goods?page=1&page_size=20&category_id=11 HTTP/1.1
Host: api.xstock.example
X-Xstock-Api-Key: xs_live_xxxxxxxx
X-Xstock-Timestamp: 1795000000
X-Xstock-Signature: 9f2c1d...page/page_size: paging;page_sizeis at most 100.category_id: optional category filter; omit it for all categories.updated_since: optional incremental sync cursor (RFC 3339).
Response example
{
"id": "shop-a-20261126-goods-001",
"cmd": "get_goods",
"code": 0,
"msg": "",
"data": {
"page": 1,
"page_size": 20,
"total": 128,
"default_locale": "zh-CN",
"default_ccy": "CNY",
"has_more": true,
"items": [
{
"goods_id": 501,
"guid": "9a1b2c3d4e5f60718293a4b5c6d7e8f9",
"title": { "zh-CN": "示例数字账号(月付)", "en": "Demo account (monthly)" },
"default_locale": "zh-CN",
"default_ccy": "CNY",
"category_id": 11,
"fulfillment_type": "auto",
"summary": { "zh-CN": "一份一个账号,含账号与密码", "en": "One account per unit, credentials included" },
"images": [
"https://cdn.example.com/goods/501/main.png",
"https://cdn.example.com/goods/501/detail.png"
],
"tags": ["月付", "自动发货"],
"prices": [
{ "amt": "1.00", "ccy": "USD" },
{ "amt": "6.66", "ccy": "CNY" },
{ "amt": "1.10", "ccy": "USDT" }
],
"min_qty": 1,
"max_qty": 20,
"per": 1,
"manual_deliver_schema": {},
"is_active": true,
"updated_at": "2026-11-26T04:00:00Z",
"skus": [
{
"sku_id": 1001,
"guid": "5d8f2a6c9e1b4d3f8a7c0e2b5d9f1a3c",
"sku_code": "DEFAULT",
"default_ccy": "CNY",
"spec_values": {},
"prices": [
{ "amt": "1.00", "ccy": "USD" },
{ "amt": "6.66", "ccy": "CNY" },
{ "amt": "1.10", "ccy": "USDT" }
],
"min_qty": 1,
"max_qty": 20,
"per": 1,
"stock_status": "in_stock",
"stock_quantity": 18,
"is_active": true
}
]
}
]
},
"stamp": 1795000001
}Fields and mappings
| Downstream concept | Field | Description |
|---|---|---|
| Upstream goods ID | goods_id / guid | Used to build goods mappings; never use the title as identity |
| Upstream SKU ID | skus[].sku_id / skus[].guid | Use sku_id when ordering; use guid for persistent mappings across goods (sku_code is only unique within a good) |
| Upstream category | category_id | Corresponds to the categories returned by get_categories |
| Goods images | images[] | List of absolute URLs, at least one; upstream always provides it |
| Goods tags | tags[] | String list usable for filtering and display |
| Prices for goods without SKUs | prices / original_prices | Goods-level multi-currency prices; when skus is empty, sales use these |
| Minimum and maximum quantity | min_qty / max_qty | Present at both goods and SKU level; max_qty=0 means no limit |
| Purchase step | per | A number: the quantity per increment; present at both goods and SKU level |
| Default currency | default_ccy | One per good and per SKU; prices always includes that currency |
| Manual delivery fields | manual_deliver_schema | Corresponds to manual_form_schema in Dujiao Next; for manual delivery the admin panel renders the form from it |
| Fulfillment type | fulfillment_type | auto automatic delivery / manual manual handling / service service-type |
| Stock | stock_status + stock_quantity | -1 means unlimited; do not list the item when out_of_stock |
| Price | skus[].prices | Multi-currency base supply price; the transacted price comes from get_quote |
Sync recommendations
- Do a full fetch first and build mappings, then sync incrementally with
updated_since. - Do not list goods or SKUs with
is_active=false; keep historical mappings so past orders still display correctly. - Data can change between pages, so do not infer that a good has been deleted from paging results; determine delisting from
is_active.
Errors
| code | Scenario | Action |
|---|---|---|
1001 | Invalid paging parameters | Adjust them to the documented ranges |
1003 | catalog.read not enabled | Enable the permission in the portal |
4001 | Rate limit triggered | Back off per retry_after |
Goods without SKUs
Some goods have a single price and no specifications (for example, a single subscription plan). For such goods:
skusis returned as an empty array;- the goods-level
pricesis the selling price, and both display and checkout use it; - do not delist a good just because it has no SKUs; list it using the goods-level price.
For goods with SKUs, skus[].prices is authoritative, and the goods-level prices is only a display reference.