Download labels as one PDF
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/shipping-labels/v2-shipment-label-compile-goshippo.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
POST/
Merges the label files of up to 40 Shippo packages into one PDF (compiled-labels.pdf, shown inline), ready to print. Nothing is bought. Packages without a Shippo label (external, deleted or unknown ids) are skipped.
Business rules
- 1 to 40 ids per call.
- The pages follow the stored package order, not the order you sent.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Request body
application/json, required.
Package hash ids (
idfrom List the packages of a shipment). Packages have no unique keys. A string of digits is read as an internal numeric id, not a hash id; anything else is skipped.- 1 to 40 items
Response
200The merged labels as a PDF, shown inline (Content-Disposition: inline).
The answer is a file (application/pdf), not JSON. The example saves it with curl -o.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
- None of the ids is a live Shippo package (
no_goshippo_labels). - Fix
- Send ids of packages bought with Buy a shipping label.
- When
- A package has no label file (
label_fetch_failed, with{ id, reason }rows inerror.failed_packages). - Fix
- Leave out the listed packages and try again.
- When
- The merge failed (
pdf_merge_failed). This includes a label link that fails YoPrint's link check before the merge (it must be an http or https link whose host resolves only to public addresses): the message is "One or more labels couldn't be fetched from the carrier. Try again in a moment, or open each label from its package.",error.refused_label_hostslists the hosts, and no PDF is made rather than one with fewer labels. - Fix
- Try again in a moment. If it keeps failing, open each label from its package's
pdflink. - When
- More than 40 ids, or none (
validation_failed). - Fix
- Split the list into calls of 40.
Related
- POSTBuy a shipping label (charges your Shippo account)
/v2/ api/ store/ {team_slug}/ v2/ shipment/ {hash_id}/ label/ goshippo - GETList the packages of a shipment
/v2/ api/ store/ {team_slug}/ v2/ shipment/ {hash_id}/ packages
