合作伙伴 API(B2B)
商品详情
GET /b2b/v1/products/:id — 使用搜索结果中的 id 获取单个商品。
请求#
GET
/b2b/v1/products/:idcurl "https://api.esimoa.com/b2b/v1/products/partner_9VKPYQ3JRYVK5797" \
-H "X-API-Key: $ESIMOA_PARTNER_KEY"const res = await fetch(`https://api.esimoa.com/b2b/v1/products/${encodeURIComponent(id)}`, {
headers: { 'X-API-Key': process.env.ESIMOA_PARTNER_KEY },
});
if (res.status === 404) {
// PRODUCT_NOT_FOUND — no longer on sale, remove it from your catalog
}
const { data: product } = await res.json();res = requests.get(
f"https://api.esimoa.com/b2b/v1/products/{product_id}",
headers={"X-API-Key": os.environ["ESIMOA_PARTNER_KEY"]},
timeout=10,
)
if res.status_code == 404:
... # PRODUCT_NOT_FOUND — no longer on sale
product = res.json()["data"]id 为商品搜索结果中的 id(以 partner_ 开头)。
响应#
data 为单个 PartnerProduct 对象。
200 OKjson
{
"success": true,
"data": { "id": "partner_9VKPYQ3JRYVK5797", "name": "Japan Unlimited 5일", "...": "..." }
}错误#
id 格式错误、不存在或 esimoa 已不再直接销售的商品返回 404 PRODUCT_NOT_FOUND。请将其从您保存的目录中移除。
404 Not Foundjson
{ "statusCode": 404, "code": "PRODUCT_NOT_FOUND", "message": "Product not found." }