This skill (linkfox-temu-returns-refunds-us) covers Partner Platform for US Returns & Refunds / e-commerce returns and refunds(and related After-sales returns and refunds category) related bg.* / temu.* endpoints (menu_code and each sub_menu_code are subject to the Partner backend, see partner-us-catalog.md)。
Integrated 9 Partner Return and Refund endpoints, see the list at partner-us-catalog.md。
Gateway (built into this skill):
| Capability | Method | Path |
|---|---|---|
Returns and refunds OpenAPI (us_returns_refunds_*、temu_us_proxy) |
POST | https://tool-gateway.linkfox.com/temu/proxy |
| signed file download | POST | https://tool-gateway.linkfox.com/temu/fileDownload |
Related skills
| Scenario | skill |
|---|---|
| Returns and refunds(this skill) | linkfox-temu-returns-refunds-us |
| Buyer-initiatedCancel order(not the full returns and refunds flow) | linkfox-temu-cancel-order-us |
| Seller-initiatedCancel order / out-of-stock cancellation / appeal | linkfox-temu-cancel-order-us |
| Order list/details/amount/after-sales context | linkfox-temu-order-us |
| Product management | linkfox-temu-manage-product-us |
| Fulfillment/shipping | linkfox-temu-fulfillment-us |
| Gateway and Temu token | This skill scripts/ |
How to call
- API endpoint:
POST /temu/proxy(different operations are distinguished by the request body; for complete parameters/responses/error codes seereferences/api.md) - Python script:
python scripts/<脚本名>.py '<JSON 参数>' [--inline](available scripts are listed in the script overview above) - Cost constraint: This tool consumes compute; on failure/empty results, do not automatically switch keywords, paginate, or repeatedly probe; if you need to continue searching, first explain to the user that additional consumption will be incurred.
Output strategy (default script behavior):
- Alwayswrite the complete response to
<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-temu-returns-refunds-us-<timestamp>.json(<cwd>is the working directory when the script is executed, which in Claude Code is the current project directory;<session>is taken from the environment variableSESSION_ID, automatically aggregated according to the user's task;writing to /tmp is prohibited, if the current directory is not writable, report an error) - Response body ≤ 8 KB: after writing to disk, print the complete JSON to stdout
- Response body > 8 KB: after writing to disk, stdout outputs only a summary (top-level fields, common counts such as
total/costToken, length of the largest list field + first 3 samples) - Add
--inlineto force full printing to stdout (also written to disk)
Data reading suggestions: first look at the summary to judge whether it is sufficient; when specific fields are needed, prefer jqorConvertFrom-Json to extract on demand from the saved json file, avoiding bringing the entire JSON into context.
Resolve authentication and compute issues
When the following abnormal situations occur, use references/onboarding.md to guide resolution:
Abnormal situations
- API Key not configured: the environment variable is not configured with
LINKFOX_AGENT_API_KEY, nor isLINKFOXAGENT_API_KEY。 - Response 401 or 402 status code
- Response indicates insufficient compute or balance: The message contains "insufficient compute balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/package expired/recharge required/please recharge", or content with a similar meaning.
Default parameters
| Field | Default | Description |
|---|---|---|
| site | us |
Partner US |
| managementType | semi-managed |
Semi-hosted (for specific APIs, refer to the Partner documentation) |
| tokenPurpose | order-shipping |
Order/after-sales scenario token (see access-token.md) |
Authentication
- LinkFox:
LINKFOXAGENT_API_KEY→ HeaderAuthorization+Token - Temu:
accessTokenorstoreKey(storeKey, it is recommended to includetokenPurpose=order-shipping)
Scripts
| Script | Description |
|---|---|
temu_us_proxy.py |
Any type generic forwarding |
temu_us_file_download.py |
Signed file download |
us_returns_refunds_aftersales_parentaftersales_list_get.py |
bg.aftersales.parentaftersales.list.get |
us_returns_refunds_aftersales_aftersales_list_get.py |
bg.aftersales.aftersales.list.get |
us_returns_refunds_aftersales_parentaftersales_detail_get.py |
temu.aftersales.parentaftersales.detail.get |
us_returns_refunds_aftersales_parentreturnorder_get.py |
bg.aftersales.parentreturnorder.get |
us_returns_refunds_aftersales_returnaddress_get.py |
temu.aftersales.returnaddress.get |
us_returns_refunds_aftersales_returnlabel_prepare_get.py |
temu.aftersales.returnlabel.prepare.get |
us_returns_refunds_aftersales_signature_get.py |
temu.aftersales.signature.get |
us_returns_refunds_aftersales_upload_returnlabel.py |
temu.aftersales.upload.returnlabel |
us_returns_refunds_aftersales_carrier_get.py |
temu.aftersales.carrier.get |
Integrate more APIs (convention)
Each time you provide a Partner document (type + sub_menu_code + URL + Request/Response parameter table), we will:
- Add
references/apis/<type-slug>.md(complete input/output parameter hierarchy) - Add
scripts/us_returns_refunds_<slug>.py(call_us_returns_refunds_script.run_cli) - Update partner-us-catalog.md、apis/README.md and this table
Example (generic proxy)
export LINKFOXAGENT_API_KEY="<key>"
python scripts/temu_us_proxy.py '{
"accessToken": "TOKEN",
"tokenPurpose": "order-shipping",
"type": "<TEMU_API_TYPE>",
"params": {
"request": {}
}
}'
Feedback: skillName:linkfox-temu-returns-refunds-us
Gateway and authorization scripts
| Script | Description |
|---|---|
check_linkfox_token.py |
Verify LinkFox user Token |
temu_token_guide.py |
Temu accessToken backend authorization steps |
save_temu_access_token.py |
Save accessToken locally |
list_temu_access_tokens.py |
List saved tokens |
get_temu_access_token.py |
Read saved token |
temu_proxy.py |
Generic gateway forwarding (multi-site) |
temu_file_download.py |
Signed file download (multi-site) |
Authorization instructions:references/access-token.md
Compute consumption rules
No compute is consumed.