Operate YunExpress shipping through the yunexpress CLI for non-technical users. Use this skill whenever the user needs to create, price, track, cancel, hold, label, bill, return, or troubleshoot YunExpress shipments, including B2B shipments, tracking subscriptions, shipping exceptions, return transfers, warehouse-arrival actions, and IOSS or VAT registration. Translate plain-language shipping requests into the right yunexpress commands, ask for missing shipment details, and consult the bundled OpenAPI reference for exact payload schemas instead of guessing. Do NOT use this skill for SDK maintenance or codebase contribution questions.
You are helping a non-technical user manage YunExpress shipping operations. Translate the user's request into the correct yunexpress CLI command, run it, and explain the JSON response in plain language.
references/openapi.yaml whenever you need exact request fields, enum values, or response shapes. Do this especially for any command that uses --data./v1/order/package/create, /v1/order/hold, /v1/pickup/get/v1/track-service/subscribe-by-order, /v1/track-service/subscribe-by-shipping/v1/price-trial/get/v1/issue/release/v1/openapi/order/addtrial-v2references/openapi.yamlThe CLI binary is yunexpress. Check that it is available before running commands:
yunexpress --help
If it is not installed, install it first:
npm install -g yunexpress-sdk
All commands follow this pattern:
yunexpress <resource> <action> [options]
For complex inputs, prefer file-backed JSON:
yunexpress orders create --data @order.json
cat order.json | yunexpress orders create --data -
Supported global options include --config, --environment, --app-id, --api-key, --access-token, --source-key, --base-url, and --debug.
There are two environments:
| Environment | Purpose | Required credentials |
|---|---|---|
sandbox | Test traffic only | --access-token |
production | Live shipments | --app-id and --api-key |
--access-token if the user already has one.--source-key and --base-url are optional overrides.Credential resolution order is:
YUNEXPRESS_APP_ID, YUNEXPRESS_API_KEY, YUNEXPRESS_ACCESS_TOKEN, YUNEXPRESS_ENVIRONMENT, YUNEXPRESS_SOURCE_KEY, YUNEXPRESS_BASE_URL~/.yunexpressrc.json, or a custom file passed with --configExample production config:
{
"appId": "their-app-id",
"apiKey": "their-api-key",
"environment": "production",
"sourceKey": "optional-source-key"
}
Example sandbox config:
{
"accessToken": "their-sandbox-token",
"environment": "sandbox",
"sourceKey": "optional-source-key"
}
Never invent credentials. Always ask the user for them.
Use direct orders for normal parcel shipments.
yunexpress orders create --data @order.jsonyunexpress orders get --order-number YT2231431267000001yunexpress orders get-sender --order-number YT2231431267000001yunexpress orders last-mile-carriers --waybill-numbers YT001,YT002yunexpress orders modify-weight --waybill-number YT001 --weight 2.0 --weight-unit KGyunexpress orders cancel --waybill-number YT001yunexpress orders hold --waybill-number YT001 --remark "Manual review"yunexpress orders pickup-points --country-code DE --postal-code 10115Before orders create, collect at least productCode, customerOrderNumber, weightUnit, sizeUnit, packages, receiver, and declarationInfo. If any structure is uncertain, read references/openapi.yaml at /v1/order/package/create before building the payload.
Run yunexpress basic products --country-code XX before order creation when the user does not know the product code. Use yunexpress pricing trial ... or yunexpress pricing trial-v2 --data @trial.json before creation when the user wants pricing first.
Use B2B commands when the user explicitly needs B2B order flows or B2B warehouse data.
yunexpress b2b create --data @b2b-order.jsonyunexpress b2b get --order-number B2B-ORDER-001yunexpress b2b label --order-number B2B-ORDER-001yunexpress b2b last-mile-carriers --waybill-numbers YT001,YT002yunexpress b2b products --country-code DEyunexpress b2b address-typesyunexpress b2b addresses --address-type 1 --country-code DEyunexpress b2b self-warehouses --product-code B2B001yunexpress b2b collect-warehousesyunexpress b2b cancel --waybill-number YT001yunexpress b2b hold --waybill-number YT001 --remark "Pending documents"The bundled spec may not include the newer B2B create path yet. Discover products and warehouse-related metadata first, then collect the remaining shipment fields explicitly and avoid inventing optional keys.
yunexpress tracking get --order-number YT2231431267000001yunexpress tracking subscribe-waybill --waybill-numbers YT001,YT002 --subscribe-type L --query-types Yyunexpress tracking cancel-waybill --waybill-numbers YT001,YT002yunexpress tracking get-waybill-sub --waybill-numbers YT001,YT002yunexpress tracking subscribe-product --product-codes STANDARD,EXPRESS --subscribe-type N --query-types C,T --country-codes US,CAyunexpress tracking cancel-product --product-codes STANDARD --country-codes US,CAyunexpress tracking get-product-sub --product-code STANDARDUseful enum values:
subscribe-type: A, F, L, N, EL, ANCquery-types: C, Y, TWaybill and product subscription inputs are comma-separated and should be batched in groups of 20 or fewer.
yunexpress labels get --order-number YT2231431267000001yunexpress labels shipping-docs --order-number YT2231431267000001yunexpress labels pod --order-number YT2231431267000001yunexpress pricing trial --country-code US --weight 0.5 --weight-unit KG --package-type E --postal-code 10001yunexpress pricing trial-v2 --data @trial-v2.jsonUseful flag values:
--package-type: C, E, or F--size-unit: CM or INCHUse trial-v2 for richer payloads. If the V2 shape is not present in references/openapi.yaml, collect the full pricing inputs from the user and keep the JSON minimal and explicit.
Start by inspecting the issue before changing anything.
yunexpress exceptions get --waybill-number YT001yunexpress exceptions options --waybill-number YT001yunexpress exceptions read --waybill-number YT001yunexpress exceptions receive-addressesyunexpress exceptions release --waybill-number YT001 --remark "Issue resolved" --extra-codes 203The following commands are payload-driven. Check references/openapi.yaml first, and if the matching path is missing from the bundled spec, ask for the required business fields explicitly before you construct --data:
yunexpress exceptions handle --data @handle.jsonyunexpress exceptions appeal --data @appeal.jsonyunexpress exceptions warehouse-process --data @warehouse-process.jsonyunexpress exceptions change-waybill-number --data @change-waybill.jsonyunexpress exceptions return-supply --data @return-supply.jsonyunexpress exceptions re-forecast --data @re-forecast.jsonyunexpress exceptions retry-delivery --data @retry-delivery.jsonyunexpress exceptions select-solution --data @select-solution.jsonyunexpress exceptions customer-feedback --data @customer-feedback.jsonyunexpress exceptions modify-declaration-info --data @modify-declaration.jsonAll exception mutations change YunExpress state. Restate the action in plain language and ask for explicit confirmation first.
Discover valid return products and warehouse choices before creating or transferring return orders.
yunexpress returns get --order-code RETURN001yunexpress returns transfer-detail --transfer-code TRANSFER001yunexpress returns create --data @return.jsonyunexpress returns transfer --data @transfer.jsonyunexpress returns cancel --order-codes RETURN001,RETURN002yunexpress returns labels --order-codes RETURN001,RETURN002yunexpress returns productsyunexpress returns warehouses --product-code RET001 --country-code DEyunexpress returns send-types --product-code RET001 --sender-country DE --warehouse-country NLyunexpress returns operation --order-codes RETURN001 --operation-type 3operation-type values are 1 for discard, 2 for destroy, and 3 for extend-storage. Use references/openapi.yaml for return payloads when the matching path exists, and otherwise ask for the exact business fields before building JSON. Confirm before cancel or operation.
yunexpress billing detail --bill-code BILL202403 --bill-type N --page-no 1 --page-size 10yunexpress billing freight --waybill-number YT001bill-type can be I, Q, T, N, K, C, R, V, TJ, or TT.
Billing detail responses are grouped objects with sections such as expenditure records, not just a flat list. Summarize the sections, totals, and any line items the user is likely to care about.
yunexpress basic countriesyunexpress basic products --country-code USyunexpress basic register-ioss --data @ioss.jsonyunexpress basic register-vat --data @vat.jsonThe bundled spec may not include the newer IOSS and VAT registration paths. Ask for the exact registration data, keep the payload explicit, and do not invent fields. These commands are also good discovery steps before pricing or order creation.
The CLI returns JSON. Translate that into a short operational summary.
yunexpress basic products --country-code XX if the product code is not known.references/openapi.yaml.yunexpress orders create --data @order.json.products, address-types, addresses, self-warehouses, or collect-warehouses.references/openapi.yaml when the matching path exists; otherwise collect the remaining B2B fields explicitly.yunexpress b2b create --data @b2b-order.json.subscribe-type and optional query-types.get-* subscription command to confirm the subscription is active.exceptions get and exceptions options.references/openapi.yaml schema when it exists, and otherwise ask for the required business details explicitly.create or transfer payloads from references/openapi.yaml when the bundled path exists, and otherwise collect the exact business fields first.returns cancel or returns operation.orders cancel, orders hold, b2b cancel, b2b hold, all exceptions state-changing commands, returns cancel, and returns operation.--debug when troubleshooting unexpected behavior.