docs: 补充档案回流接口调用说明(docs/api.md + 前台 API 文档页)
CI / Go (api) (pull_request) Successful in 1m2s
CI / Python (ingestion) (pull_request) Successful in 27s
CI / Migrations (postgres) (pull_request) Successful in 24s

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
busenalbantoglu51424
2026-06-25 01:41:39 +00:00
parent e7e5ce22ab
commit a61d1c558c
2 changed files with 93 additions and 0 deletions
@@ -343,6 +343,41 @@ curl -H "Authorization: Bearer og_live_xxxxxxxx" ${BASE}/products/search?q=牛
}`}
/>
<Endpoint
method="POST"
path="/api/public/backflow"
title="档案回流(批量回流未收录商品,需 API Key)"
desc="供进销存等机器调用方使用:把档案里尚未收录的商品批量推送过来,进入人工审核队列,审核通过后才收录。必须携带 API Key(与上文同一类 og_live_ 密钥),不会直接写入商品。请求体为商品对象数组(与公众投稿同结构),单次最多 1000 条;按条码 GTIN 逐条去重,返回每条结果:queued(入队待审)/ exists(已收录跳过)/ duplicate(已有同条码待审跳过)/ invalid(无效,如名称为空)。"
params={[
{ name: "name", required: true, desc: "商品名称(数组中每个元素)" },
{ name: "gtin", desc: "条码(GTIN),强烈建议提供,用于去重" },
{ name: "brand_name", desc: "品牌名" },
{ name: "category_id", desc: "品类编码,如 food.beverages" },
{ name: "net_content_value / net_content_unit", desc: "净含量数值 / 单位" },
{ name: "country_of_origin", desc: "产地" },
{ name: "msrp", desc: "零售价快照数组,元素含 amount/currency/region/effective_date" },
{ name: "note", desc: "备注" },
]}
example={`curl -X POST ${ORIGIN}/api/public/backflow \\
-H "X-API-Key: og_live_xxxxxxxx" \\
-H "Content-Type: application/json" \\
-d '[
{"name":"某某牛奶 250ml","gtin":"6901234567890","brand_name":"某品牌",
"net_content_value":250,"net_content_unit":"ml",
"msrp":[{"amount":3.5,"currency":"CNY","region":"CN"}]},
{"name":"已收录商品","gtin":"5449000000996"}
]'`}
response={`{
"total": 2, "queued": 1, "exists": 1, "duplicate": 0, "invalid": 0,
"results": [
{ "gtin": "6901234567890", "name": "某某牛奶 250ml",
"status": "queued", "id": "<submission-id>" },
{ "gtin": "5449000000996", "name": "已收录商品",
"status": "exists", "reason": "该条码商品已收录" }
]
}`}
/>
<Endpoint
method="POST"
path="/api/v1/register"