Download Packing Instructions¶
Overview¶
Fetch the generated Packing Instructions (PI) file for an order after optimization has produced it—typically within a few minutes of submission.
|
HTTP method |
|
|---|---|
|
Authentication |
API key (see API Authentication) |
|
Success |
Binary file (PDF or Excel per lane rules) |
Note
Webhooks (recommended): Set up Webhooks and subscribe to
packing_instructions.ready (see Webhook events). When the event
arrives, download the PI—no need to poll blindly.
Polling: If you poll this URL instead, expect 400 responses until the PI exists (see Errors (4xx)). Use exponential backoff, keep the interval compatible with API rate limits, and avoid tight loops.
Request¶
Endpoint¶
Query parameters¶
|
Parameter |
Type |
Description |
|---|---|---|
|
|
String |
Required. Your shipment reference or Alpha ID. Whitespace-only values are rejected. |
Responses¶
Success (200 OK)¶
What you receive
The response is streamed bytes of the packing instructions file. The format
(PDF or Excel) is determined by the lane’s PO or CO business rules
(packing_instructions_file_format, default PDF), not by a query
parameter.
Standard download headers apply:
|
Header |
Role |
|---|---|
|
|
Derived from the filename (often |
|
|
|
Save the raw response to disk, forward it as an attachment, or stream it to your users unchanged.
Example (curl)
curl -sS -H "Authorization: Api-Key YOUR_KEY" \
"BASE_URL/api/v1/orders/download-packing-instructions/?order=YOUR_REF" \
-o packing_instructions.pdf
Replace BASE_URL with your environment base URL (see API Base URLs).
Tip
Do not parse a successful 200 body as JSON—there is no wrapper object or
URL-in-JSON payload.
Errors (4xx)¶
Errors return JSON. Typical cases:
|
HTTP |
Meaning |
What to do |
|---|---|---|
|
|
No matching order for |
Fix the identifier or confirm the order belongs to your tenant |
|
|
Order exists but PI not generated yet |
Wait and retry; contact support if it exceeds ~10 minutes |
|
|
Bad or missing API key |
Fix |
Order not found (400)¶
{
"order": [
"No order found matching the provided reference."
]
}
Shipments that belong to other API customers are invisible; you see the same message as for a typo—by design.
PI not ready yet (400)¶
{
"order": [
"Packing instructions not available yet, please try after couple of minutes. If not ready within 10 minutes, reach out to our support team"
]
}
Optimization may still be running. Retry after a short pause.
Invalid or missing API key (403)¶
No JSON body is guaranteed; ensure the Authorization: Api-Key … header is present
and valid.