This skill helps LinkFox users run authorized 1688 procurement: OAuth status checks, SKU and address lookup, order preview, guarded order creation, payment URL retrieval, order tracking, logistics, cancellation, receipt confirmation, and post-completion invoicing.
Use linkfox-1688-search-by-image for image-based product discovery. This skill does not include image search.
Core Rules
- Every script requires LinkFox platform identity from
LINKFOX_AGENT_API_KEYorLINKFOXAGENT_API_KEY. authorize_url.pystarts 1688 OAuth;authorized_stores.pychecks the current LinkFox user's 1688 OAuth state.- Except those two authorization scripts, every procurement operation runs a script-level
authorizedStoresprecheck before calling the target endpoint. - If no store has
status=ACTIVEandexpired=false, the target endpoint is not called. - After authorization is valid, procurement tools may be used independently as the user requests; the workflow is guidance, not a mandatory linear script. Image search remains in
linkfox-1688-search-by-image. - Treat the workflow as a map, not full automation. Do not create orders, get payment URLs, cancel orders, confirm receipt, or apply for invoices based on earlier phrases like "continue".
- Use exact internal request field names from
references/api.mdwhen calling scripts. Do not show these field names in normal user-facing text. - Treat ordinary 1688 procurement as the only user-facing procurement mode. Apply backend defaults internally per
references/api.md; do not mention procurement type or ask users to choose one. cancel_order.pyonly attempts to cancel a 1688 order. It is not a refund or after-sales request. For paid orders, including paid-but-unshipped orders, do not call cancellation as a workaround; tell the user this Skill has no refund-application tool and refunds/after-sales must be handled on 1688 unless the backend adds that ability.- MCP enable/disable only controls MCP exposure. These scripts call tool-gateway HTTP routes directly; fully disabling a capability requires disabling the route or backend operation.
Read references/api.md for endpoint details and references/workflow.md before multi-step procurement.
Tools
| Script | Risk | OAuth precheck | Purpose |
|---|---|---|---|
authorize_url.py |
Low | No | Generate a 1688 authorization link |
authorized_stores.py |
Low | No | Check current user's authorized 1688 accounts |
receive_address_list.py |
Low | Yes | Query receive addresses |
sku.py |
Low | Yes | Query product SKU/specification data |
order_preview.py |
Medium | Yes | Preview order price, freight, SKU, and address |
create_order.py |
High | Yes | Create a 1688 order |
payment_url.py |
High | Yes | Get payment URL |
order_status.py |
Low | Yes | Query order status |
logistics.py |
Low | Yes | Query logistics summary |
logistics_trace.py |
Low | Yes | Query logistics trace |
confirm_receive.py |
High | Yes | Confirm receipt |
cancel_order.py |
High | Yes | Cancel order |
invoice_amount.py |
Low | Yes | Query invoiceable amount before applying for an invoice |
invoice_apply.py |
High | Yes | Apply for an invoice after order completion |
How to call
- API endpoint:
POST /alibaba1688/{authorizeUrl|authorizedStores|receiveAddressList|sku|orderPreview|createOrder|paymentUrl|orderStatus|logistics|logisticsTrace|confirmReceive|cancelOrder|invoiceAmount|invoiceApply}(For complete parameters, responses, and error handling, seereferences/api.md) - Python script:
python scripts/<script_name>.py '<JSON 参数>' [--inline] [--save] [--no-save] - Recommended for Windows:
$env:PAYLOAD = '<JSON 参数>'then runpython scripts/<script_name>.py --payload-env PAYLOAD [--inline] [--save] - Cost constraints: This tool consumes computing power. On failure, empty results, incomplete parameters, or insufficient authorization, do not automatically probe continuously, retry with different parameters, or poll; if further queries are needed, first explain to the user that additional consumption will be incurred.
- Cache constraints: This procurement Skill does not perform 24h response caching; authorization, prices, inventory, order status, and logistics are subject to real-time returns, and high-risk write operations must not be cached even more.
- Authorization constraints: Except for
authorize_url.pyandauthorized_stores.py, the script automatically checks the current user's ACTIVE 1688 authorization before calling the target interface; when there is no ACTIVE and unexpired authorization, the target endpoint will not be called. - Authorization refresh: When the accessToken is near expiry or has expired, the backend automatically refreshes it using that user's own refreshToken. This is triggered when calling
authorizedStoresor procurement interfaces, and the Skill and user do not need to intervene. Only when the refreshToken is empty, invalid, or refresh fails (authorizedStoresreturnsexpired=true) is it necessary to go throughauthorize_url.pyauthorization again; do not display or announce internal authorization details such as token validity period, expiration time, or refresh window to the user. - High-risk constraints:
create_order.py、payment_url.py、confirm_receive.py、cancel_order.py、invoice_apply.pymust be called only after the user separately and explicitly confirms in natural Chinese language. Internal confirmation fields and request details are only for the Agent to call the script and must not be shown to the user.
$env:PAYLOAD = "{}"
python scripts/authorized_stores.py --payload-env PAYLOAD --inline
Script input methods:
- Pass a JSON string directly:
python scripts/sku.py '{"offerId":"..."}' - Read from environment variables:
python scripts/sku.py --payload-env PAYLOAD - Read from a file:
python scripts/sku.py --payload-file payload.json - Add
--inlineto force full printing to stdout - Add
--saveto force masking of sensitive token-type fields when saving - Add
--no-saveto prohibit saving response files
Output strategy (default script behavior):
- Response body ≤ 8 KB: by default it is not written to disk; the complete masked JSON is printed directly to stdout, avoiding the generation of data files in the Skill directory for every query.
- Response body > 8 KB: by default the complete masked response is written to
<writable-root>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-1688-procurement-<operation>-<timestamp>.json, and stdout outputs only a summary. <writable-root>prioritizes takingACPX_WORKSPACES's first workspace, then the current directory when the script is executed, and finally falls back to the user directory;<session>is taken from the environment variableSESSION_ID, and is automatically generated when not provided; writing to/tmp。- is prohibited. Add
--saveor setLINKFOX_SKILL_SAVE_RESPONSE=1to force saving; add--no-saveor setLINKFOX_SKILL_NO_SAVE=1to prohibit saving;--inlinedoes not imply saving.
Data reading suggestions: First check the stdout summary to determine whether it is sufficient; if the complete response needs to be saved, add --save, then preferentially use jq or ConvertFrom-Json Extract on demand from the saved JSON file to avoid bringing the entire JSON into context.
Resolve authentication and compute resource issues
When the following exceptional situations occur, use references/onboarding.md to guide resolution of the issue:
Exceptional situations
- API Key not configured: The environment variable is not configured
LINKFOX_AGENT_API_KEY, and neither isLINKFOXAGENT_API_KEY。 - Response 401 or 402 status code
- Response indicates insufficient compute resource 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.
High-Risk Confirmation
Ask the user for a separate Chinese natural-language confirmation immediately before each high-risk call, restating the exact order/action summary in business terms only. If the immediately preceding assistant message clearly asks for confirmation of one specific high-risk action, a reply of "确认" is valid. Earlier phrases such as "继续", "可以", or "按上面来" are not valid for later high-risk actions. Do not ask the user to type English parameter names.
After the user confirms in Chinese, the Agent must add the internal safety field required by references/api.md when calling the script. Never mention internal fields, request field names, or backend defaults in user-facing confirmation text unless debugging a tool error.
Common Workflow
- Run
authorized_stores.py; continue only when the current user has an ACTIVE, unexpired 1688 authorization. - If not authorized, run
authorize_url.py, let the user complete OAuth, then re-checkauthorized_stores.py. - If starting from an image, use
linkfox-1688-search-by-imageto get anofferId. - Run
sku.py, thenreceive_address_list.py, thenorder_preview.py. - Show product, SKU/specification, quantity, price, freight, address, total, and warnings in business terms.
- Only after separate Chinese confirmation, run
create_order.py; add required safety fields internally without showing them to the user. - Only after separate Chinese confirmation, run
payment_url.py; pass the created order ID internally without showing request field names to the user. - Use
order_status.py,logistics.py, andlogistics_trace.pyfor tracking. - Use
cancel_order.pyandconfirm_receive.pyonly after separate confirmations for the exact order and action; pass the selected 1688 order ID internally. Do not describe cancellation as refund handling for paid orders. - After receipt confirmation, run
invoice_amount.pyto query the invoiceable amount and whether each order can be invoiced; pass the returnedamountas-is (do not recompute). Only after separate Chinese confirmation of the invoice type, title, and amount, runinvoice_apply.py; passconfirmApplyInvoice=trueand the amount internally. WalksuccessList/failedListper order; treatINVOICE_ALREADY_APPLIEDas already-invoiced, not an error.
Display Rules
- Show authorization status first when procurement depends on OAuth. Do not assume authorization from a browser redirect alone.
authorizedStoresoutput is the current LinkFox user's 1688 authorization state. Do not describe it as all stores in the database.- For authorization, only tell the user whether it is available or whether re-authorization is required. Do not display token expiry times, token validity periods, refresh windows, or internal fields such as
tokenExpiresAt. - Never display full API keys, JWTs, access tokens, refresh tokens, callback codes, app secrets, session keys, or Authorization headers.
- Show order preview clearly in business terms: product, SKU/specification, quantity, unit price, product total, freight, receive address, order total, buyer message, and warnings.
- Before high-risk calls, summarize the exact operation, key IDs, amount/status when available, then ask the user to confirm in Chinese. Do not show internal boolean fields, request field names, or implementation details.
- For receive addresses, show enough to let the user choose safely, but avoid unnecessarily repeating full phone numbers or sensitive address details.
- Report
costTokenor equivalent cost fields only when returned.
Important Limitations
- Do not create or call image-search scripts here; image search belongs to
linkfox-1688-search-by-image. - Do not expose
/alibaba1688/proxy/callback,/alibaba1688/authorizeCallback, or browser OAuth callback URLs as Skill capabilities. - Do not ask users to provide 1688 tokens, refresh tokens, callback codes, or secrets. OAuth token exchange is handled by MyERP and ecom-plat.
- Do not query backend databases to discover authorization state. Use
authorizedStores. - Do not automatically retry write operations or run the full purchase loop.
- Do not use
_dataQuery_executeDynamicQueryfor live procurement responses.
User Expression & Scenario Quick Reference
Applicable -- 1688 procurement scenarios:
| User Says | Scenario |
|---|---|
| "Query my authorized 1688 stores" / "show my authorized 1688 stores" | Authorization check |
| "Generate a 1688 authorization link" / "authorize my 1688 account" | New OAuth authorization |
| "Check the SKU for this offerId" | SKU lookup |
| "Check 1688 shipping addresses" | Receive address lookup |
| "Help me preview a 1688 order" | Order preview |
| "Confirm order placement" | High-risk create order gate |
| "Get the payment link" | High-risk payment URL gate |
| "Check 1688 order status/logistics" | Order tracking |
| "Cancel this 1688 order" | High-risk cancel gate |
| "Confirm receipt" | High-risk confirm receive gate |
| "Check the 1688 invoiceable amount" / "Can this order be invoiced" | Invoiceable amount query |
| "Issue an invoice for this 1688 order" / "Confirm invoicing" | High-risk invoice apply gate |
Not applicable -- use another skill or backend system:
- Image-based 1688 product discovery ->
linkfox-1688-search-by-image - Keyword-based 1688 sourcing/ranking -> use existing 1688 search/ranking skills when available
- MyERP OAuth callback/proxy callback handling -> backend service, not a Skill
- Direct token repair or manual 1688 token input -> backend authorization bridge
Feedback
Auto-detect and report feedback via the Feedback API when actual behavior differs from this skill, results do not match user intent, the user expresses satisfaction/dissatisfaction, or anything could be improved. Call the Feedback API as specified in references/api.md without interrupting the user's flow. Do not include API keys, tokens, full addresses, phone numbers, or payment URLs in feedback content.
For more high-quality, professional cross-border e-commerce skills, visit LinkFox Skills.