Quickstart
- In the Pakkeshopper app in Shopify, go to Settings → API and click Create API key. Name the key after the system that uses it, for example "ERP". The key is shown only once: copy it into your secrets store now.
- Send the key in the
Authorizationheader of every request:
curl https://app.pakkeshopper.dk/v1/carriers \
-H "Authorization: Bearer $PAKKESHOPPER_API_KEY"
A booking to a pickup point then takes four calls:
- GET /carriers: the carriers the shop can book with, and the delivery types of each one.
- GET /pickup-points: the points nearest to the customer's address.
- POST /labels: book the label. Add
printto send it to a label printer at once. - GET /print-jobs/{id}: follow the print job until it is
printed.
Authentication
Every request needs an API key in the Authorization header, with the Bearer scheme:
Authorization: Bearer psk_...
- A key acts for one shop. A shop can have 10 keys.
- The key is shown once, when you create it. After that the app shows only its name and its last four characters. If you lose a key, revoke it and create a new one.
- When you revoke a key, everything that uses it stops at once.
- Keep the key on your server. Anyone with the key can book labels for the shop, so never put it in a browser page or a mobile app.
- The API needs the Max plan or higher. Below Max the keys are kept, and every call answers 403
plan_not_available.
A key that is missing, wrong or revoked, or a shop that has uninstalled the app, answers 401 unauthorized.
Requests
The base URL is https://app.pakkeshopper.dk/v1. Use HTTPS.
- Send a request body as JSON in UTF-8, uncompressed, with
Content-Type: application/json. - Percent-encode query values as UTF-8:
N%C3%B8rregadeforNørregade. The HTTP server refuses a URL with a raw non-ASCII character with a 400 that has no error body. - Country codes have two letters (ISO 3166-1), for example
DK. Weights are in kilograms. Times are ISO 8601, for example2026-11-23T09:41:00Z.
Responses and errors
A success has its result under data:
{ "data": { "id": "6f1c2a9e-4b7d-4e2a-9c3f-1d8e5b7a2c40" } }
A failure has a 4xx or 5xx status and an error object:
{
"error": {
"code": "invalid_request",
"message": "pickup_point_id is required for a pickup delivery",
"fields": { "pickup_point_id": "required" }
}
}
- Branch on the status and the
code, never on themessage. The message is for people and can change. fieldsnames each field at fault and why:required,too_long,invalidorstore_country. A nested field has a path, for examplerecipient.zip.- A carrier that refuses a booking gives 422
carrier_error. Itsmessageis the carrier's own, and the error also hascarrierandtrace_id. Send thetrace_idwhen you ask us about a booking.
These errors can come from more than one endpoint:
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request |
A parameter or a field is missing or not valid (see fields), or the body is not valid JSON. |
| 401 | unauthorized |
The key is missing, wrong or revoked, or the shop has uninstalled the app. |
| 403 | plan_not_available |
The shop is below the Max plan. |
| 404 | not_found |
The path does not exist. A missing resource has its own code, for example label_not_found. |
| 413 | payload_too_large |
The body is too large. |
| 415 | invalid_request |
The body is not application/json, is compressed (Content-Encoding) or is not UTF-8. |
| 429 | rate_limited |
Too many requests. See Rate limits. |
Each endpoint lists all of its answers under Responses.
Rate limits
Each key has two limits per 10 minutes:
- 300 requests to all endpoints together.
- 100 booking attempts with
POST /labels.
Every POST /labels is a booking attempt, also when the carrier refuses it, when a recipient field is at fault and when the carrier is not connected. A request that is refused before the booking does not count: a body that is not a JSON object, print or pickup_point_id at fault, an unknown printer, or an Idempotency-Key that is at fault, still in progress or replayed.
Over a limit, the API answers 429 rate_limited with a Retry-After header. Wait the number of seconds it gives, then try again. The replay of a booked label is answered even past both limits (see Idempotency).
An address that keeps sending keys that are not valid also gets 429.
Idempotency
A request to POST /labels can time out after the carrier booked the parcel. To retry without a second parcel, send an Idempotency-Key header with a value that is unique for the parcel, for example your order number and the parcel number:
Idempotency-Key: order-1001-parcel-1
- The answer of a booking is kept under the key for 24 hours, per API key. A retry with the same key and the same body gets the first answer again and books nothing.
- The same key with another body answers 422
idempotency_key_reused. - While the first request still runs, a retry answers 409
request_in_progress. Wait, then try again. - A refusal is not kept. When you have fixed the cause, you can send the same key again.
- The key has 1 to 255 characters.
A 500 booking_not_stored means that the carrier booked the parcel, but the label could not be stored. Do not book it again. The error has the carrier, the tracking_number and the trace_id of the parcel. A retry with the same key gets the same answer. Any other 500 booked nothing, and so does a 503 (idempotency_unavailable or shop_address_unavailable): try again.
Pagination
GET /labels gives one page at a time, newest first. Set limit (1 to 50, default 25) and offset. The answer tells if there are more:
{ "data": [], "has_more": true, "offset": 0, "limit": 25 }
For the next page, add limit to offset.
Printing
The API prints through Print Agent, the free desktop app for Windows and Mac that sends labels to the shop's label printers.
- GET /printers lists the computers that run Print Agent. Each one has
queues: the printers it reported. - To print a new label, add
printwith aprinter_idto POST /labels. To print a stored label, use POST /labels/{id}/print. Without aqueuethe printer's default queue is used. - Follow the job with GET /print-jobs/{id}. Its
statusgoes frompendingtosentandprinted, or ends aserrororexpired.
A computer that has not been seen for 5 minutes is offline. A job for an offline computer waits up to 12 hours.
An unknown printer_id on POST /labels answers 404 printer_not_found, and nothing is booked. When the label is booked but cannot be queued, the answer is 201 with print_error. You can print the label later.
Every label also has a pdf_url, which opens the PDF without a key for 24 hours. GET /labels/{id} gives a fresh one, and GET /labels/{id}/pdf gives the PDF itself.
Labels without an order
A label booked through the API has no Shopify order: nothing is captured or fulfilled, and Pakkeshopper does not follow its tracking number. The app lists it on the Create label page, with the labels made there.
Version 1 does not do these things:
- Labels for Shopify orders. Print those from the order in Shopify or in the warehouse app.
- Several parcels in one request.
- Tracking and webhooks.
- Changes to settings and shipping methods.