API documentation
Creating a shipment
The last step of the flow. It turns a prepared quote request into a real shipment and generates the AWB at the chosen courier.
Creating
/expeditionBearer JWT120/minRequest body
| Field | Type | Required | Description |
|---|---|---|---|
quoteRequestId | string (UUID) | required | The quote request, with a selected quote and billing details attached. |
pickupDate | string (ISO 8601) | optional | The pickup date you ask the courier for. Leaving it out lets the courier schedule the pickup according to its own rules. |
notes | string | optional | Remarks for the shipment. |
{
"quoteRequestId": "3f9c1a34-7b2e-4d81-9f05-6c1e8a4b2d70",
"pickupDate": "2026-10-29T10:00:00.000Z",
"notes": "Fragil"
}{
"id": "9d1e5b77-4a02-4c31-8f6d-5b7e2a1c9043",
"awbNumber": "81356295593",
"trackingNumber": "81356295593",
"createdAt": "2026-10-28T09:05:12.000Z",
"courierId": "6577824a89f273256f8ff488",
"price": 18.95,
"status": {
"id": "a1b2c3d4-...",
"code": "NEW",
"label": "New Order",
"final": false
}
}Generating the AWB
The AWB is requested from the courier synchronously, during the call. Normally the response already contains awbNumber and trackingNumber. If the courier's system answers late, the shipment stays created with awbNumber: null, and the number is filled in when the courier answers.
Errors
| Code | What it means | What you do |
|---|---|---|
| 403 | Account blocked by an overdue unpaid invoice (the body carries code: "BILLING_LOCKED"). | Pay the overdue invoice. No shipment is created until then. |
| 422 | The billing details are missing, or the courier requires fields the recipient does not have (code: "RECIPIENT_FIELDS_REQUIRED"). | Fill in what is missing. In both cases no shipment was created. |
| 410 | The selected quote has expired (they are valid for 24 hours). | Start again from the quote request. |
| 5xx | An error on our side or the courier’s. | Look the shipment up by externalRef before retrying. |
Reading shipments
A single shipment
/expedition/{id}Bearer JWTThe full view, in a single call: current status and the status history, AWB and tracking number, courier, price, the pickup and delivery data reported by the courier, the parcels, the sender and the recipient with addresses, the cash on delivery and the declared value, the delivery type and the locker data. It also includes content.measuredTotalWeight — the weight measured by the courier, when it remeasured the parcel. It also carries clientReference, your reference, if you set one.
The list of shipments
/expeditionBearer JWTQuery parameters
| Field | Type | Required | Description |
|---|---|---|---|
page | number | optional | Default 1. |
limit | number | optional | Default 50, maximum 100. |
status | string | optional | One or more status codes, separated by commas. An unknown code returns 400, not an empty list. See the list of codes. |
search | string | optional | AWB, tracking number, clientReference, externalRef, sender/recipient details or a phone number. The phone is searched on the national number, so 0700000001, +40700000001 and 700000001 are equivalent. Terms with fewer than 6 digits are not treated as a phone. |
dateFrom / dateTo | string | optional | YYYY-MM-DD in Romanian time, or a full ISO 8601 moment. dateTo includes the whole day, not just midnight. |
courierId | string | optional | Only the shipments carried by this courier. |
{
"data": [
{
"id": "9d1e5b77-4a02-4c31-8f6d-5b7e2a1c9043",
"awbNumber": "81356295593",
"trackingNumber": "81356295593",
"createdAt": "2026-10-28T09:05:12.000Z",
"courierId": "6577824a89f273256f8ff488",
"price": 18.95,
"status": { "code": "IN_TRANSIT", "label": "In Transit", "final": false },
"clientReference": "FACT-2026-000123",
"courier": { "name": "Dpd", "slug": "dpd" },
"canCancel": false,
"cancelBlockedReason": "DSC_WINDOW_EXPIRED",
"cancelDeadline": "2026-10-28T09:35:12.000Z"
}
],
"meta": { "total": 1, "page": 1, "limit": 50, "totalPages": 1 }
}Lookup by tracking number
/expedition/tracking?trackingNumber={nr}Bearer JWTThe authenticated variant, with full data, only for your account's shipments. trackingNumber can be any code on the label: the AWB, the code of a parcel in a multi-parcel AWB (DPD, GLS, DHL) or the code of a Sameday parcel (the AWB followed by 3 digits). It returns 404 when none of your shipments matches. For your public page use the public route, which masks personal data.
curl -H "Authorization: Bearer $TOKEN" \
"https://www.api.livraria.ro/expedition/tracking?trackingNumber=81356295593"The response fields, flattened, for a packing desk
| Field | Type | Required | Description |
|---|---|---|---|
awbNumber | string | null | always | The AWB of the shipment. |
clientReference | string | null | optional | Your reference (“Client reference”). Null when you have not set one. |
externalRef | string | null | optional | The order reference set by the integration, for example SHOPIFY-1001. Null when there is none. |
shipmentNote | string | null | optional | The shipment’s note for the courier. |
packageDescription | string | null | optional | The contents, as the courier received them. |
recipientName | string | null | optional | The recipient’s name. |
cod | object | null | optional | The cash on delivery: amount and currency (default RON). Null when the parcel has no cash on delivery. |
status | object | always | code, label and final. |
createdAt | string | always | The moment the shipment was created. |
{
"id": "9d1e5b77-4a02-4c31-8f6d-5b7e2a1c9043",
"awbNumber": "81356295593",
"trackingNumber": "81356295593",
"createdAt": "2026-10-28T09:05:12.000Z",
"courierId": "6577824a89f273256f8ff488",
"price": 18.95,
"status": { "id": "a1b2c3d4-...", "code": "NEW", "label": "New Order", "final": false },
"clientReference": "FACT-2026-000123",
"externalRef": "API-10023",
"shipmentNote": "Sunati inainte de livrare",
"packageDescription": "Carti",
"recipientName": "Ion Popescu",
"cod": { "amount": 250, "currency": "RON" }
}Your reference on the shipment
clientReference (“Client reference”) is sent at creation, in the quote request, and comes back on the shipment: in the read of a shipment, in the list, in the lookup by tracking number and in your dashboard. It does not reach the courier.
/expedition/{id}/client-referenceBearer JWTSets or clears the reference of one of your shipments, in any status other than deleted. null or an empty value clears it. At most 100 characters (otherwise 400). It returns 404 for a shipment that is not yours or is deleted.
{ "clientReference": "FACT-2026-000123" }{
"id": "9d1e5b77-4a02-4c31-8f6d-5b7e2a1c9043",
"clientReference": "FACT-2026-000123"
}The cancellation fields
Any shipment read through the API carries three fields that say whether it can still be cancelled. You read them before offering a cancel button, so that you do not propose an action that will fail:
| Field | Type | Required | Description |
|---|---|---|---|
canCancel | boolean | always | Whether the shipment can be cancelled right now. |
cancelBlockedReason | string | null | when canCancel is false | The reason, in machine-readable form — for example DSC_WINDOW_EXPIRED. |
cancelDeadline | string | null | optional | The moment the cancellation window closes. Null when the courier imposes no time limit. |
The cancellation itself is described in AWB labels and cancellation.