
Linkfox Temu Order Eu
- 172 installs
- 64 repo stars
- Updated August 3, 2026
- linkfox-ai/linkfox-skills
Helps with ai & agent building tasks.
About
linkfox-temu-order-eu is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- linkfox-temu-order-eu
- AI & Agent Building
- AI-coding skill
Linkfox Temu Order Eu by the numbers
- 172 all-time installs (skills.sh)
- +36 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #3,113 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/linkfox-ai/linkfox-skills --skill linkfox-temu-order-euAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 172 |
|---|---|
| repo stars | ★ 64 |
| Last updated | August 3, 2026 |
| Repository | linkfox-ai/linkfox-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
Temu 欧洲站订单管理 API(Manage Order)
本 skill(linkfox-temu-order-eu)覆盖 Partner Platform for EU Order 菜单(menu_code=dbd3d395963a408984b8ae7dbc5f64f9)下 10 个订单 bg.order.* / temu.order.* / temu.local.order.* 接口(type 与 US 对齐,默认 site=eu)。美国站请用 `linkfox-temu-order-us`;全球站(非 US/EU)请用 `linkfox-temu-order-global`。
详见 partner-eu-catalog.md。
当前已接入 10 个接口;其余订单接口将按 Partner 文档逐条补充到references/apis/与eu_order_*.py。
网关(本 skill 内置):
| 能力 | 方法 | 路径 |
|---|---|---|
订单 OpenAPI(eu_order_*、temu_eu_proxy) | POST | https://tool-gateway.linkfox.com/temu/proxy |
| 加签文件下载 | POST | https://tool-gateway.linkfox.com/temu/fileDownload |
相关 skill
| 场景 | skill |
|---|---|
| 商品列表/详情/编辑/库存/上下架 | linkfox-temu-manage-product-eu |
| 发品、类目、V2 add | linkfox-temu-add-product-us |
| 价格/供货价、定价单 | linkfox-temu-price-eu |
| 取消订单 | linkfox-temu-cancel-order-eu |
| 退货与退款 | linkfox-temu-returns-refunds-eu |
| 履约/发货(购标、合作仓、自发货、跟踪) | linkfox-temu-fulfillment-eu |
| 网关与 Temu token | 本 skill scripts/ |
API Usage
| 文档 | 内容 |
|---|---|
| api.md | 网关、鉴权、错误码、扩展流程 |
| partner-eu-catalog.md | 接口目录 + Partner URL + 脚本(随接入更新) |
| apis/README.md | 按接口分文件(apis/<type-slug>.md) |
默认参数
| 字段 | 默认 | 说明 |
|---|---|---|
| site | eu | Partner EU |
| managementType | semi-managed | 半托管 |
| tokenPurpose | order-shipping | 订单/发货场景 token(见 access-token.md) |
鉴权
1. LinkFox:LINKFOXAGENT_API_KEY → Header Authorization + Token 2. Temu:accessToken 或 storeKey(storeKey 时建议带 tokenPurpose=order-shipping)
Scripts(按 type)
| 脚本 | type | 状态 |
|---|---|---|
eu_order_list_v2_get.py | bg.order.list.v2.get | 已接入 |
eu_order_detail_v2_get.py | bg.order.detail.v2.get | 已接入 |
eu_order_shippinginfo_v2_get.py | bg.order.shippinginfo.v2.get | 已接入 |
eu_order_decryptshippinginfo_get.py | bg.order.decryptshippinginfo.get | 已接入 |
eu_order_amount_query.py | bg.order.amount.query | 已接入 |
eu_order_amount_v2_query.py | temu.order.amount.v2.query | 已接入 |
eu_order_amount_v3_query.py | temu.order.amount.v3.query | 已接入 |
eu_order_combinedshipment_list_get.py | bg.order.combinedshipment.list.get | 已接入 |
eu_order_customization_get.py | bg.order.customization.get | 已接入 |
eu_order_verification_upload.py | temu.local.order.verification.upload | 已接入 |
temu_eu_proxy.py | 任意 type | 通用 |
temu_eu_file_download.py | 加签文件下载 | 通用 |
接入新接口(约定)
你每提供一条 Partner 文档(type + 参数表 + 可选 sub_menu_code),将:
1. 新增 references/apis/<type-slug>.md(完整入参/出参层级) 2. 新增 scripts/eu_order_<slug>.py(调用 _eu_order_script.run_cli) 3. 更新 partner-eu-catalog.md、apis/README.md 与本表
示例
export LINKFOXAGENT_API_KEY="<key>"
# 订单列表 V2(待发货 parentOrderStatus=2)
python scripts/eu_order_list_v2_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"pageNumber": 1,
"pageSize": 20,
"parentOrderStatus": 2
}
}'
# 按父订单号查询(最多 20 个)
python scripts/eu_order_list_v2_get.py '{
"accessToken": "TOKEN",
"request": {
"parentOrderSnList": ["PO-123456789"]
}
}'
# 订单详情 V2(须 parentOrderSn)
python scripts/eu_order_detail_v2_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}'
# 收货地址 V2(传 parentOrderSn)
python scripts/eu_order_shippinginfo_v2_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}'
# 敏感收货地址解密(传 parentOrderSn)
python scripts/eu_order_decryptshippinginfo_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}'
# 订单金额/供货价(ERP 对账,传 parentOrderSn)
python scripts/eu_order_amount_query.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}'
# 可合并发货订单组(request 可为空对象)
python scripts/eu_order_combinedshipment_list_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {}
}'
# 定制商品内容(子订单号 orderSn,单次最多 10 个)
python scripts/eu_order_customization_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"orderSnList": ["SO-123456789", "SO-987654321"]
}
}'
# 上传 SN/IMEI 或二手鉴真(orderList[].orderSn)
python scripts/eu_order_verification_upload.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"orderList": [
{
"orderSn": "SO-123456789",
"verificationInfo": [
{
"serialNumber": "SN-001234567890",
"imeiNumberList": ["352099001761481"]
}
]
}
]
}
}'Feedback: skillName:linkfox-temu-order-eu
网关与授权脚本
| 脚本 | 说明 |
|---|---|
check_linkfox_token.py | 校验 LinkFox 用户 Token |
temu_token_guide.py | Temu accessToken 后台授权步骤 |
save_temu_access_token.py | 保存 accessToken 到本地 |
list_temu_access_tokens.py | 列出已保存 token |
get_temu_access_token.py | 读取已保存 token |
temu_proxy.py | 通用网关转发(多 site) |
temu_file_download.py | 加签文件下载(多 site) |
授权说明:references/access-token.md
<!-- LF_LARGE_RESPONSE_BLOCK -->
Handling Large Responses
To avoid overflowing the agent context, persist the response to disk and extract only the fields you need:
python scripts/response_io.py run --script scripts/check_linkfox_token.py --out-dir <DIR> '<params>'
python scripts/response_io.py read <file> --fields "<paths>" # or --path "<JMESPath>"Pick--out-diroutside any git working tree (e.g./tmp/...on Unix,%TEMP%/...on Windows). Persisted responses may contain PII, pricing, or auth-sensitive data — do not commit them. Files are not auto-deleted; clean up when the task is done.
This skill exposes multiple entry scripts:check_linkfox_token.py,eu_order_amount_query.py,eu_order_amount_v2_query.py,eu_order_amount_v3_query.py,eu_order_combinedshipment_list_get.py,eu_order_customization_get.py,eu_order_decryptshippinginfo_get.py,eu_order_detail_v2_get.py,eu_order_list_v2_get.py,eu_order_shippinginfo_v2_get.py,eu_order_verification_upload.py,get_temu_access_token.py,list_temu_access_tokens.py,save_temu_access_token.py,temu_eu_file_download.py,temu_eu_proxy.py,temu_file_download.py,temu_proxy.py,temu_token_guide.py. Pass--script scripts/<name>.pyto choose the one you need.
run writes the full response to a file and emits only a schema preview + file path. read projects specific fields, with --limit/--offset for slicing and --format json|jsonl|csv|table for output.
When to prefer this pattern — apply your judgment based on the response characteristics, e.g.:
- High field count per record, or fields you don't need
- Batch/paginated results (multiple items per call)
- Long-text fields (descriptions, reviews, HTML, time series)
- Output reused across later steps rather than consumed immediately
For small, single-use responses, calling the main script directly is fine.
⚠️ The preview is a truncated schema + sample, not the full data. Any field-level decision must read from the persisted file via read. <!-- /LF_LARGE_RESPONSE_BLOCK -->
Temu accessToken 授权与获取
Temu 没有 LinkFox 侧自动 OAuth;accessToken 须在 Temu 卖家后台「服务市场 → 授权管理」手动复制。与 LINKFOXAGENT_API_KEY(LinkFox 用户鉴权)是两套令牌。
两种鉴权(勿混淆)
| 令牌 | 用途 | 获取方式 |
|---|---|---|
| LinkFox 用户 Token | 调用 /temu/proxy、/temu/fileDownload 必填 | LINKFOXAGENT_API_KEY 或请求 JSON 的 token;Header Authorization + Token(同 amazon-store-auth) |
| Temu accessToken | Temu 业务 API(经紫鸟转发) | Temu 卖家后台授权后复制 |
export LINKFOXAGENT_API_KEY="<your-key>"
python scripts/check_linkfox_token.pytokenPurpose 与场景
| tokenPurpose | 店铺类型 | 推荐 site | 授权应用 |
|---|---|---|---|
product-inventory | 半托管 | cn / partner | 酷鸟卖家助手 |
order-shipping | 半托管 | us / global / eu | Cyber-ERP酷鸟助手 |
full-managed | 全托管 | cn / partner | 酷鸟卖家助手 |
local-native | 本土(美/欧主体) | us 等 | Cyber-ERP |
1. 半托管 — 商品/库存 Token
1. 登录 seller.kuajingmaihuo.com 或 agentseller.temu.com 2. 系统管理 → 服务市场 → 授权管理 3. 获取授权 → 选择 「酷鸟卖家助手」 4. 全选常规和特殊授权 → 确认 → 复制 access_token 5. 调用 API:site=cn 或 partner,managementType=semi-managed
2. 半托管 — 订单/发货 Token
1. 登录 Temu 卖家后台 2. 右上角 Seller Central → 切换到目标区域(美区 / 欧区 / 全球) 3. 服务市场 → 授权管理 4. 获取授权 → 选择 「Cyber-ERP酷鸟助手」 5. 全选授权 → 确认 → 复制 token 6. 调用 API:site=eu / global / eu,managementType=semi-managed
3. 全托管店铺
1. 登录 Temu 平台 2. 系统管理 → 服务市场 → 授权管理 3. 获取授权 → 「酷鸟卖家助手」 → 全选 → 复制 token 4. 调用 API:managementType=full-managed,site 通常 cn 或 partner
4. 本土店铺(美区、欧区主体)
1. 登录 Temu 2. Apps And Services → Manage Your Apps 3. Authorize a new app → 搜索 「Cyber-ERP」 4. 一般权限与敏感权限全选 → 确认 → 复制 token
站点与 OpenAPI 网关
| site | 说明 | Temu 网关 |
|---|---|---|
| cn | 中国站 | openapi.kuajingmaihuo.com |
| partner | Partner 网关 | openapi-b-partner.temu.com |
| us | 欧洲站 | openapi-b-eu.temu.com |
| global | 全球区 | openapi-b-global.temu.com |
| eu | 欧洲站 | openapi-b-eu.temu.com |
本地保存 Token(推荐)
默认存储:~/.linkfox/temu-access-tokens.json(可用 TEMU_TOKEN_STORE_PATH 覆盖)。
# 查看授权步骤
python scripts/temu_token_guide.py '{"shopType":"semi-managed","tokenPurpose":"product-inventory","site":"cn"}'
# 保存 token
python scripts/save_temu_access_token.py '{
"storeKey": "my-shop",
"label": "中国半托管",
"site": "cn",
"managementType": "semi-managed",
"tokenPurpose": "product-inventory",
"accessToken": "PASTE_TOKEN"
}'
# 列出已保存(脱敏)
python scripts/list_temu_access_tokens.py
# 用 storeKey 调 API(无需每次粘贴 token)
python scripts/temu_proxy.py '{
"storeKey": "my-shop",
"site": "cn",
"managementType": "semi-managed",
"tokenPurpose": "product-inventory",
"type": "bg.goods.category.mapping",
"params": {"goodsName": "测试", "goodsNameEn": "Test"}
}'注意事项
1. 子账号:可能无法进入服务市场,需主账号授权。 2. 多站点:欧洲站、英国站等需分别登录对应后台获取 Token。 3. 有效期:Token 会过期,过期后重新在后台复制并 save_temu_access_token.py。 4. IP 白名单:需联系紫鸟开放平台配置调用 IP。 5. 参数小写:site、managementType 必须小写。
脚本一览
| 脚本 | 说明 |
|---|---|
temu_token_guide.py | 按店铺类型/用途输出授权步骤 |
save_temu_access_token.py | 保存 accessToken 到本地 |
list_temu_access_tokens.py | 列出已保存 token(默认脱敏) |
get_temu_access_token.py | 读取指定 store 的 token |
linkfox-temu-order-eu — API 参考
Temu 欧洲站订单管理(Partner EU Order / 订单发货 相关接口),经本 skill temu_eu_proxy(POST /temu/proxy) 转发。Temu 的 type 写在 Body,不是 URL 路径。
网关与鉴权:本 skillscripts/(LINKFOXAGENT_API_KEY、accessToken/storeKey)。订单场景 token 见references/access-token.md(tokenPurpose=order-shipping)。
---
调用规范
| 项 | 说明 |
|---|---|
| 网关根地址 | https://tool-gateway.linkfox.com(可用 TEMU_API_BASE_URL / STORE_API_BASE_URL 覆盖) |
| 订单 OpenAPI | POST /temu/proxy |
| 加签文件下载 | POST /temu/fileDownload(temu_eu_file_download.py) |
| LinkFox 鉴权 | Header `Authorization` 与 `Token`(同值);或 LINKFOXAGENT_API_KEY;或 JSON token |
| Temu 鉴权 | Body accessToken,或 storeKey + site + managementType + tokenPurpose |
| 默认 | site=eu,managementType=semi-managed,tokenPurpose=order-shipping |
| 上游 OpenAPI(EU) | https://openapi-b-eu.temu.com/openapi/router(网关按 site 解析) |
网关请求 Body(/temu/proxy)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| site | string | 是 | eu(本 skill 默认) |
| managementType | string | 是 | semi-managed |
| accessToken | string | 与 storeKey 二选一 | Temu 店铺令牌 |
| storeKey | string | 与 accessToken 二选一 | ~/.linkfox/temu-access-tokens.json 中的键 |
| tokenPurpose | string | 否 | 建议 `order-shipping`(订单/发货) |
| type | string | 是 | Temu 接口名,如 Partner 文档中的 bg.* / temu.* |
| params | object | 否 | 业务参数;多数接口业务块在 `params.request` |
网关响应
| 字段 | 类型 | 说明 |
|---|---|---|
| body | string | Temu 原始 JSON 字符串;脚本解析为 temuBody |
| code | integer | 网关错误码:1002 参数/Token,1003 转发失败 |
解析顺序:网关 `code` → JSON.parse(body) → success / errorCode / errorMsg / result。
脚本调用
export LINKFOXAGENT_API_KEY="<key>"
python scripts/eu_order_list_v2_get.py '{"accessToken":"TOKEN","tokenPurpose":"order-shipping","request":{"pageNumber":1,"pageSize":20,"parentOrderStatus":2}}'业务字段可放在顶层或嵌套 params;含 request 时通常整体作为 params 转发。
---
接口一览
完整 sub_menu_code 与 Partner 文档 URL 见 partner-eu-catalog.md。
每个接口单独一份文档:apis/README.md(随接入递增)。
已接入接口见 apis/README.md。
---
典型订单管理流程
1. bg.order.list.v2.get(本 skill) → 按状态/时间/父单号分页查订单列表
2. bg.order.detail.v2.get(本 skill) → 按 parentOrderSn 拉父单+子单完整详情
3. bg.order.shippinginfo.v2.get(本 skill) → 按 parentOrderSn 拉收货地址(含 warning)
4. bg.order.decryptshippinginfo.get(本 skill) → 按 parentOrderSn 拉**敏感/解密**收货地址
5. bg.order.amount.query(本 skill) → 按 parentOrderSn 拉供货价/金额(ERP 对账,V1)
5b. temu.order.amount.v2.query / v3.query(本 skill) → 按 parentOrderSn 拉销售/客户支付金额(V2 细税费 / V3 含税价)
6. bg.order.combinedshipment.list.get(本 skill) → 拉可合并发货的父订单组
7. bg.order.customization.get(本 skill) → 按 orderSnList(≤10)拉定制商品内容
8. temu.local.order.verification.upload(本 skill) → 上传 SN/IMEI 或二手鉴真编码
9. (待补充)合并发货确认/面单等 → 填运单、确认发货
10. 取消订单(买家/卖家) → **`linkfox-temu-cancel-order-eu`**
11. 履约/发货(购标、自发货、合作仓、跟踪) → **`linkfox-temu-fulfillment-eu`**商品信息请用 `linkfox-temu-manage-product-eu`;发品请用 `linkfox-temu-add-product-us`;取消订单请用 `linkfox-temu-cancel-order-eu`;履约/发货请用 `linkfox-temu-fulfillment-eu`。
---
网关错误码
| code | 说明 | 处理 |
|---|---|---|
| 1002 | 参数或 LinkFox Token 无效 | 修正参数与 LINKFOXAGENT_API_KEY |
| 1003 | 转发失败 | 检查 Temu token、tokenPurpose、白名单、网络 |
---
Feedback API
- POST
https://skill-api.linkfox.com/api/v1/public/feedback skillName: `linkfox-temu-order-eu`
订单金额/供货价查询 — bg.order.amount.query
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_amount_query.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9(按 type 在 Partner EU 后台打开) |
| 网关 | POST /temu/proxy,type=bg.order.amount.query,业务载荷放在 Body 的 params |
Description: Provide the supply price information corresponding to the orders for the self-developed ERP(为自研 ERP 提供订单对应的供货价/金额信息)。
网关鉴权字段由本 skill 网关脚本处理;业务参数见下方 request。建议使用 `tokenPurpose=order-shipping`。---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
└── parentOrderSn (STRING, 必填)request
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| parentOrderSn | STRING | 是 | Parent order number(父订单号) |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}---
Response(Temu body 解析后)
response
├── success
├── errorCode
├── errorMsg
└── result
├── parentOrderMap
│ ├── parentOrderSn
│ ├── basePriceTotal
│ ├── shippingAmountTotal
│ ├── taxTotal
│ ├── discountFromSeller
│ ├── discountFromTEMU
│ ├── refundsTotal
│ ├── estimatedRevenueDeduction
│ ├── estimatedRevenue
│ ├── retailPriceTotal
│ ├── customerPaid
│ ├── totalDiscount
│ └── signOnDelivery
├── orderList[]
│ ├── orderSn
│ ├── basePrice
│ ├── unitBasePrice
│ ├── quantity
│ ├── unitRetailPrice
│ ├── discountFromSeller
│ ├── discountFromTEMU
│ └── shipAmountTotal
└── warning[]下列带 `currency` + `amount` 的金额块结构相同,见 金额块(MoneyAmount)。
response 顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT | 订单金额结果 |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderMap | OBJECT | Parent order information(父订单金额汇总) |
| orderList | OBJECT[] | Order information(子订单金额明细) |
| warning | STRING[] | warning message(告警信息) |
parentOrderMap
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderSn | STRING | Parent order number(父订单号) |
| basePriceTotal | OBJECT | Base price total(基础价/供货价合计) |
| shippingAmountTotal | OBJECT | Shipping total(运费合计) |
| taxTotal | OBJECT | Consumer's paid tax: Calculated on realPrice(消费者已付税费,按 realPrice 计算) |
| discountFromSeller | OBJECT | Discount from seller(卖家折扣) |
| discountFromTEMU | OBJECT | Discount from Temu(平台折扣) |
| refundsTotal | OBJECT | Refunds total(退款合计) |
| estimatedRevenueDeduction | OBJECT | Estimated revenue deduction(预估收入扣减) |
| estimatedRevenue | OBJECT | Estimated revenue(预估收入) |
| retailPriceTotal | OBJECT | Retail price total — Total promotional sale price of the products(零售价/促销售价合计) |
| customerPaid | OBJECT | Total paid — payment of the order from the customer(消费者实付合计) |
| totalDiscount | OBJECT | the amount of discount(折扣合计) |
| signOnDelivery | OBJECT | amount of signature on delivery(签收服务费) |
parentOrderMap 金额字段公式(官方说明)
| 字段 | 公式 / 说明 |
|---|---|
| estimatedRevenue | estimatedRevenue = basePriceTotal + shippingAmountTotal - estimatedRevenueDeduction + signOnDelivery |
| customerPaid | customerPaid = retailPriceTotal + shippingAmountTotal + taxTotal - refundsTotal + signOnDelivery - totalDiscount |
| totalDiscount | totalDiscount = discountFromTEMU + discountFromSeller |
| signOnDelivery | 消费者未购买该服务时返回 NULL;签收服务费已退款时返回 0 |
orderList[]
| 参数 | 类型 | 说明 |
|---|---|---|
| orderSn | STRING | Order number (sub-order number)(子订单号) |
| basePrice | OBJECT | Base price(子单基础价/供货价) |
| unitBasePrice | OBJECT | Base price subtotal — unit base price(单位基础价小计) |
| quantity | INTEGER | The quantity of original single items in order(订单原始单品数量) |
| unitRetailPrice | OBJECT | Unit retail price(单位零售价) |
| discountFromSeller | OBJECT | Discount from seller for this product(该商品卖家折扣) |
| discountFromTEMU | OBJECT | Discount from TEMU for this product(该商品平台折扣) |
| shipAmountTotal | OBJECT | shipping cost — Total shipping fee of this product(该商品运费合计) |
---
金额块(MoneyAmount)
以下字段均为 OBJECT,结构一致:
| 参数 | 类型 | 说明 |
|---|---|---|
| currency | STRING | currency(币种代码) |
| amount | LONG | The minimum currency unit of the local currency(本地货币最小单位金额)。例如美国:Cents(分) |
适用字段:basePriceTotal、shippingAmountTotal、taxTotal、discountFromSeller、discountFromTEMU、refundsTotal、estimatedRevenueDeduction、estimatedRevenue、retailPriceTotal、customerPaid、totalDiscount、signOnDelivery,以及 orderList[] 中的 basePrice、unitBasePrice、unitRetailPrice、discountFromSeller、discountFromTEMU、shipAmountTotal。
展示为美元等主币种时,需将 amount 除以 100(欧洲站)。---
示例
python scripts/eu_order_amount_query.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}'ERP 对账时可与 bg.order.detail.v2.get 的子单 orderSn 对齐查看 orderList[] 各行金额。
可合并发货订单组列表 — bg.order.combinedshipment.list.get
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_combinedshipment_list_get.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9(按 type 在 Partner EU 后台打开) |
| 网关 | POST /temu/proxy,type=bg.order.combinedshipment.list.get,业务载荷放在 Body 的 params |
Description: The bg.order.combinedshipment.list.get interface is designed for merchants to retrieve combined shipping groups, including lists of parent orders that can be combined for shipping(供商家查询可合并发货的订单组,每组包含可合并发货的父订单列表)。
网关鉴权字段由本 skill 网关脚本处理;业务参数见下方 request(官方无额外筛选字段,可传空对象)。建议使用 `tokenPurpose=order-shipping`。---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
└── (无子字段;可传 {} 或不传 request)request
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| _(无)_ | — | — | 官方入参表仅声明 request 对象,无其它业务筛选字段;调用时通常传空对象 {} 或省略 request |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {}
}{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping"
}---
Response(Temu body 解析后)
response
├── success
├── errorCode
├── errorMsg
└── result
└── combinedShippingGroups[] (OBJECT[])
└── combinedShippingGroup[] (OBJECT[])
├── parentOrderSn
├── parentOrderStatus
├── parentOrderTime
├── mallId
└── semiUniqueIdresponse 顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT | 可合并发货组列表等业务结果 |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| combinedShippingGroups | OBJECT[] | Combined shipping groups(可合并发货组列表);每组内包含可合并发货的父订单列表 |
combinedShippingGroups[] 元素
| 参数 | 类型 | 说明 |
|---|---|---|
| combinedShippingGroup | OBJECT[] | A list of parent orders that can be combined for shipping(本组内可合并发货的父订单列表) |
combinedShippingGroup[] 元素
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderSn | STRING | parent order number(父订单号) |
| parentOrderStatus | INTEGER | Status of the parent order(父订单状态),见下表 |
| parentOrderTime | INTEGER | Time when the parent order was placed(父订单下单时间,秒级时间戳) |
| mallId | LONG | mallId(店铺/商城 ID) |
| semiUniqueId | STRING | Unique identifier for semi-managed stores(半托管店铺唯一标识) |
parentOrderStatus(出参)
| 值 | 说明 |
|---|---|
1 | PENDING(待处理) |
2 | UN_SHIPPING(待发货) |
3 | CANCELED(已取消) |
4 | SHIPPED(已发货) |
41 | PARTIALLY_SHIPPED(部分发货,仅 local mall) |
5 | DELIVERED / RECEIPTED(已签收) |
51 | PARTIALLY_DELIVERED(部分签收,仅 local mall) |
与bg.order.list.v2.get出参中parentOrderMap.parentOrderStatus含义一致;具体以 Partner 文档为准。
---
示例
python scripts/eu_order_combinedshipment_list_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {}
}'典型流程:本接口拉可合并发货父单组 → 对组内 parentOrderSn 调用 bg.order.shippinginfo.v2.get / bg.order.decryptshippinginfo.get 取地址 → 后续合并发货/面单接口(待接入)。
订单定制商品内容批量查询 — bg.order.customization.get
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_customization_get.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9(按 type 在 Partner EU 后台打开) |
| 网关 | POST /temu/proxy,type=bg.order.customization.get,业务载荷放在 Body 的 params |
Description: Self developed sellers and third-party ISVs obtain customized product content information in bulk through Open API(自研卖家与第三方 ISV 通过 Open API 批量获取订单的定制商品内容信息)。
网关鉴权字段由本 skill 网关脚本处理;业务参数见下方 request。建议使用 `tokenPurpose=order-shipping`。入参为子订单号orderSn(非parentOrderSn),可从bg.order.list.v2.get/bg.order.detail.v2.get的orderList[].orderSn取得。
---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
└── orderSnList[] (STRING[], 否)request 内字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| orderSnList | STRING[] | 否 | orderSnList(子订单号列表);单次最多查询 10 个订单 |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"orderSnList": ["SO-001", "SO-002"]
}
}---
Response(Temu body 解析后)
response
├── success
├── errorCode
├── errorMsg
└── result[] (OBJECT[])
├── orderSn
├── customizedType
├── customizedData ← 仅 customizedType=2 时返回
├── previewList[] ← 仅 customizedType=2 时返回
│ ├── previewType
│ ├── imageUrl
│ ├── customizedText
│ └── customizedAreaId
├── templateId
├── templateType
├── customizedText ← 仅 customizedType=1 时返回(result 层级)
└── customizedSvgList[]
└── compressedFileUrlresponse 顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT[] | 各子订单的定制内容列表(与请求的 orderSnList 对应) |
result[] 元素
| 参数 | 类型 | 说明 |
|---|---|---|
| orderSn | STRING | OrderSn corresponding to customized information(对应该定制信息的子订单号) |
| customizedType | INTEGER | Customized type(定制类型),见下表 |
| customizedData | STRING | Graphic customization content, in json format(图文定制内容,JSON 字符串);仅当 `customizedType=2` 时返回 |
| previewList | OBJECT[] | Graphic customization preview information(图文定制预览信息);仅当 `customizedType=2` 时返回 |
| templateId | LONG | Customization template ID when user created customized information(用户创建定制信息时的模板 ID);商品无模板时为 null |
| templateType | INTEGER | Customization template type when user created customized information(定制模板类型);商品无模板时为 null,见下表 |
| customizedText | STRING | Customization text(纯文本定制内容);仅当 `customizedType=1` 时返回(位于 result[] 元素顶层,与 previewList[].customizedText 不同) |
| customizedSvgList | OBJECT[] | Customized information list in SVG format(SVG 格式定制信息列表) |
customizedType
| 值 | 说明 |
|---|---|
1 | pure text customization, no customized templates(纯文本定制,无定制模板) |
2 | customized graphics and text, with customized templates available(图文定制,有定制模板) |
templateType
| 值 | 说明 |
|---|---|
1 | only image(仅图片) |
2 | only text(仅文字) |
3 | text and image(文字 + 图片) |
商品无定制模板时,templateId/templateType为null。
previewList[] 元素
| 参数 | 类型 | 说明 |
|---|---|---|
| previewType | INTEGER | type of preview item(预览项类型),见下表 |
| imageUrl | STRING | Image URL(图片 URL) |
| customizedText | STRING | Customized Text(预览项中的定制文字) |
| customizedAreaId | STRING | Customized Area ID(定制区域 ID);仅当 `templateType=3` 且 `previewType=3` 或 `4` 时返回 |
previewType
| 值 | 说明 |
|---|---|
1 | overall preview image(整体预览图;若商品未配置定制区域,则为商家上传的效果图) |
3 | user uploaded image(用户上传图片) |
4 | customized text(定制文字) |
customizedSvgList[] 元素
| 参数 | 类型 | 说明 |
|---|---|---|
| compressedFileUrl | STRING | Image URL and Compression file URL(图片/压缩包下载 URL);调用方需 GET 该 URL 拉取文件;创建后 10 分钟内有效,过期需重新调本接口获取新 URL |
下载 compressedFileUrl 的 TOA 请求头
对 compressedFileUrl 发起 GET 时,需在 Header 携带以下公共参数(与 Partner 文档一致):
| Header | 说明 |
|---|---|
toa-app-key | ${app_key} |
toa-access-token | ${access_token} |
toa-random | 32 位随机数字符串 |
toa-timestamp | 时间戳 |
toa-sign | 签名(见下) |
`toa-sign` 计算逻辑:
1. 将 Header 中参与签名的参数按参数名 ASCII 升序排序:toa-app-key、toa-access-token、toa-random、toa-timestamp 2. 按 参数名 + 参数值 依次拼接(中间无分隔符),得到长字符串 3. 在拼接结果首尾各拼接一次 app_secret,得到签名字符串 4. 对签名字符串做 MD5,再将密文转为大写,即为 toa-sign
实际app_key/access_token/app_secret以店铺授权与 Partner 应用配置为准;经 LinkFox 网关调用本type时,业务 JSON 仍走POST /temu/proxy,文件下载为对上述 URL 的独立 GET + TOA 头。
---
字段返回条件速查
| 字段 | 返回条件 |
|---|---|
customizedText(result[] 顶层) | customizedType=1 |
customizedData、previewList | customizedType=2 |
previewList[].customizedAreaId | templateType=3 且 previewType=3 或 4 |
templateId、templateType | 有定制模板时;无模板为 null |
---
示例
python scripts/eu_order_customization_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"orderSnList": ["SO-123456789", "SO-987654321"]
}
}'典型流程:bg.order.detail.v2.get 取得 orderList[].orderSn → 本接口批量拉定制内容(≤10 条)→ 若需 SVG/压缩包,用返回的 compressedFileUrl + TOA 头 GET 下载。
订单收货地址解密查询 — bg.order.decryptshippinginfo.get
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_decryptshippinginfo_get.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9(按 type 在 Partner EU 后台打开) |
| 网关 | POST /temu/proxy,type=bg.order.decryptshippinginfo.get,业务载荷放在 Body 的 params |
Description: The bg.order.decryptshippinginfo.get interface is designed to retrieve sensitive shipping address information for a specific order(获取指定订单的敏感收货地址信息,通常为解密后的明文姓名、电话、地址等)。
网关鉴权字段由本 skill 网关脚本处理;业务参数见下方 request。建议使用 `tokenPurpose=order-shipping`。隐私提示:返回含收件人姓名、电话、详细地址等 PII,请按合规要求存储与展示,勿写入日志或公开渠道。
与 bg.order.shippinginfo.v2.get 的区别:本接口用于获取解密/敏感收货信息;若仅需常规收货地址(含 warning 限制提示),见 bg-order-shippinginfo-v2-get.md。
---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
└── parentOrderSn (STRING, 否)request 内字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| parentOrderSn | STRING | 否 | parentOrderSn(父订单号);查询指定订单敏感收货地址时应传入 |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}---
Response(Temu body 解析后)
response
├── success
├── errorCode
├── errorMsg
└── result
├── receiptName
├── receiptAdditionalName
├── mobile
├── backupMobile
├── mail
├── regionName1
├── regionName2
├── regionName3
├── regionName4
├── addressLine1
├── addressLine2
├── addressLine3
├── postCode
├── addressLineAll
└── addressExtra
├── firstName
├── lastName
├── additionalFirstName
└── additionalLastNameresponse 顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT | 解密后的敏感收货地址等业务结果 |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| receiptName | STRING | Name(收件人姓名) |
| receiptAdditionalName | STRING | Additional Name(附加姓名) |
| mobile | STRING | Phone Number(手机号) |
| backupMobile | STRING | Alternate Phone(备用电话) |
| STRING | Virtual Email(虚拟邮箱) | |
| regionName1 | STRING | regionName1(一级行政区名称) |
| regionName2 | STRING | regionName2(二级行政区名称) |
| regionName3 | STRING | regionName3(三级行政区名称) |
| regionName4 | STRING | regionName4(四级行政区名称) |
| addressLine1 | STRING | addressLine1(地址行 1) |
| addressLine2 | STRING | addressLine2(地址行 2) |
| addressLine3 | STRING | addressLine3(地址行 3) |
| postCode | STRING | postCode(邮编) |
| addressLineAll | STRING | addressLineAll(完整地址行,通常为 addressLine1 + Line2 + Line3 拼接) |
| addressExtra | OBJECT | addressExtra(姓名拆分等扩展信息) |
addressExtra
| 参数 | 类型 | 说明 |
|---|---|---|
| firstName | STRING | firstName(名) |
| lastName | STRING | lastName(姓) |
| additionalFirstName | STRING | additionalFirstName(附加名) |
| additionalLastName | STRING | additionalLastName(附加姓) |
---
示例
python scripts/eu_order_decryptshippinginfo_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}'典型流程:bg.order.list.v2.get / bg.order.detail.v2.get 取得 parentOrderSn → 本接口拉解密收货地址 → 打单发货(bg.order.shippinginfo.v2.get 可用于带 warning 的常规地址查询)。
订单详情查询 V2 — bg.order.detail.v2.get
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_detail_v2_get.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9(按 type 在 Partner EU 后台打开) |
| 网关 | POST /temu/proxy,type=bg.order.detail.v2.get,业务载荷放在 Body 的 params |
Description: The bg.order.detail.v2.get interface is designed for merchants to retrieve detailed information about a specific order within their respective stores. This functionality provides merchants with access to comprehensive order details, enabling them to process, fulfill, and manage individual orders with precision.
网关鉴权字段由本 skill 网关脚本处理;业务参数见下方 request。建议使用 `tokenPurpose=order-shipping`。---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
├── parentOrderSn (STRING, 必填)
└── fulfillmentTypeList[] (STRING[], 否)request
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| parentOrderSn | STRING | 是 | Parent order number(父订单号) |
| fulfillmentTypeList | STRING[] | 否 | The type of order fulfillment(订单履约类型),见下表 |
fulfillmentTypeList[]
| 值 | 说明 |
|---|---|
fulfillBySeller | fulfill by seller(卖家履约) |
fulfillByCooperativeWarehouse | fulfill by Cooperative Warehouse(合作仓履约) |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789",
"fulfillmentTypeList": ["fulfillBySeller"]
}
}---
Response(Temu body 解析后)
response
├── success
├── errorCode
├── errorMsg
└── result
├── parentOrderMap
│ ├── parentOrderSn
│ ├── parentOrderStatus
│ ├── parentOrderTime
│ ├── expectShipLatestTime
│ ├── parentOrderPendingFinishTime
│ ├── latestDeliveryTime
│ ├── parentShippingTime
│ ├── siteId
│ ├── regionId
│ ├── parentOrderLabel[]
│ │ ├── name
│ │ └── value
│ ├── fulfillmentWarning[]
│ ├── hasShippingFee
│ ├── regionName1 / regionName2 / regionName3
│ ├── orderPaymentType
│ ├── batchOrderNumberList[]
│ ├── shippingMethod
│ ├── isShipmentConsolidatedByMainMall
│ └── parentConfirmTime
└── orderList[]
├── orderSn
├── quantity
├── canceledQuantityBeforeShipment
├── originalOrderQuantity
├── goodsId
├── packageSnInfo[]
│ ├── packageSn
│ ├── packageDeliveryType
│ └── callSuccess
├── packageAbnormalTypeList[]
├── skuId
├── spec
├── originalSpecName
├── thumbUrl
├── goodsName
├── originalGoodsName
├── orderStatus
├── productList[]
│ ├── productId
│ ├── productSkuId
│ ├── soldFactor
│ └── extCode
├── orderLabel[]
│ ├── name
│ └── value
├── fulfillmentWarning[]
├── fulfillmentType
├── inventoryDeductionWarehouseId
├── inventoryDeductionWarehouseName
├── orderPaymentType
├── isCancelledDuringPending
├── earliestTimeBuyShippingLabel
├── earliestTimeGetShippingDocument
├── orderShippingTime
├── isShipmentConsolidatedByMainMall
├── orderCreateTime
├── qualificationUploadEndTime
└── hasUploadedEvidenceresponse 顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT | result |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderMap | OBJECT | Parent order information(父订单信息) |
| orderList | OBJECT[] | Order information(子订单列表) |
parentOrderMap
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderSn | STRING | Parent order number(父订单号) |
| parentOrderStatus | INTEGER | Status of the parent order:1 PENDING;2 UN_SHIPPING;3 CANCELED;4 SHIPPED;41 PARTIALLY_SHIPPED;5 DELIVERED;51 PARTIALLY_DELIVERED |
| parentOrderTime | INTEGER | Time when the parent order was placed(下单时间,秒) |
| expectShipLatestTime | INTEGER | Latest shipment time(最晚发货时间,秒) |
| parentOrderPendingFinishTime | INTEGER | Time when the parent order finish pending(待处理完成时间,秒) |
| latestDeliveryTime | INTEGER | Latest delivery time(最晚送达时间,秒) |
| parentShippingTime | INTEGER | Time when the parent order was shipped(父订单发货时间,秒) |
| siteId | LONG | Site ID |
| regionId | LONG | Region ID,e.g. USA - 211 |
| parentOrderLabel | OBJECT[] | List of PO order status labels(父订单状态标签) |
| fulfillmentWarning | STRING[] | Fulfillment Prompt(履约提示),见下表 |
| hasShippingFee | BOOLEAN | 用户实付运费是否为零:true 为零,false 非零(only for local mall) |
| regionName1 | STRING | Address region 1(地址区域 1) |
| regionName2 | STRING | Address region 2 |
| regionName3 | STRING | Address region 3 |
| orderPaymentType | STRING | Order payment type:COD、PPD |
| batchOrderNumberList | STRING[] | batchOrderNumberList;仅合作仓履约有值,否则为空 |
| shippingMethod | INTEGER | delivery channel type:1 Standard Shipping,2 Store Delivery,3 Customer Pickup |
| isShipmentConsolidatedByMainMall | BOOLEAN | 为 true 表示 PO 已由主站合并发货,需在主站侧确认发货/面单 |
| parentConfirmTime | INTEGER | Confirmation time of parent order in seconds (timestamp) |
parentOrderMap.parentOrderLabel[] — name 常见值
| name | 说明 |
|---|---|
soon_to_be_overdue | 即将逾期 |
past_due | 已逾期 |
pending_buyer_cancellation | 买家取消待处理 |
pending_buyer_address_change | 买家改地址待处理 |
pending_risk_control_alert | 风控预警待处理 |
signature_required_on_delivery | 需要签收 |
| 参数 | 类型 | 说明 |
|---|---|---|
| name | STRING | Label name |
| value | INTEGER | Whether the label exists:0 = no label,1 = label exists |
parentOrderMap.fulfillmentWarning[]
| 值 | 说明 |
|---|---|
SUGGEST_SIGNATURE_ON_DELIVERY | It is recommended to purchase signature service for this order to ensure fulfillment |
CONFIRMED_CHANGED_ADDRESS | Address has been changed and confirmed; pull the order again for the latest address |
RESTRICT_FEDEX_SELF_SHIPPING | Restricted from confirming shipment by FedEx tracking number |
RESTRICT_USPS_SELF_SHIPPING | Restricted from confirming shipment by USPS tracking number |
RESTRICT_SELF_SHIPPING | Restricted from confirming shipment by tracking number |
BLOCK_LOGISTICS_PROVIDERS_{Name1,Name2,...} | Consumer blocked some logistics providers (names in response) |
REQUIRES_CUSTOMER_PICKUP | This order can only be fulfilled via customer pickup |
orderList[]
| 参数 | 类型 | 说明 |
|---|---|---|
| orderSn | STRING | Order number (sub-order number)(子订单号) |
| quantity | INTEGER | The quantity seller needs to fulfill:quantity = originalOrderQuantity - canceledQuantityBeforeShipment |
| canceledQuantityBeforeShipment | INTEGER | The quantity of canceled before shipment |
| originalOrderQuantity | INTEGER | originalOrderQuantity |
| goodsId | LONG | Goods ID |
| packageSnInfo | OBJECT[] | package information(包裹信息) |
| packageAbnormalTypeList | STRING[] | Logistics anomalies after shipment,见下表 |
| skuId | LONG | Sku id;It is only valid for LOCAL sellers not SEMI sellers |
| spec | STRING | Product specification description for customer |
| originalSpecName | STRING | Product specification for seller;Only for orders whose confirmation time is within no more than six months |
| thumbUrl | STRING | Thumbnail image URL |
| goodsName | STRING | Product name for customer |
| originalGoodsName | STRING | Product name for seller;Only for orders whose confirmation time is within no more than six months |
| orderStatus | INTEGER | Status of the order:1 PENDING;2 UN_SHIPPING;3 CANCELED;4 SHIPPED;41 PARTIALLY_SHIPPED;5 DELIVERED;51 PARTIALLY_DELIVERED |
| productList | OBJECT[] | Product information;仅 SEMI 卖家有效,非 LOCAL |
| orderLabel | OBJECT[] | The label of order(子订单标签) |
| fulfillmentWarning | STRING[] | Fulfillment Prompt(子订单履约提示),见下表 |
| fulfillmentType | STRING | fulfillBySeller / fulfillByCooperativeWarehouse |
| inventoryDeductionWarehouseId | STRING | The id of inventory deduction warehouse |
| inventoryDeductionWarehouseName | STRING | The name of inventory deduction warehouse |
| orderPaymentType | STRING | Order payment type:COD、PPD |
| isCancelledDuringPending | BOOLEAN | Whether the order is completely cancelled during the pending period |
| earliestTimeBuyShippingLabel | INTEGER | Order can only buy shipping label after this time |
| earliestTimeGetShippingDocument | INTEGER | Order can only get shipping document after this time |
| orderShippingTime | INTEGER | Time when the order was shipped;若含未发货或延迟包裹,返回 null |
| isShipmentConsolidatedByMainMall | BOOLEAN | 主站合并发货标记 |
| orderCreateTime | INTEGER | The time when the order was created |
| qualificationUploadEndTime | LONG | Deadline for uploading order qualification documents |
| hasUploadedEvidence | BOOLEAN | Whether the merchant has uploaded verification information such as SN, IMEI, and appraisal report |
packageSnInfo[]
| 参数 | 类型 | 说明 |
|---|---|---|
| packageSn | STRING | package number of this order |
| packageDeliveryType | INTEGER | Package delivery type:1 Seller non-integrated;2 Seller Temu-integrated;3 Cooperative warehouse non-integrated;4 Cooperative warehouse Temu-integrated |
| callSuccess | BOOLEAN | Whether the latest request bg.logistics.shipment.create is successful;与 Temu 非集成物流无关 |
orderList[].packageAbnormalTypeList[]
| 值 | 说明 |
|---|---|
WRONG_SHIPPING_ADDRESS | Wrong shipping address |
SUSPECTED_ERROR_PROVIDER | Suspected error provider |
NO_TRACK | No track |
TRACK_TOO_EARLY | Track too early |
OVERTIME_COLLECTION | Overtime collection |
TRACK_COLLECT_FAIL | Track collect fail |
SIGNED_BUT_UNRECEIVED_TASK | Signed but unreceived task |
productList[]
| 参数 | 类型 | 说明 |
|---|---|---|
| productId | LONG | Product Id |
| productSkuId | LONG | Product sku id;It is only valid for SEMI sellers not LOCAL sellers |
| soldFactor | LONG | Conversion factor between product quantity and item quantity |
| extCode | STRING | Item code |
orderList[].orderLabel[] — name 常见值
customized_products、US_to_CA、is_US_to_CA_BBC、Y2_advance_sale、pre_sale_order、made_to_order、vacation_order、second_hand_collectible_order、second_hand_luxury_order
| 参数 | 类型 | 说明 |
|---|---|---|
| name | STRING | Label name |
| value | INTEGER | Is there a label:0 = no label,1 = labeled;BBC orders need to judge combined with is_US_to_CA_BBC |
orderList[].fulfillmentWarning[]
| 值 | 说明 |
|---|---|
SAVE_SN_INFORMATION_FOR_RETURN | It is recommended to save sn information for this order to identify the authenticity of the returned goods |
REQUIRES_AUTHENTICATION_REPORT_SUBMISSION | Requires submission of an authentication report in Temu Seller Center;超时自动取消并可能处罚 |
REQUIRES_AGE_VERIFICATION | It is recommended to purchase the age verification service for the signatory |
SPECIFIC_LOGISTICS_REQUIRED | It is required to choose specific logistics to fulfill this order |
REQUIRES_CUSTOMER_PICKUP | This order can only be fulfilled via customer pickup |
---
示例
python scripts/eu_order_detail_v2_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}'可先通过 bg.order.list.v2.get 获取 parentOrderSn,再调用本接口拉取完整详情。
订单列表查询 V2 — bg.order.list.v2.get
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_list_v2_get.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9(按 type 在 Partner EU 后台打开) |
| 网关 | POST /temu/proxy,type=bg.order.list.v2.get,业务载荷放在 Body 的 params |
Description: The bg.order.list.v2.get interface is designed to support batch return of corresponding order lists based on filtering criteria(按筛选条件批量返回订单列表)。
网关鉴权字段由本 skill 网关脚本处理;业务参数见下方 request。建议使用 `tokenPurpose=order-shipping`。---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
├── pageNumber
├── pageSize
├── parentOrderStatus
├── parentOrderSnList[]
├── createAfter / createBefore
├── expectShipLatestTimeStart / expectShipLatestTimeEnd
├── updateAtStart / updateAtEnd
├── parentConfirmTimeStart / parentConfirmTimeEnd
├── regionId
├── fulfillmentTypeList[]
├── parentOrderLabel[]
├── packageAbnormalTypeList[]
├── sortby
├── hasPreSaleOrder
├── hasQualificationRequiredOrder
└── skuIdrequest 内字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pageNumber | INTEGER | 否 | Page number for pagination(页码),默认 1 |
| pageSize | INTEGER | 否 | Page size for pagination(每页条数),默认 10,最大 100 |
| parentOrderStatus | INTEGER | 否 | Parent order status(父订单状态);默认查询全部 |
| parentOrderSnList | STRING[] | 否 | List of parent order numbers(父订单号列表),单次最多 20 条 |
| createAfter | INTEGER | 否 | Start time for querying parent order creation, in seconds (timestamp);须与 `createBefore` 成对使用 |
| createBefore | INTEGER | 否 | End time for querying parent order creation, in seconds (timestamp),闭区间;须与 `createAfter` 成对使用 |
| expectShipLatestTimeStart | INTEGER | 否 | Start time for querying expected latest shipment, in seconds |
| expectShipLatestTimeEnd | INTEGER | 否 | End time for querying expected latest shipment, in seconds |
| updateAtStart | INTEGER | 否 | Start time for querying order update / status change, in seconds (timestamp);须与 `updateAtEnd` 成对使用 |
| updateAtEnd | INTEGER | 否 | End time for querying order update / status change, in seconds (timestamp),闭区间;须与 `updateAtStart` 成对使用 |
| parentConfirmTimeStart | INTEGER | 否 | 父订单确认开始时间(秒级时间戳);须与 `parentConfirmTimeEnd` 成对使用 |
| parentConfirmTimeEnd | INTEGER | 否 | 父订单确认结束时间(秒级时间戳);须与 `parentConfirmTimeStart` 成对使用 |
| regionId | LONG | 否 | Region ID(区域 ID),例如 USA - 211 |
| fulfillmentTypeList | STRING[] | 否 | 订单履约类型列表,见下表 |
| parentOrderLabel | STRING[] | 否 | PO 订单状态标签筛选,见下表 |
| packageAbnormalTypeList | STRING[] | 否 | 发货后物流异常类型筛选,见下表 |
| sortby | STRING | 否 | Sort by(排序字段),默认按订单创建时间;输出为倒序 |
| hasPreSaleOrder | BOOLEAN | 否 | Whether the parent order contains presale orders for inventory in transit(父订单是否含在途预售子单) |
| hasQualificationRequiredOrder | BOOLEAN | 否 | Whether the parent order contains orders that require qualification upload(是否含需上传资质子单) |
| skuId | LONG | 否 | SKU ID |
parentOrderStatus(入参筛选)
| 值 | 说明 |
|---|---|
0 | All(全部) |
1 | PENDING(待处理) |
2 | UN_SHIPPING(待发货) |
3 | CANCELED(已取消) |
4 | SHIPPED(已发货) |
5 | RECEIPTED(已签收) |
41 | Partially shipped(部分发货,仅 local mall) |
51 | Partially received(部分签收,仅 local mall) |
fulfillmentTypeList[]
| 值 | 说明 |
|---|---|
fulfillBySeller | fulfill by seller(卖家履约) |
fulfillByCooperativeWarehouse | fulfill by Cooperative Warehouse(合作仓履约) |
parentOrderLabel[](筛选)
| 值 | 说明 |
|---|---|
soon_to_be_overdue | 即将逾期 |
past_due | 已逾期 |
pending_buyer_cancellation | 买家待取消 |
pending_buyer_address_change | 买家待改地址 |
pending_risk_control_alert | 风控预警待处理 |
signature_required_on_delivery | 签收需签名 |
packageAbnormalTypeList[](筛选)
| 值 | 说明 |
|---|---|
WRONG_SHIPPING_ADDRESS | 收货地址错误 |
SUSPECTED_ERROR_PROVIDER | 疑似承运商异常 |
NO_TRACK | 无轨迹 |
TRACK_TOO_EARLY | 轨迹过早 |
OVERTIME_COLLECTION | 揽收超时 |
TRACK_COLLECT_FAIL | 揽收失败 |
sortby
| 值 | 说明 |
|---|---|
createTime | 按创建时间排序(默认) |
updateTime | 按更新时间排序 |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"pageNumber": 1,
"pageSize": 20,
"parentOrderStatus": 2
}
}{
"accessToken": "TOKEN",
"request": {
"parentOrderSnList": ["PO-123456789"],
"createAfter": 1700000000,
"createBefore": 1700086400,
"sortby": "updateTime"
}
}---
Response(Temu body 解析后)
response
├── success
├── errorCode
├── errorMsg
└── result
├── pageItems[]
│ ├── parentOrderMap
│ │ ├── parentOrderSn
│ │ ├── parentOrderStatus
│ │ ├── parentOrderTime
│ │ ├── expectShipLatestTime
│ │ ├── parentOrderPendingFinishTime
│ │ ├── latestDeliveryTime
│ │ ├── parentShippingTime
│ │ ├── siteId
│ │ ├── regionId
│ │ ├── parentOrderLabel[]
│ │ │ ├── name
│ │ │ └── value
│ │ ├── fulfillmentWarning[]
│ │ ├── hasShippingFee
│ │ ├── updateTime
│ │ ├── orderPaymentType
│ │ ├── batchOrderNumberList[]
│ │ ├── shippingMethod
│ │ ├── isShipmentConsolidatedByMainMall
│ │ └── parentConfirmTime
│ └── orderList[]
│ ├── orderSn
│ ├── quantity
│ ├── canceledQuantityBeforeShipment
│ ├── originalOrderQuantity
│ ├── goodsId
│ ├── skuId
│ ├── spec
│ ├── originalSpecName
│ ├── thumbUrl
│ ├── goodsName
│ ├── originalGoodsName
│ ├── orderStatus
│ ├── productList[]
│ │ ├── productId
│ │ ├── productSkuId
│ │ ├── soldFactor
│ │ └── extCode
│ ├── packageAbnormalTypeList[]
│ ├── orderLabel[]
│ │ ├── name
│ │ └── value
│ ├── fulfillmentWarning[]
│ ├── fulfillmentType
│ ├── inventoryDeductionWarehouseId
│ ├── inventoryDeductionWarehouseName
│ ├── orderPaymentType
│ ├── isCancelledDuringPending
│ ├── earliestTimeBuyShippingLabel
│ ├── earliestTimeGetShippingDocument
│ ├── orderShippingTime
│ ├── isShipmentConsolidatedByMainMall
│ ├── orderCreateTime
│ └── qualificationUploadEndTime
└── totalItemNumresponse 顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success(当前请求是否成功) |
| errorCode | INTEGER | error code(错误码) |
| errorMsg | STRING | error message(错误信息) |
| result | OBJECT | 业务结果 |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| pageItems | OBJECT[] | Page items(分页订单条目) |
| totalItemNum | INTEGER | Total number of matching records(匹配记录总数) |
result.pageItems[]
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderMap | OBJECT | Parent order information(父订单信息) |
| orderList | OBJECT[] | Order information(子订单列表) |
parentOrderMap
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderSn | STRING | Parent order number(父订单号) |
| parentOrderStatus | INTEGER | Status of the parent order,见下表(出参枚举) |
| parentOrderTime | INTEGER | Time when the parent order was placed(下单时间,秒) |
| expectShipLatestTime | INTEGER | Latest shipment time(最晚发货时间,秒) |
| parentOrderPendingFinishTime | INTEGER | Time when the parent order finish pending(待处理完成时间,秒) |
| latestDeliveryTime | INTEGER | Latest delivery time(最晚送达时间,秒) |
| parentShippingTime | INTEGER | Time when the parent order was shipped(父订单发货时间,秒) |
| siteId | LONG | Site ID |
| regionId | LONG | Region ID,例如 USA - 211 |
| parentOrderLabel | OBJECT[] | List of PO order status labels(父订单标签列表) |
| fulfillmentWarning | STRING[] | Fulfillment Prompt(履约提示),见下表 |
| hasShippingFee | BOOLEAN | 用户实付运费是否为零:true 为零,false 非零(仅 local mall) |
| updateTime | LONG | Order update time, in seconds(订单更新时间,秒) |
| orderPaymentType | STRING | Order payment type:COD、PPD |
| batchOrderNumberList | STRING[] | 批次单号列表;仅合作仓履约有值,否则为空 |
| shippingMethod | INTEGER | delivery channel type:1 Standard Shipping,2 Store Delivery,3 Customer Pickup |
| isShipmentConsolidatedByMainMall | BOOLEAN | 为 true 表示主站已合并发货,需在主站侧确认发货/面单 |
| parentConfirmTime | INTEGER | Confirmation time of parent order, in seconds (timestamp) |
parentOrderStatus(出参)
| 值 | 说明 |
|---|---|
1 | PENDING |
2 | UN_SHIPPING |
3 | CANCELED |
4 | SHIPPED |
41 | PARTIALLY_SHIPPED |
5 | DELIVERED |
51 | PARTIALLY_DELIVERED |
parentOrderMap.parentOrderLabel[]
| 参数 | 类型 | 说明 |
|---|---|---|
| name | STRING | Label name(标签名) |
| value | INTEGER | Whether the label exists:0 无标签,1 有标签 |
parentOrderMap.fulfillmentWarning[](父订单)
| 值 | 说明 |
|---|---|
SUGGEST_SIGNATURE_ON_DELIVERY | 建议购买签收服务 |
CONFIRMED_CHANGED_ADDRESS | 地址已变更并确认,建议重新拉单获取最新地址 |
RESTRICT_FEDEX_SELF_SHIPPING | 限制使用 FedEx 运单号确认发货 |
RESTRICT_USPS_SELF_SHIPPING | 限制使用 USPS 运单号确认发货 |
RESTRICT_SELF_SHIPPING | 限制使用运单号确认发货 |
BLOCK_LOGISTICS_PROVIDERS_{Name1,Name2,...} | 买家屏蔽部分物流商(名称在响应中展开) |
REQUIRES_CUSTOMER_PICKUP | 仅支持买家自提履约 |
orderList[]
| 参数 | 类型 | 说明 |
|---|---|---|
| orderSn | STRING | Order number (sub-order number)(子订单号) |
| quantity | INTEGER | 卖家需履约数量:quantity = originalOrderQuantity - canceledQuantityBeforeShipment |
| canceledQuantityBeforeShipment | INTEGER | 发货前取消数量 |
| originalOrderQuantity | INTEGER | 原始下单数量 |
| goodsId | LONG | Goods ID |
| skuId | LONG | Sku id;仅 LOCAL 卖家有效,非 SEMI |
| spec | STRING | Product specification description for customer(买家可见规格描述) |
| originalSpecName | STRING | Product specification for seller;确认时间在近 6 个月内的订单建议填写 |
| thumbUrl | STRING | Thumbnail image URL |
| goodsName | STRING | Product name for customer |
| originalGoodsName | STRING | Product name for seller;确认时间在近 6 个月内的订单建议填写 |
| orderStatus | INTEGER | Status of the order:1 PENDING;2 UN_SHIPPING;3 CANCELED;4 SHIPPED;41 PARTIALLY_SHIPPED;5 DELIVERED;51 PARTIALLY_DELIVERED |
| productList | OBJECT[] | Product SKU info;仅 SEMI 卖家有效,非 LOCAL |
| packageAbnormalTypeList | STRING[] | 发货后物流异常类型,见下表(含 SIGNED_BUT_UNRECEIVED_TASK) |
| orderLabel | OBJECT[] | The label of order(子订单标签) |
| fulfillmentWarning | STRING[] | Fulfillment Prompt(子订单履约提示),见下表 |
| fulfillmentType | STRING | fulfillBySeller / fulfillByCooperativeWarehouse |
| inventoryDeductionWarehouseId | STRING | The id of inventory deduction warehouse |
| inventoryDeductionWarehouseName | STRING | The name of inventory deduction warehouse |
| orderPaymentType | STRING | COD、PPD |
| isCancelledDuringPending | BOOLEAN | Whether the order is completely cancelled during the pending period |
| earliestTimeBuyShippingLabel | INTEGER | Order can only buy shipping label after this time |
| earliestTimeGetShippingDocument | INTEGER | Order can only get shipping document after this time |
| orderShippingTime | INTEGER | Time when the order was shipped;含未发货/延迟包裹时可能为 null |
| isShipmentConsolidatedByMainMall | BOOLEAN | 主站合并发货标记,同 parentOrderMap |
| orderCreateTime | INTEGER | The time when the order was created |
| qualificationUploadEndTime | LONG | Deadline for uploading order qualification documents |
productList[]
| 参数 | 类型 | 说明 |
|---|---|---|
| productId | LONG | productId |
| productSkuId | LONG | SKU ID of the product variation |
| soldFactor | LONG | 商品数量与件数换算因子 |
| extCode | STRING | Item code |
orderList[].packageAbnormalTypeList[](出参,比入参多一项)
| 值 | 说明 |
|---|---|
WRONG_SHIPPING_ADDRESS | 收货地址错误 |
SUSPECTED_ERROR_PROVIDER | 疑似承运商异常 |
NO_TRACK | 无轨迹 |
TRACK_TOO_EARLY | 轨迹过早 |
OVERTIME_COLLECTION | 揽收超时 |
TRACK_COLLECT_FAIL | 揽收失败 |
SIGNED_BUT_UNRECEIVED_TASK | 已签收但未收货任务 |
orderList[].orderLabel[]
| 参数 | 类型 | 说明 |
|---|---|---|
| name | STRING | Label name,如 customized_products、pre_sale_order、made_to_order 等 |
| value | INTEGER | 0 无标签,1 有标签;BBC 订单需结合 is_US_to_CA_BBC 判断 |
orderList[].fulfillmentWarning[]
| 值 | 说明 |
|---|---|
SAVE_SN_INFORMATION_FOR_RETURN | 建议保存 SN 便于退货鉴真 |
REQUIRES_AUTHENTICATION_REPORT_SUBMISSION | 须在卖家中心提交鉴定报告,超时自动取消并可能处罚 |
REQUIRES_AGE_VERIFICATION | 建议购买签收人年龄验证服务 |
SPECIFIC_LOGISTICS_REQUIRED | 须选择指定物流履约 |
REQUIRES_CUSTOMER_PICKUP | 仅支持买家自提 |
---
示例
python scripts/eu_order_list_v2_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"pageNumber": 1,
"pageSize": 20,
"parentOrderStatus": 2
}
}'订单收货地址查询 V2 — bg.order.shippinginfo.v2.get
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_shippinginfo_v2_get.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9(按 type 在 Partner EU 后台打开) |
| 网关 | POST /temu/proxy,type=bg.order.shippinginfo.v2.get,业务载荷放在 Body 的 params |
Description: The bg.order.shippinginfo.v2.get interface is designed to retrieve shipping address information for a specific order. This functionality is crucial for merchants and logistics providers to ensure that orders are shipped to the correct location.
网关鉴权字段由本 skill 网关脚本处理;业务参数见下方 request。建议使用 `tokenPurpose=order-shipping`。---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
└── parentOrderSn (STRING, 否)request
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| parentOrderSn | STRING | 否 | parentOrderSn(父订单号);查询指定订单收货地址时应传入 |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}---
Response(Temu body 解析后)
response
├── success
├── errorCode
├── errorMsg
└── result
├── receiptName
├── receiptAdditionalName
├── mobile
├── backupMobile
├── mail
├── regionName1
├── regionName2
├── regionName3
├── regionName4
├── addressLine1
├── addressLine2
├── addressLine3
├── postCode
├── addressLineAll
├── addressExtra
│ ├── firstName
│ ├── lastName
│ ├── additionalFirstName
│ └── additionalLastName
└── warning
├── isRestriction
└── reasonresponse 顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT | 收货地址等业务结果 |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| receiptName | STRING | Name(收件人姓名) |
| receiptAdditionalName | STRING | Additional Name(附加姓名) |
| mobile | STRING | Phone Number(手机号) |
| backupMobile | STRING | Alternate Phone(备用电话) |
| STRING | Virtual Email(虚拟邮箱) | |
| regionName1 | STRING | First-Level Administrative Division Name(一级行政区名称) |
| regionName2 | STRING | Secondary Administrative Division Name(二级行政区名称) |
| regionName3 | STRING | Third-Level Administrative Division Name(三级行政区名称) |
| regionName4 | STRING | Fourth-Level Administrative Division Name(四级行政区名称) |
| addressLine1 | STRING | Address Line 1(地址行 1) |
| addressLine2 | STRING | Address Line 2(地址行 2) |
| addressLine3 | STRING | Address Line 3(地址行 3) |
| postCode | STRING | Postal Code(邮编) |
| addressLineAll | STRING | Address Line 1 + Line 2 + Line 3(拼接完整地址行) |
| addressExtra | OBJECT | addressExtra(姓名拆分等扩展信息) |
| warning | OBJECT | warning information(地址/履约限制提示) |
addressExtra
| 参数 | 类型 | 说明 |
|---|---|---|
| firstName | STRING | First Name |
| lastName | STRING | Last Name |
| additionalFirstName | STRING | Additional First Name |
| additionalLastName | STRING | Additional Last Name |
warning
| 参数 | 类型 | 说明 |
|---|---|---|
| isRestriction | BOOLEAN | isRestriction(是否存在地址返回限制) |
| reason | INTEGER | When there is an address return restriction, it indicates the restriction scenario |
warning.reason 枚举
| 值 | 说明 |
|---|---|
1 | COD |
2 | Restricting self shipment(限制自发货) |
3 | Promise only buy shipping(仅承诺购买平台物流) |
---
示例
python scripts/eu_order_shippinginfo_v2_get.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"parentOrderSn": "PO-123456789"
}
}'发货前典型流程:bg.order.list.v2.get / bg.order.detail.v2.get 取得 parentOrderSn → 本接口拉收货地址 → 后续发货/面单接口(待接入)。
Order — 接口文档索引
每个 type 单独一份文档,经 POST /temu/proxy 调用。网关与鉴权见 ../api.md;目录与 sub_menu_code 见 ../partner-eu-catalog.md。
查询(4)
| type | 文档 |
|---|---|
bg.order.list.v2.get | bg-order-list-v2-get.md |
bg.order.detail.v2.get | bg-order-detail-v2-get.md |
bg.order.shippinginfo.v2.get | bg-order-shippinginfo-v2-get.md |
bg.order.decryptshippinginfo.get | bg-order-decryptshippinginfo-get.md |
金额 / ERP(3)
| type | 文档 |
|---|---|
bg.order.amount.query | bg-order-amount-query.md |
temu.order.amount.v2.query | temu-order-amount-v2-query.md |
temu.order.amount.v3.query | temu-order-amount-v3-query.md |
发货 / 物流(1)
| type | 文档 |
|---|---|
bg.order.combinedshipment.list.get | bg-order-combinedshipment-list-get.md |
定制商品(1)
| type | 文档 |
|---|---|
bg.order.customization.get | bg-order-customization-get.md |
核验 / 鉴真上传(1)
| type | 文档 |
|---|---|
temu.local.order.verification.upload | temu-local-order-verification-upload.md |
发货 / 物流(待补充)
| type | 文档 |
|---|---|
| _待用户提供 Partner 文档_ | — |
其他(待补充)
| type | 文档 |
|---|---|
| _待用户提供 Partner 文档_ | — |
订单核验信息上传 — temu.local.order.verification.upload
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_verification_upload.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9(按 type 在 Partner EU 后台打开) |
| 网关 | POST /temu/proxy,type=temu.local.order.verification.upload,业务载荷放在 Body 的 params |
Description: The interface supports uploading serial numbers (SN) / International Mobile Equipment Identity (IMEI) of high-value goods, or authentication information for second-hand goods(支持上传高价值商品的序列号 SN / IMEI,或二手商品的鉴真/认证信息)。
网关鉴权字段由本 skill 网关脚本处理;业务参数见下方 request。建议使用 `tokenPurpose=order-shipping`。入参为子订单号orderSn(可从bg.order.detail.v2.get等接口的orderList[].orderSn取得)。
---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
└── orderList[] (OBJECT[], 选填)
├── orderSn
├── verificationInfo[]
│ ├── serialNumber
│ └── imeiNumberList[]
└── secondHandVerificationInfo[]
└── secondHandProofCertificateCoderequest 内字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| orderList | OBJECT[] | 否 | order unique info list(订单唯一标识/核验信息列表);按子订单维度批量上传 |
orderList[] 元素
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| orderSn | STRING | 否 | order sn(子订单号) |
| verificationInfo | OBJECT[] | 否 | electronic ams open unique info list(高价值/电子产品唯一标识列表,如 SN、IMEI) |
| secondHandVerificationInfo | OBJECT[] | 否 | second hand ams open verification info(二手商品鉴真/认证信息列表) |
verificationInfo[] 元素
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| serialNumber | STRING | 否 | serial number(序列号 SN) |
| imeiNumberList | STRING[] | 否 | imei number list(IMEI 号码列表) |
高价值商品场景:按实际商品要求填写serialNumber和/或imeiNumberList;同一orderSn可包含多条verificationInfo(例如多件商品各一条 SN)。
secondHandVerificationInfo[] 元素
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| secondHandProofCertificateCode | STRING | 否 | second hand proof certificate code(二手商品鉴真/证明证书编码) |
二手商品场景:填写secondHandProofCertificateCode;与高价值verificationInfo按订单实际类型择一或组合使用(以 Partner 与订单标签为准)。
网关 params 写法
高价值商品(SN + IMEI):
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"orderList": [
{
"orderSn": "SO-123456789",
"verificationInfo": [
{
"serialNumber": "SN-001234567890",
"imeiNumberList": ["352099001761481", "352099001761482"]
}
]
}
]
}
}二手商品(鉴真编码):
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"orderList": [
{
"orderSn": "SO-987654321",
"secondHandVerificationInfo": [
{
"secondHandProofCertificateCode": "CERT-CODE-EXAMPLE"
}
]
}
]
}
}---
Response(Temu body 解析后)
response
├── success
├── errorCode
├── errorMsg
└── result (OBJECT)response 顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT | 业务结果对象;官方出参表未展开子字段,上传成功时通常以 success=true 为准,具体以 Temu 实际返回为准 |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| _(无子字段)_ | — | Partner 文档未列出 result 内嵌套属性;若响应体含其它字段,以实际 JSON 为准 |
---
示例
python scripts/eu_order_verification_upload.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"request": {
"orderList": [
{
"orderSn": "SO-123456789",
"verificationInfo": [
{
"serialNumber": "SN-001234567890",
"imeiNumberList": ["352099001761481"]
}
]
}
]
}
}'典型流程:订单详情确认需上传 SN/IMEI 或二手鉴真 → 本接口上传 → 再执行发货相关接口。订单若带 REQUIRES_AUTHENTICATION_REPORT_SUBMISSION 等履约提示,以 bg.order.list.v2.get / bg.order.detail.v2.get 返回的 fulfillmentWarning 为准。
订单金额查询 V2 — temu.order.amount.v2.query
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_amount_v2_query.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9&sub_menu_code=91661bf0642440ddbd462b25fa96edfb |
| 网关 | POST /temu/proxy,type=temu.order.amount.v2.query,业务载荷放在 Body 的 params |
Description: Query order amount information (V2) with detailed tax-exclusive / tax-inclusive breakdown at parent and sub-order level(订单金额查询 V2:父单与子单维度提供更细的税费拆分字段)。
与 V1 区别: 旧版 `bg.order.amount.query`(bg.order.amount.query)字段结构较简;V2 使用 `salesProceeds` / `customerPaid` 分组及更多TaxExcl/TaxIncl明细。欧洲站含税价场景可对照 `temu.order.amount.v3.query`。
网关鉴权字段由本 skill 处理;业务参数见下方 `request`。建议使用 `tokenPurpose=order-shipping`,`site=eu`。
---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
└── parentOrderSn (STRING, 必填)request 内字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| parentOrderSn | STRING | 是 | Parent order number(父订单号) |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"site": "eu",
"request": {
"parentOrderSn": "PO-123456789"
}
}---
Response(Temu body 解析后)
Partner Response 嵌套子行在导出 HTML 中为折叠状态,下列层级按 Response 表 + Response Example 全部展开。
response
├── success
├── errorCode
├── errorMsg
└── result
├── parentOrderMap (OBJECT)
│ ├── parentOrderSn (STRING)
│ ├── salesProceeds (OBJECT)
│ │ └── …(各金额字段均为 MoneyAmount:currency + amount)
│ └── customerPaid (OBJECT)
│ └── …(各金额字段均为 MoneyAmount)
├── orderList[] (OBJECT[])
│ ├── orderSn, quantity, productTaxRate, shipTaxRate
│ └── …(各金额字段均为 MoneyAmount)
└── warning[] (STRING[])顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT | Order amount result(V2) |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderMap | OBJECT | Parent order amount summary(父订单金额汇总,含 salesProceeds 与 customerPaid) |
| orderList | OBJECT[] | Sub-order amount details(子订单金额明细列表) |
| warning | STRING[] | Warning messages(告警信息,如部分金额仍在系统计算中) |
parentOrderMap
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderSn | STRING | Parent order number(父订单号) |
| salesProceeds | OBJECT | Seller sales proceeds breakdown(卖家侧销售收入/结算相关金额) |
| customerPaid | OBJECT | Customer paid amount breakdown(消费者支付相关金额) |
parentOrderMap.salesProceeds
| 参数 | 类型 | 说明 |
|---|---|---|
| productTax | MoneyAmount | Product tax(商品税) |
| productTaxCustomerDiscounted | MoneyAmount | Product tax after customer discount |
| shippingTaxCustomerDiscounted | MoneyAmount | Shipping tax after customer discount |
| basePriceSellerDiscount | MoneyAmount | Base price seller discount(卖家基础价折扣) |
| shippingTotalTaxExcl | MoneyAmount | Shipping total tax exclusive(运费合计,不含税) |
| basePriceOff | MoneyAmount | Base price off(基础价减免) |
| basePriceDiscountedTotal | MoneyAmount | Base price discounted total(折后基础价合计) |
| estimatedSettlementTotal | MoneyAmount | Estimated settlement total(预估结算合计) |
| shippingTax | MoneyAmount | Shipping tax |
| productTaxTemu | MoneyAmount | Product tax (Temu portion) |
| shippingTaxTemu | MoneyAmount | Shipping tax (Temu portion) |
| shippingCustomerTotalTaxExcl | MoneyAmount | Customer shipping total tax exclusive |
| estimatedDeduction | MoneyAmount | Estimated deduction(预估扣减) |
| basePriceTotal | MoneyAmount | Base price total(基础价/供货价合计) |
| shippingTemuDiscountTotalTaxExcl | MoneyAmount | Temu shipping discount total tax exclusive |
parentOrderMap.customerPaid
| 参数 | 类型 | 说明 |
|---|---|---|
| retailPriceDiscountedTotalTaxExcl | MoneyAmount | Retail price discounted total tax exclusive |
| productRefundsTotal | MoneyAmount | Product refunds total(商品退款合计) |
| retailPriceTemuDiscountTaxExcl | MoneyAmount | Retail price Temu discount tax exclusive |
| retailPriceSellerDiscountTaxExcl | MoneyAmount | Retail price seller discount tax exclusive |
| retailPriceTotalTaxIncl | MoneyAmount | Retail price total tax inclusive |
| shippingDiscountedTotalTaxExcl | MoneyAmount | Shipping discounted total tax exclusive |
| shippingTotalTaxExcl | MoneyAmount | Shipping total tax exclusive |
| shippingTaxTemuDiscount | MoneyAmount | Shipping tax Temu discount |
| shippingTax | MoneyAmount | Shipping tax |
| customerPaidTotal | MoneyAmount | Customer paid total(消费者实付合计) |
| retailPriceTotalTaxExcl | MoneyAmount | Retail price total tax exclusive |
| shippingTaxDiscounted | MoneyAmount | Shipping tax discounted |
| productTaxDiscounted | MoneyAmount | Product tax discounted |
| shippingTemuDiscountTotalTaxExcl | MoneyAmount | Temu shipping discount total tax exclusive |
| shippingTotalTaxIncl | MoneyAmount | Shipping total tax inclusive |
orderList[]
| 参数 | 类型 | 说明 |
|---|---|---|
| orderSn | STRING | Order number (sub-order)(子订单号) |
| quantity | INTEGER | Quantity(数量) |
| productTaxRate | INTEGER/NUMBER | Product tax rate(商品税率,Example 为数值) |
| shipTaxRate | INTEGER/NUMBER | Shipping tax rate(运费税率) |
| productTax | MoneyAmount | Product tax |
| productTaxCustomerDiscounted | MoneyAmount | Product tax customer discounted |
| shippingTaxCustomerDiscounted | MoneyAmount | Shipping tax customer discounted |
| retailPriceTotalTaxIncl | MoneyAmount | Retail price total tax inclusive |
| basePriceSellerDiscount | MoneyAmount | Base price seller discount |
| shippingTotalTaxExcl | MoneyAmount | Shipping total tax exclusive |
| basePriceOff | MoneyAmount | Base price off |
| estimatedSettlementTotal | MoneyAmount | Estimated settlement total |
| shippingTax | MoneyAmount | Shipping tax |
| productTaxTemu | MoneyAmount | Product tax Temu |
| shippingCustomerTotalTaxExcl | MoneyAmount | Shipping customer total tax exclusive |
| unitRetailPriceTaxExcl | MoneyAmount | Unit retail price tax exclusive |
| shippingTemuDiscountTotalTaxExcl | MoneyAmount | Shipping Temu discount total tax exclusive |
| shippingTotalTaxIncl | MoneyAmount | Shipping total tax inclusive |
| retailPriceDiscountedTotalTaxExcl | MoneyAmount | Retail price discounted total tax exclusive |
| retailPriceTemuDiscountTaxExcl | MoneyAmount | Retail price Temu discount tax exclusive |
| unitRetailPriceTaxIncl | MoneyAmount | Unit retail price tax inclusive |
| basePriceDiscountedTotal | MoneyAmount | Base price discounted total |
| unitBasePrice | MoneyAmount | Unit base price |
| shippingTaxTemu | MoneyAmount | Shipping tax Temu |
| retailPriceTotalTaxExcl | MoneyAmount | Retail price total tax exclusive |
| estimatedDeduction | MoneyAmount | Estimated deduction |
| basePriceTotal | MoneyAmount | Base price total |
---
金额块(MoneyAmount)
除 `quantity`、`productTaxRate`、`shipTaxRate`、`orderSn`、`parentOrderSn`、`warning` 外,上表中标为 MoneyAmount 的字段均为 OBJECT:
| 参数 | 类型 | 说明 |
|---|---|---|
| currency | STRING | Currency code(币种) |
| amount | LONG | Amount in local minimum currency unit(本地货币最小单位,如欧区常为分) |
---
Error Code(Partner 表)
| errorCode | errorMsg | Error SOP / 处理建议 |
|---|---|---|
| 140020015 | This API is not applicable to the country or region where the current store is located. | 确认店铺区域与 site=eu;换适用接口或站点 |
| 140020002 | Order not found | 核对 parentOrderSn |
| 140020008 | Some amount fields are still undergoing system calculation. Please try again later. | 稍后重试;关注 result.warning |
---
脚本
export LINKFOXAGENT_API_KEY="<key>"
python scripts/eu_order_amount_v2_query.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"site": "eu",
"request": {
"parentOrderSn": "PO-123456789"
}
}'典型流程: bg.order.list.v2.get 取得 `parentOrderSn` → 本接口拉 V2 金额明细 → ERP 与 orderList[].orderSn 对账。
订单金额查询 V3 — temu.order.amount.v3.query
| 项 | 值 |
|---|---|
| 脚本 | scripts/eu_order_amount_v3_query.py |
| Partner 文档 | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9&sub_menu_code=3ffe9c4c79b9418285eb7ec09cf7b329 |
| 网关 | POST /temu/proxy,type=temu.order.amount.v3.query,业务载荷放在 Body 的 params |
Description: Query order amount information (V3) with tax-inclusive oriented amount fields(订单金额查询 V3:字段以含税价 TaxIncl 为主,结构相对 V2 精简)。
与 V2 区别: `temu.order.amount.v2.query` 提供更细的税费拆分(含大量 TaxExcl 字段);V3 侧重 `TaxIncl` 汇总字段。按店铺所在国/区域与 Partner 指引选择版本。网关鉴权字段由本 skill 处理;建议使用 `tokenPurpose=order-shipping`,`site=eu`。
---
Request 结构(官方业务参数)
params
└── request (OBJECT, 选填)
└── parentOrderSn (STRING, 必填)request 内字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| parentOrderSn | STRING | 是 | Parent order number(父订单号) |
网关 params 写法
{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"site": "eu",
"request": {
"parentOrderSn": "PO-123456789"
}
}---
Response(Temu body 解析后)
response
├── success / errorCode / errorMsg
└── result
├── parentOrderMap (OBJECT)
│ ├── parentOrderSn (STRING)
│ ├── salesProceeds (OBJECT) → MoneyAmount 字段
│ └── customerPaid (OBJECT) → MoneyAmount 字段
├── orderList[] (OBJECT[])
└── warning[] (STRING[])顶层字段
| 参数 | 类型 | 说明 |
|---|---|---|
| success | BOOLEAN | success |
| errorCode | INTEGER | error code |
| errorMsg | STRING | error message |
| result | OBJECT | Order amount result(V3) |
result
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderMap | OBJECT | Parent order amount summary |
| orderList | OBJECT[] | Sub-order amount details |
| warning | STRING[] | Warning messages |
parentOrderMap
| 参数 | 类型 | 说明 |
|---|---|---|
| parentOrderSn | STRING | Parent order number |
| salesProceeds | OBJECT | Seller sales proceeds(卖家侧金额) |
| customerPaid | OBJECT | Customer paid breakdown(消费者支付金额) |
parentOrderMap.salesProceeds
| 参数 | 类型 | 说明 |
|---|---|---|
| basePriceDiscountedTotal | MoneyAmount | Base price discounted total |
| estimatedSettlementTotal | MoneyAmount | Estimated settlement total |
| basePriceSellerDiscount | MoneyAmount | Base price seller discount |
| shippingCustomerTotalTaxIncl | MoneyAmount | Customer shipping total tax inclusive |
| shippingTemuDiscountTotalTaxIncl | MoneyAmount | Temu shipping discount total tax inclusive |
| estimatedDeduction | MoneyAmount | Estimated deduction |
| basePriceOff | MoneyAmount | Base price off |
| basePriceTotal | MoneyAmount | Base price total |
| shippingTotalTaxIncl | MoneyAmount | Shipping total tax inclusive |
parentOrderMap.customerPaid
| 参数 | 类型 | 说明 |
|---|---|---|
| retailPriceDiscountedTotalTaxIncl | MoneyAmount | Retail price discounted total tax inclusive |
| productRefundsTotal | MoneyAmount | Product refunds total |
| customerPaidTotal | MoneyAmount | Customer paid total |
| retailPriceTotalTaxIncl | MoneyAmount | Retail price total tax inclusive |
| retailPriceSellerDiscountTaxIncl | MoneyAmount | Retail price seller discount tax inclusive |
| shippingDiscountedTotalTaxIncl | MoneyAmount | Shipping discounted total tax inclusive |
| shippingTemuDiscountTotalTaxIncl | MoneyAmount | Temu shipping discount total tax inclusive |
| retailPriceTemuDiscountTaxIncl | MoneyAmount | Retail price Temu discount tax inclusive |
| shippingTotalTaxIncl | MoneyAmount | Shipping total tax inclusive |
orderList[]
| 参数 | 类型 | 说明 |
|---|---|---|
| orderSn | STRING | Sub-order number |
| quantity | INTEGER | Quantity |
| retailPriceTotalTaxIncl | MoneyAmount | Retail price total tax inclusive |
| basePriceSellerDiscount | MoneyAmount | Base price seller discount |
| shippingTemuDiscountTotalTaxIncl | MoneyAmount | Shipping Temu discount total tax inclusive |
| unitRetailPriceTaxIncl | MoneyAmount | Unit retail price tax inclusive |
| basePriceOff | MoneyAmount | Base price off |
| basePriceDiscountedTotal | MoneyAmount | Base price discounted total |
| estimatedSettlementTotal | MoneyAmount | Estimated settlement total |
| retailPriceDiscountedTotalTaxIncl | MoneyAmount | Retail price discounted total tax inclusive |
| unitBasePrice | MoneyAmount | Unit base price |
| shippingCustomerTotalTaxIncl | MoneyAmount | Shipping customer total tax inclusive |
| estimatedDeduction | MoneyAmount | Estimated deduction |
| retailPriceTemuDiscountTaxIncl | MoneyAmount | Retail price Temu discount tax inclusive |
| basePriceTotal | MoneyAmount | Base price total |
| shippingTotalTaxIncl | MoneyAmount | Shipping total tax inclusive |
---
金额块(MoneyAmount)
结构同 temu-order-amount-v2-query.md:currency + amount(本地最小货币单位)。
---
Error Code(Partner 表)
| errorCode | errorMsg | Error SOP / 处理建议 |
|---|---|---|
| 140020015 | This API is not applicable to the country or region where the current store is located. | 确认店铺区域;必要时改用 V2 或 bg.order.amount.query |
| 140020002 | Order not found | 核对 parentOrderSn |
---
脚本
export LINKFOXAGENT_API_KEY="<key>"
python scripts/eu_order_amount_v3_query.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"site": "eu",
"request": {
"parentOrderSn": "PO-123456789"
}
}'典型流程: 欧洲含税价对账优先 V3;需细粒度税费拆分时用 V2。
Temu 授权流程
用户确认店铺类型与用途
↓
temu_token_guide.py(输出后台操作步骤)
↓
用户在 Temu 卖家后台复制 access_token
↓
save_temu_access_token.py(可选,写入本地 store)
↓
temu_proxy.py / temu_file_download.py
- 直接传 accessToken,或
- 传 storeKey + site + managementType + tokenPurpose决策表
| 用户需求 | shopType | tokenPurpose | site |
|---|---|---|---|
| 半托管查商品/库存 | semi-managed | product-inventory | cn / partner |
| 半托管查订单/发货 | semi-managed | order-shipping | us / global / eu |
| 全托管任意接口 | full-managed | full-managed | cn / partner |
| 美欧本土店 | local-native | local-native | us 等 |
与 API 调用的对应关系
紫鸟转发路径:/temu-proxy/{site}/{managementType}
- 全托管 CN:
cn+full-managed - 半托管商品:
cn/partner+semi-managed+ 商品 token - 半托管订单:
us/global/eu+semi-managed+ 订单 token
授权应用名称必须与后台一致:酷鸟卖家助手 或 Cyber-ERP酷鸟助手 / Cyber-ERP。
Partner EU — Order 接口目录
Partner Platform for EU 菜单:Order(menu_code=dbd3d395963a408984b8ae7dbc5f64f9)。
文档根 menu_code(浏览器地址栏常见):7289390cfd724be4a196f11ebe45a896。
本 skill 覆盖与 US 版对齐的 10 个订单 type。调用经 temu_eu_proxy(POST /temu/proxy),默认 `site=eu`、`tokenPurpose=order-shipping`。
EU 菜单 HTML 导出中 Order 子项未展开,各接口sub_menu_code请在 partner-eu.temu.com 按type打开后补全。
已接入(10)
| sub_menu_code | type | 脚本 | 参数文档 |
|---|---|---|---|
| — | bg.order.list.v2.get | eu_order_list_v2_get.py | apis/bg-order-list-v2-get.md |
| — | bg.order.detail.v2.get | eu_order_detail_v2_get.py | apis/bg-order-detail-v2-get.md |
| — | bg.order.shippinginfo.v2.get | eu_order_shippinginfo_v2_get.py | apis/bg-order-shippinginfo-v2-get.md |
| — | bg.order.decryptshippinginfo.get | eu_order_decryptshippinginfo_get.py | apis/bg-order-decryptshippinginfo-get.md |
| — | bg.order.amount.query | eu_order_amount_query.py | apis/bg-order-amount-query.md |
91661bf0642440ddbd462b25fa96edfb | temu.order.amount.v2.query | eu_order_amount_v2_query.py | apis/temu-order-amount-v2-query.md |
3ffe9c4c79b9418285eb7ec09cf7b329 | temu.order.amount.v3.query | eu_order_amount_v3_query.py | apis/temu-order-amount-v3-query.md |
| — | bg.order.combinedshipment.list.get | eu_order_combinedshipment_list_get.py | apis/bg-order-combinedshipment-list-get.md |
| — | bg.order.customization.get | eu_order_customization_get.py | apis/bg-order-customization-get.md |
| — | temu.local.order.verification.upload | eu_order_verification_upload.py | apis/temu-local-order-verification-upload.md |
官方文档 URL
| type | URL |
|---|---|
bg.order.list.v2.get | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9 |
bg.order.detail.v2.get | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9 |
bg.order.shippinginfo.v2.get | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9 |
bg.order.decryptshippinginfo.get | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9 |
bg.order.amount.query | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9 |
temu.order.amount.v2.query | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9&sub_menu_code=91661bf0642440ddbd462b25fa96edfb |
temu.order.amount.v3.query | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9&sub_menu_code=3ffe9c4c79b9418285eb7ec09cf7b329 |
bg.order.combinedshipment.list.get | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9 |
bg.order.customization.get | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9 |
temu.local.order.verification.upload | https://partner-eu.temu.com/documentation?menu_code=dbd3d395963a408984b8ae7dbc5f64f9 |
上游 OpenAPI(EU)
POST https://openapi-b-eu.temu.com/openapi/router(经 LinkFox 网关 site=eu 转发)
通用脚本
| 脚本 | 说明 |
|---|---|
temu_eu_proxy.py | 任意 type + params |
temu_eu_file_download.py | 加签文件下载 |
| 全球站(非 US/EU)订单 | linkfox-temu-order-global |
与其他 Temu skill 的关系
| 能力 | skill |
|---|---|
| 订单查询、发货、物流 | linkfox-temu-order-eu |
| 取消订单 | linkfox-temu-cancel-order-eu |
| 退货与退款 | linkfox-temu-returns-refunds-eu |
| 履约/发货(购标、合作仓、自发货、跟踪) | linkfox-temu-fulfillment-eu |
| 商品管理 | linkfox-temu-manage-product-eu |
| 价格 | linkfox-temu-price-eu |
| 网关、Token | 本 skill scripts/ |
Token 说明
订单类接口建议使用 `tokenPurpose=order-shipping`。详见 access-token.md。
#!/usr/bin/env python3
"""Factory for thin US order API CLI scripts."""
import sys
import _temu_eu_common # noqa: F401 — gateway helpers in scripts/
from _temu_common import load_json_arg
from _temu_eu_common import extract_business_params, run_and_print
def run_cli(api_type: str, usage: str) -> None:
if len(sys.argv) < 2:
print(f"Usage: {usage}", file=sys.stderr)
sys.exit(1)
params = load_json_arg(sys.argv)
run_and_print(params, api_type, extract_business_params(params))
#!/usr/bin/env python3
"""Authorization guide data derived from TEMU_API_README.md."""
VALID_SHOP_TYPES = frozenset({"semi-managed", "full-managed", "local-native"})
VALID_TOKEN_PURPOSES = frozenset(
{"product-inventory", "order-shipping", "full-managed", "local-native", "default"}
)
LOGIN_URLS = {
"cn": "https://seller.kuajingmaihuo.com",
"partner": "https://agentseller.temu.com",
}
APPS = {
"kuniao-seller": "酷鸟卖家助手",
"cyber-erp": "Cyber-ERP酷鸟助手",
"cyber-erp-native": "Cyber-ERP",
}
def _steps(*items: str) -> list[str]:
return list(items)
def build_guide(shop_type: str, token_purpose: str, site=None) -> dict:
shop_type = shop_type.strip().lower()
token_purpose = (token_purpose or "default").strip().lower()
if shop_type not in VALID_SHOP_TYPES:
raise ValueError(
f"Invalid shopType '{shop_type}'. Use: semi-managed, full-managed, local-native"
)
if token_purpose not in VALID_TOKEN_PURPOSES:
raise ValueError(
"Invalid tokenPurpose. Use: product-inventory, order-shipping, "
"full-managed, local-native, default"
)
guide = {
"shopType": shop_type,
"tokenPurpose": token_purpose,
"note": (
"Temu accessToken 需在卖家后台手动复制,无自动 OAuth。"
"保存后可使用 save_temu_access_token.py / storeKey 调用 API。"
),
}
if shop_type == "semi-managed" and token_purpose == "product-inventory":
site = site or "cn"
login = LOGIN_URLS.get(site, LOGIN_URLS["cn"])
guide.update(
{
"recommendedSite": site,
"recommendedManagementType": "semi-managed",
"loginUrl": login,
"appName": APPS["kuniao-seller"],
"menuPath": "系统管理 > 服务市场 > 授权管理",
"steps": _steps(
f"登录 Temu 卖家后台:{login}",
"进入:系统管理 > 服务市场 > 授权管理",
"点击「获取授权」,选择「酷鸟卖家助手」",
"全选常规和特殊授权 > 确认",
"复制 access_token,用 save_temu_access_token.py 保存",
),
"usageHint": "用于半托管商品、库存类 API;site 通常为 cn 或 partner。",
}
)
elif shop_type == "semi-managed" and token_purpose == "order-shipping":
site = site or "us"
guide.update(
{
"recommendedSite": site,
"recommendedManagementType": "semi-managed",
"loginUrl": LOGIN_URLS["cn"],
"appName": APPS["cyber-erp"],
"menuPath": "Seller Central 对应站点 > 服务市场 > 授权管理",
"steps": _steps(
"登录 Temu 卖家后台(seller.kuajingmaihuo.com 或 agentseller.temu.com)",
"右上角 Seller Central,切换到目标区域站点(美区/欧区/全球)",
"进入:服务市场 > 授权管理",
"点击「获取授权」,选择「Cyber-ERP酷鸟助手」",
"全选常规和特殊授权 > 确认",
"复制 access_token;调用 API 时 site 用 us / global / eu",
),
"usageHint": "用于半托管订单、发货类 API。",
}
)
elif shop_type == "full-managed" or token_purpose == "full-managed":
site = site or "cn"
login = LOGIN_URLS.get(site, LOGIN_URLS["cn"])
guide.update(
{
"recommendedSite": site,
"recommendedManagementType": "full-managed",
"loginUrl": login,
"appName": APPS["kuniao-seller"],
"menuPath": "系统管理 > 服务市场 > 授权管理",
"steps": _steps(
f"登录 Temu 平台:{login}",
"系统管理 > 服务市场 > 授权管理",
"获取授权 > 选择「酷鸟卖家助手」",
"全选常规和特殊授权 > 确认 > 复制 access_token",
),
"usageHint": "全托管店铺通用;site 通常为 cn 或 partner。",
}
)
elif shop_type == "local-native" or token_purpose == "local-native":
guide.update(
{
"recommendedSite": site or "us",
"recommendedManagementType": "semi-managed",
"loginUrl": LOGIN_URLS["cn"],
"appName": APPS["cyber-erp-native"],
"menuPath": "Apps And Services > Manage Your Apps",
"steps": _steps(
"登录 Temu 卖家后台",
"进入:Apps And Services(应用程序和服务)",
"Manage Your Apps(管理您的应用)",
"Authorize a new app(授权新应用)",
"搜索「Cyber-ERP」",
"一般权限和敏感权限全选 > 确认 > 复制 access_token",
),
"usageHint": "适用于美区、欧区本土主体店铺。",
}
)
else:
guide.update(
{
"steps": _steps(
"确认店铺类型:semi-managed / full-managed / local-native",
"确认用途:product-inventory(商品库存)或 order-shipping(订单发货)",
"运行 temu_token_guide.py 获取对应步骤",
"复制 token 后执行 save_temu_access_token.py",
),
"usageHint": "请指定 shopType 与 tokenPurpose,见 references/access-token.md",
}
)
guide["cautions"] = [
"子账号可能无法进入服务市场,需主账号授权",
"多站点需分别登录对应后台获取 Token",
"Token 有有效期,过期后需重新在后台复制",
"调用网关前需联系紫鸟配置 IP 白名单",
]
return guide
#!/usr/bin/env python3
"""Shared helpers for LinkFox Temu API skill scripts."""
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
from _temu_token_store import get_token
BASE_URL = os.environ.get("TEMU_API_BASE_URL") or os.environ.get(
"STORE_API_BASE_URL", "https://tool-gateway.linkfox.com"
)
BASE_URL = BASE_URL.rstrip("/")
PROXY_URL = f"{BASE_URL}/temu/proxy"
FILE_DOWNLOAD_URL = f"{BASE_URL}/temu/fileDownload"
VALID_SITES = frozenset({"cn", "partner", "us", "global", "eu"})
VALID_MANAGEMENT_TYPES = frozenset({"full-managed", "semi-managed"})
# LinkFox 用户 Token(网关鉴权),勿与 Body 中的 Temu accessToken 混淆
LINKFOX_TOKEN_PARAM_KEYS = ("token", "linkfoxToken", "linkfox_token")
def get_linkfox_token(params=None) -> str:
"""
LinkFox 用户鉴权 Token,与 linkfox-amazon-store-auth 一致。
优先级:请求 JSON 中的 token / linkfoxToken > 环境变量 LINKFOXAGENT_API_KEY。
"""
if params:
for key in LINKFOX_TOKEN_PARAM_KEYS:
value = params.get(key)
if value is not None and str(value).strip():
return str(value).strip()
key = os.environ.get("LINKFOXAGENT_API_KEY")
if not key:
print(
"LinkFox user Token not configured. Same as linkfox-amazon-store-auth:\n"
"1. Visit https://skill.linkfox.com/linkfoxskills/guide.htm to obtain your Key\n"
"2. export LINKFOXAGENT_API_KEY=your-key-here\n"
" Or pass \"token\" in the JSON parameters of proxy/fileDownload scripts.",
file=sys.stderr,
)
sys.exit(1)
return key
def build_gateway_headers(linkfox_token: str) -> dict:
"""网关鉴权:Authorization(全站通用)+ Token(TEMU_API_SPEC 约定)。"""
return {
"Authorization": linkfox_token,
"Token": linkfox_token,
"Content-Type": "application/json",
"User-Agent": "LinkFox-Skill/1.0",
}
def load_json_arg(argv: list) -> dict:
if len(argv) < 2:
return {}
try:
return json.loads(argv[1])
except json.JSONDecodeError as e:
print(f"Invalid parameter format: {e}", file=sys.stderr)
sys.exit(1)
def require_text(params: dict, key: str, label=None) -> str:
value = params.get(key)
if value is None or not str(value).strip():
print(f"Error: '{label or key}' is required.", file=sys.stderr)
sys.exit(1)
return str(value).strip()
def validate_site(site: str) -> str:
if site not in VALID_SITES:
print(
f"Error: invalid site '{site}'. Must be one of: {', '.join(sorted(VALID_SITES))}",
file=sys.stderr,
)
sys.exit(1)
return site
def validate_management_type(management_type: str) -> str:
if management_type not in VALID_MANAGEMENT_TYPES:
print(
"Error: invalid managementType. Must be: full-managed, semi-managed",
file=sys.stderr,
)
sys.exit(1)
return management_type
def call_temu_api(
url: str,
body: dict,
timeout: int = 60,
linkfox_params=None,
) -> dict:
"""调用 Temu 网关接口;必须先具备 LinkFox 用户 Token。"""
linkfox_token = get_linkfox_token(linkfox_params)
data = json.dumps(body, ensure_ascii=False).encode("utf-8")
req = Request(
url,
data=data,
headers=build_gateway_headers(linkfox_token),
method="POST",
)
try:
with urlopen(req, timeout=timeout) as response:
return json.loads(response.read().decode("utf-8"))
except HTTPError as e:
raw = e.read().decode("utf-8") if e.fp else ""
try:
return json.loads(raw)
except json.JSONDecodeError:
return {"error": f"HTTP {e.code}: {e.reason}", "details": raw}
except URLError as e:
return {"error": f"Connection failed: {e.reason}"}
def is_linkfox_auth_error(result: dict) -> bool:
msg = str(result.get("message") or result.get("error") or "")
return "无法识别当前用户" in msg or "重新登录" in msg
def resolve_access_token(params: dict) -> str:
"""Temu 店铺 accessToken:直接传入或从本地 storeKey 读取。"""
if params.get("accessToken"):
return str(params["accessToken"]).strip()
store_key = params.get("storeKey")
if not store_key:
print(
"Error: provide Temu 'accessToken' or 'storeKey' (+ site, managementType).",
file=sys.stderr,
)
sys.exit(1)
site = validate_site(require_text(params, "site"))
management_type = validate_management_type(require_text(params, "managementType"))
token_purpose = str(params.get("tokenPurpose", "default")).strip() or "default"
token = get_token(str(store_key).strip(), site, management_type, token_purpose)
if not token:
print(
f"Error: no Temu token for storeKey={store_key}, site={site}, "
f"managementType={management_type}, tokenPurpose={token_purpose}. "
"Run temu_token_guide.py and save_temu_access_token.py first.",
file=sys.stderr,
)
sys.exit(1)
return token
def parse_nested_body(result: dict) -> dict:
"""If gateway returns a JSON string in body, parse it into temuBody."""
body = result.get("body")
if isinstance(body, str) and body.strip():
try:
result["temuBody"] = json.loads(body)
except json.JSONDecodeError:
pass
return result
#!/usr/bin/env python3
"""EU / Partner order API helpers; local gateway helpers."""
import json
from _temu_common import (
FILE_DOWNLOAD_URL,
PROXY_URL,
call_temu_api,
load_json_arg,
parse_nested_body,
resolve_access_token,
)
# Partner EU 订单接口:默认欧洲站半托管 + 订单/发货 token
DEFAULT_SITE = "eu"
DEFAULT_MANAGEMENT_TYPE = "semi-managed"
DEFAULT_TOKEN_PURPOSE = "order-shipping"
RESERVED_KEYS = frozenset(
{
"token",
"linkfoxToken",
"linkfox_token",
"accessToken",
"storeKey",
"site",
"managementType",
"tokenPurpose",
"type",
"params",
}
)
def extract_business_params(params: dict) -> dict:
if isinstance(params.get("params"), dict):
return dict(params["params"])
return {k: v for k, v in params.items() if k not in RESERVED_KEYS}
def build_eu_proxy_body(params: dict, api_type: str, business=None) -> dict:
site = str(params.get("site", DEFAULT_SITE)).strip().lower() or DEFAULT_SITE
management_type = (
str(params.get("managementType", DEFAULT_MANAGEMENT_TYPE)).strip().lower()
or DEFAULT_MANAGEMENT_TYPE
)
if "tokenPurpose" not in params and params.get("storeKey") and not params.get("accessToken"):
params = dict(params)
params.setdefault("tokenPurpose", DEFAULT_TOKEN_PURPOSE)
params.setdefault("site", site)
params.setdefault("managementType", management_type)
body = {
"site": site,
"managementType": management_type,
"accessToken": resolve_access_token(params),
"type": api_type,
}
biz = business if business is not None else extract_business_params(params)
if biz:
body["params"] = biz
return body
def eu_proxy_call(params: dict, api_type: str, business=None, timeout: int = 60) -> dict:
body = build_eu_proxy_body(params, api_type, business)
return call_temu_api(PROXY_URL, body, timeout=timeout, linkfox_params=params)
def eu_file_download_call(params: dict, timeout: int = 120) -> dict:
if "tokenPurpose" not in params and params.get("storeKey") and not params.get("accessToken"):
params = dict(params)
params.setdefault("tokenPurpose", DEFAULT_TOKEN_PURPOSE)
from _temu_common import require_text # noqa: E402
site = str(params.get("site", DEFAULT_SITE)).strip().lower() or DEFAULT_SITE
management_type = (
str(params.get("managementType", DEFAULT_MANAGEMENT_TYPE)).strip().lower()
or DEFAULT_MANAGEMENT_TYPE
)
body = {
"site": site,
"managementType": management_type,
"accessToken": resolve_access_token(params),
"url": require_text(params, "url"),
}
return call_temu_api(FILE_DOWNLOAD_URL, body, timeout=timeout, linkfox_params=params)
def run_and_print(params: dict, api_type: str, business=None) -> None:
result = parse_nested_body(eu_proxy_call(params, api_type, business))
print(json.dumps(result, indent=2, ensure_ascii=False))
#!/usr/bin/env python3
"""Local Temu accessToken storage (manual authorization from seller console)."""
from __future__ import annotations
import json
import os
from datetime import datetime, timezone
DEFAULT_STORE_PATH = os.path.expanduser("~/.linkfox/temu-access-tokens.json")
def store_path() -> str:
return os.environ.get("TEMU_TOKEN_STORE_PATH", DEFAULT_STORE_PATH)
def _utc_now() -> str:
return datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
def _load_store() -> dict:
path = store_path()
if not os.path.isfile(path):
return {"stores": []}
with open(path, encoding="utf-8") as f:
data = json.load(f)
if "stores" not in data or not isinstance(data["stores"], list):
return {"stores": []}
return data
def _save_store(data: dict) -> None:
path = store_path()
parent = os.path.dirname(path)
if parent:
os.makedirs(parent, exist_ok=True)
with open(path, "w", encoding="utf-8") as f:
json.dump(data, f, indent=2, ensure_ascii=False)
f.write("\n")
def _find_store(data: dict, store_key: str):
for store in data["stores"]:
if store.get("storeKey") == store_key:
return store
return None
def _token_key(site: str, management_type: str, token_purpose: str) -> tuple:
return site, management_type, token_purpose or "default"
def save_token(
store_key: str,
site: str,
management_type: str,
access_token: str,
token_purpose: str = "default",
label: str | None = None,
) -> dict:
data = _load_store()
store = _find_store(data, store_key)
if store is None:
store = {"storeKey": store_key, "label": label or store_key, "tokens": []}
data["stores"].append(store)
elif label:
store["label"] = label
key = _token_key(site, management_type, token_purpose)
entry = {
"site": site,
"managementType": management_type,
"tokenPurpose": token_purpose,
"accessToken": access_token,
"updatedAt": _utc_now(),
}
replaced = False
for i, item in enumerate(store["tokens"]):
if _token_key(
item.get("site", ""),
item.get("managementType", ""),
item.get("tokenPurpose", "default"),
) == key:
store["tokens"][i] = entry
replaced = True
break
if not replaced:
store["tokens"].append(entry)
_save_store(data)
return {
"storeKey": store_key,
"site": site,
"managementType": management_type,
"tokenPurpose": token_purpose,
"storePath": store_path(),
"updatedAt": entry["updatedAt"],
"replaced": replaced,
}
def get_token(
store_key: str,
site: str,
management_type: str,
token_purpose: str = "default",
):
data = _load_store()
store = _find_store(data, store_key)
if not store:
return None
key = _token_key(site, management_type, token_purpose)
for item in store.get("tokens", []):
if _token_key(
item.get("site", ""),
item.get("managementType", ""),
item.get("tokenPurpose", "default"),
) == key:
return item.get("accessToken")
return None
def list_stores(mask: bool = True) -> dict:
data = _load_store()
stores = []
for store in data.get("stores", []):
tokens = []
for item in store.get("tokens", []):
token = item.get("accessToken", "")
if mask and token:
shown = token[:6] + "..." + token[-4:] if len(token) > 12 else "***"
else:
shown = token
tokens.append(
{
"site": item.get("site"),
"managementType": item.get("managementType"),
"tokenPurpose": item.get("tokenPurpose", "default"),
"accessToken": shown,
"updatedAt": item.get("updatedAt"),
}
)
stores.append(
{
"storeKey": store.get("storeKey"),
"label": store.get("label"),
"tokens": tokens,
}
)
return {"storePath": store_path(), "stores": stores}
#!/usr/bin/env python3
"""
Check LinkFox user Token before calling Temu gateway APIs.
Same role as LINKFOXAGENT_API_KEY in linkfox-amazon-store-auth.
Usage:
python check_linkfox_token.py
python check_linkfox_token.py '{"token": "your-linkfox-key"}'
"""
import json
import sys
from _temu_common import PROXY_URL, call_temu_api, get_linkfox_token, is_linkfox_auth_error, load_json_arg
def main():
params = load_json_arg(sys.argv) if len(sys.argv) >= 2 else {}
linkfox_token = get_linkfox_token(params)
masked = (
linkfox_token[:6] + "..." + linkfox_token[-4:]
if len(linkfox_token) > 12
else "***"
)
# 最小探测请求:LinkFox Token 有效时应返回业务/参数类 1002,而非「无法识别当前用户」
probe_body = {
"site": "cn",
"managementType": "full-managed",
"accessToken": "probe",
"type": "probe",
}
result = call_temu_api(PROXY_URL, probe_body, timeout=30, linkfox_params=params)
if is_linkfox_auth_error(result):
print(
json.dumps(
{
"ok": False,
"reason": "linkfox_token_invalid",
"message": result.get("message") or result,
"hint": "Set LINKFOXAGENT_API_KEY or pass token in JSON.",
},
indent=2,
ensure_ascii=False,
)
)
sys.exit(1)
print(
json.dumps(
{
"ok": True,
"linkfoxToken": masked,
"gatewayReachable": True,
"note": "LinkFox user Token accepted by gateway.",
},
indent=2,
ensure_ascii=False,
)
)
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""bg.order.amount.query — 订单金额/供货价查询(自研 ERP)."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"bg.order.amount.query",
"eu_order_amount_query.py '<JSON>'",
)
#!/usr/bin/env python3
"""temu.order.amount.v2.query — 订单金额查询 V2."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"temu.order.amount.v2.query",
"eu_order_amount_v2_query.py '<JSON>'",
)
#!/usr/bin/env python3
"""temu.order.amount.v3.query — 订单金额查询 V3."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"temu.order.amount.v3.query",
"eu_order_amount_v3_query.py '<JSON>'",
)
#!/usr/bin/env python3
"""bg.order.combinedshipment.list.get — 可合并发货订单组列表."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"bg.order.combinedshipment.list.get",
"eu_order_combinedshipment_list_get.py '<JSON>'",
)
#!/usr/bin/env python3
"""bg.order.customization.get — 订单定制商品内容批量查询."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"bg.order.customization.get",
"eu_order_customization_get.py '<JSON>'",
)
#!/usr/bin/env python3
"""bg.order.decryptshippinginfo.get — 订单敏感收货地址解密查询."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"bg.order.decryptshippinginfo.get",
"eu_order_decryptshippinginfo_get.py '<JSON>'",
)
#!/usr/bin/env python3
"""bg.order.detail.v2.get — 订单详情查询 V2."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"bg.order.detail.v2.get",
"eu_order_detail_v2_get.py '<JSON>'",
)
#!/usr/bin/env python3
"""bg.order.list.v2.get — 订单列表查询 V2."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"bg.order.list.v2.get",
"eu_order_list_v2_get.py '<JSON>'",
)
#!/usr/bin/env python3
"""bg.order.shippinginfo.v2.get — 订单收货地址查询 V2."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"bg.order.shippinginfo.v2.get",
"eu_order_shippinginfo_v2_get.py '<JSON>'",
)
#!/usr/bin/env python3
"""temu.local.order.verification.upload — 订单 SN/IMEI 或二手鉴真信息上传."""
import _eu_order_script as m
if __name__ == "__main__":
m.run_cli(
"temu.local.order.verification.upload",
"eu_order_verification_upload.py '<JSON>'",
)
#!/usr/bin/env python3
"""
Get Temu accessToken from local store.
Usage:
python get_temu_access_token.py '{
"storeKey": "my-shop",
"site": "cn",
"managementType": "semi-managed",
"tokenPurpose": "product-inventory"
}'
"""
import json
import sys
from _temu_common import load_json_arg, require_text, validate_management_type, validate_site
from _temu_token_store import get_token
def main():
if len(sys.argv) < 2:
print("Usage: get_temu_access_token.py '<JSON parameters>'", file=sys.stderr)
sys.exit(1)
params = load_json_arg(sys.argv)
store_key = require_text(params, "storeKey")
site = validate_site(require_text(params, "site"))
management_type = validate_management_type(require_text(params, "managementType"))
token_purpose = str(params.get("tokenPurpose", "default")).strip() or "default"
token = get_token(store_key, site, management_type, token_purpose)
if not token:
print(
json.dumps(
{
"found": False,
"storeKey": store_key,
"site": site,
"managementType": management_type,
"tokenPurpose": token_purpose,
"hint": "Run temu_token_guide.py then save_temu_access_token.py",
},
indent=2,
ensure_ascii=False,
)
)
sys.exit(1)
print(
json.dumps(
{
"found": True,
"storeKey": store_key,
"site": site,
"managementType": management_type,
"tokenPurpose": token_purpose,
"accessToken": token,
},
indent=2,
ensure_ascii=False,
)
)
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""
List locally saved Temu accessTokens (masked).
Usage:
python list_temu_access_tokens.py
python list_temu_access_tokens.py '{"mask": false}'
"""
import json
import sys
from _temu_token_store import list_stores
def main():
mask = True
if len(sys.argv) >= 2:
try:
params = json.loads(sys.argv[1])
mask = params.get("mask", True)
except json.JSONDecodeError as e:
print(f"Invalid parameter format: {e}", file=sys.stderr)
sys.exit(1)
print(json.dumps(list_stores(mask=mask), indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""
Save Temu accessToken to local store for reuse in proxy/fileDownload calls.
Usage:
python save_temu_access_token.py '{
"storeKey": "my-shop",
"site": "cn",
"managementType": "semi-managed",
"tokenPurpose": "product-inventory",
"accessToken": "PASTE_TOKEN_HERE",
"label": "中国半托管主店"
}'
"""
import json
import sys
from _temu_common import load_json_arg, require_text, validate_management_type, validate_site
from _temu_token_store import save_token
def main():
if len(sys.argv) < 2:
print("Usage: save_temu_access_token.py '<JSON parameters>'", file=sys.stderr)
sys.exit(1)
params = load_json_arg(sys.argv)
store_key = require_text(params, "storeKey")
site = validate_site(require_text(params, "site"))
management_type = validate_management_type(require_text(params, "managementType"))
access_token = require_text(params, "accessToken")
token_purpose = str(params.get("tokenPurpose", "default")).strip() or "default"
label = params.get("label")
result = save_token(
store_key=store_key,
site=site,
management_type=management_type,
access_token=access_token,
token_purpose=token_purpose,
label=label,
)
print(json.dumps(result, indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""US site file download via /temu/fileDownload (default site=eu)."""
import json
import sys
from _temu_eu_common import DEFAULT_SITE, eu_file_download_call
from _temu_common import load_json_arg
def main():
if len(sys.argv) < 2:
print(
'Usage: temu_eu_file_download.py \'{"accessToken":"...","url":"https://..."}\'',
file=sys.stderr,
)
sys.exit(1)
params = load_json_arg(sys.argv)
params.setdefault("site", DEFAULT_SITE)
result = eu_file_download_call(params)
print(json.dumps(result, indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()