API reference

Parcel label (PDF)

Download a single parcel's printable label as a PDF, rendered from your organization's own default parcel label template (the full sticker). Address the parcel by EITHER its merchant_tracking (the sticker code) OR its parcel_id (our parcel id — the value returned as items[].parcel_id when you create the order). The response is the PDF itself (application/pdf, served inline), not JSON. Requires the labels:read scope, and only ever returns labels for your own parcels (an unknown reference 404s).

Download a parcel label

GET/api/v1/orders/label

Query (send exactly one)

merchant_trackingstringoptional
The parcel's physical sticker code. Takes precedence over parcel_id.
parcel_idstringoptional
Our parcel id — the items[].parcel_id (Starmile tracking number) returned on create, e.g. STM0000000121.
# By merchant_tracking (the barcode you sent on create):
curl -G https://api.starmile.io/api/v1/orders/label \
  -H 'Authorization: Bearer <access_token>' \
  -H 'Accept: application/pdf' \
  --data-urlencode 'merchant_tracking=CN773300012345' \
  -o label.pdf

# Or by parcel_id (our parcel id — items[].parcel_id from the create response):
curl -G https://api.starmile.io/api/v1/orders/label \
  -H 'Authorization: Bearer <access_token>' \
  --data-urlencode 'parcel_id=STM0000000121' \
  -o label.pdf