Create an international shipment
This guide walks through creating a cross-border shipment from Japan to the United States using YunExpress. The same flow applies to any supported courier and shipping lane.Before you start
- You have an API key and API token from onboarding (see Authentication)
- You know your courier slug and product code (see Couriers and product codes)
1. Prepare the shipment data
An international shipment requires:- Ship-from address — your warehouse or fulfillment center
- Ship-to address — the customer’s delivery address
- Parcel details — weight and item-level customs declarations (English description, quantity, unit price, unit weight)
Customs declarations (
descriptionEn, unitPrice, unitWeight) are required for cross-border shipments. Missing or inaccurate customs data can cause delays at customs clearance.unitPrice.amount values must be at least 0.01. Free gifts, samples, and promotional inserts must still be declared at a nominal value of 0.01 or higher, never 0.
Item unitPrice.currency values must be in USD. The optional unitPrice.currency field accepts only USD; omitting it also means USD.
If you need to supply your own IOSS code to the carrier, send it in customs.taxIds.ioss. The API trims and uses a supplied non-blank value. If the field is omitted or left blank and the destination is an EU tax country, FlexForward’s default IOSS code is applied automatically. A code you registered under IOSS registrations is not applied automatically unless you send it in the request. Applying FlexForward’s default code is chargeable because a VAT pre-payment and service charge are posted alongside the shipping charge to recover destination VAT. Supplying your own code here is not charged.
2. Create the label
Use a unique
idempotencyKey for every new label; the example uses the placeholder unique-key-per-request, and order.customerOrderNumber uses N-2026-05-27-TEST-03. Replace both with your own unique values before each run. Order numbers accept 1–40 ASCII letters, digits, -, and _; see Customer order numbers. Reuse the key and unchanged body when retrying. A changed body with the same key returns 409 IDEMPOTENCY_CONFLICT; see Idempotency and Retries for the legacy-record exception.3. Check the response
201 Created
status is created, the label is ready. Save the id — you’ll use it to retrieve the label document and track the shipment.
If status is failed, check the error object for the courier’s rejection reason. See Error Handling for guidance.
4. Next steps
Retrieve the label document
Download the printable PDF or PNG label to attach to the package.
Track the shipment
Monitor shipment progress with normalized tracking data.
Tips for international shipments
- HS codes — Including Harmonized System codes (
hsCode) speeds up customs clearance. Look up codes at your country’s customs authority. - Local descriptions — The
descriptionLocalfield provides item descriptions in the destination country’s language, which can help with customs processing. - Idempotency — Always use a meaningful
idempotencyKey(e.g., your order ID) so retries are safe. See Idempotency and Retries.