Print AWB labels β Client & B2B Integration
Renders one or more shipment documents as JSON, standalone HTML, or PDF in a single bulk request.
Authentication & scope β Authenticate with either a client JWT (Authorization: Bearer β¦) or a B2B API key (X-API-Key: β¦). The tenant scope is derived server-side from the credential: a client owner is scoped to all sub-accounts under their mainAccountId; an API key is scoped to its bound sub-account. AWBs outside that scope are rejected with 403 β never silently dropped.
Document types β documentType selects what to print: label (the 4Γ6 thermal sticker, the default) or waybill (the full A4 carrier document with terms and a signature block). The catalogue is data β operators can add types without a release, so treat this as an open string and read GET /awb-management/document-types for the live list rather than hardcoding an enum.
Which design gets used β omit definitionId and the engine resolves: the account's default design for this document type β the company-wide default. Page size, theme and field placement all come from that design, which is why pageSize is deprecated and ignored.
Formats β html returns a fully self-contained document (inline CSS + base64 barcode/QR); json returns the resolved fields grouped by section plus the design that produced them; pdf returns a print-ready binary.
cURL
# With a client JWT, use -H 'Authorization: Bearer <JWT>' instead of the X-API-Key header.
curl -X POST 'https://core.absegy.com/api/v1/shipments/print' \
-H 'X-API-Key: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{ "trackingNumbers": ["LVN6018056","LVN6018057"], "documentType": "label", "format": "html", "lang": "en" }' \
-o labels.html
Axios (TypeScript)
import axios from 'axios';
// With a client JWT, use -H 'Authorization: Bearer <JWT>' instead of the X-API-Key header.
const { data: html } = await axios.post(
'https://core.absegy.com/api/v1/shipments/print',
{ trackingNumbers: ['LVN6018056', 'LVN6018057'], documentType: 'label', format: 'html', lang: 'en' },
{ headers: { 'X-API-Key': process.env.ABS_API_KEY }, responseType: 'text' },
);
// Embed offline β fully self-contained:
document.querySelector('#awb-frame').srcdoc = html;
Requestβ
Responsesβ
200 OK
Rendered AWBs. The Content-Type mirrors the requested format: application/json (data envelope), text/html (standalone document), or application/pdf (binary).
400 Bad Request
Validation failed β empty/oversized tracking list, duplicates, or bad enum value.
401 Unauthorized
Missing or invalid credentials (JWT or API key).
403 Forbidden
One or more tracking numbers are outside the callerβs tenant scope, or the account has no linked sub-account.
404 Not Found
Unknown documentType, a definitionId that does not exist or does not belong to that document type, no printable design configured for the document type, or none of the tracking numbers resolve to a printable shipment.
500 Internal Server Error
Unexpected server error while resolving or rendering the labels.
501
PDF rendering is not enabled on this deployment yet β use format: "html".