API documentation
Overview
The Livrăria API lets you request quotes, generate AWBs, download labels and track parcels with all the couriers we work with, from your own system.
Base URL
All calls start from a single address. There is no version prefix in the path — the API version is 1.0, and breaking changes are announced in advance.
https://www.api.livraria.roRequests and responses are JSON (Content-Type: application/json), dates are ISO 8601 in UTC, and amounts are in RON. Creating a resource answers with 201, reads with 200.
The integration flow
A shipment is created in four calls. Steps 2 and 3 write onto the quote request, which is why step 4 sends nothing other than its identifier.
| Step | Call | Result |
|---|---|---|
| 1 | POST /public/awb/quotes | The quote request is saved and you receive quotes from each courier. Keep quoteRequest.id and courierQuotes[].id. |
| 2 | PUT /quote-request/{id}/selected-courier-quote | Fixes the chosen quote on the request. |
| 3 | POST /quote-request/{id}/billing-info | Attaches the billing details. |
| 4 | POST /expedition | Generates the AWB at the courier and returns the shipment. |
This is exactly the flow used by the official modules for Shopify, WooCommerce, PrestaShop and OpenCart. For details on each step, see Quotes, Preparing the order and Creating a shipment.
Authentication
All routes tied to your account require a credential in the Authorization header: an API key (company accounts) or a JWT obtained with the details of the Livrăria account, which you create once in the app.
Authorization: Bearer <accessToken>For a company integration we recommend an API key, which needs no password. A token from login is valid for 3600 seconds — keep it in memory for its whole lifetime and renew it or re-authenticate only when it expires. The details are on the Authentication page.
What works without authentication
A few routes are public, because you use them before you have an account or straight from your shop:
GET /public/couriers— the active couriers and which services each one supports.GET /public/location/*— counties, cities and postcodes.GET /pudo-points— lockers and pickup points.POST /public/awb/quick-quotes— indicative prices, without saving anything.GET /expedition/public/tracking— tracking with personal data masked, suited for your own “track your order” page.
Request limits
Limits apply per client, in a 60-second window. Exceeding them returns 429 Too Many Requests, with Retry-After in the header.
| Route | Limit |
|---|---|
POST /auth/login | 10 requests / minute |
GET /expedition/public/tracking | 30 requests / minute |
| Any other route | 120 requests / minute |
Responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, so you can tune your pace without waiting for a 429.
Errors
Errors have the standard NestJS shape. On validation, message is a list with every problem found, not just the first.
{
"statusCode": 400,
"message": [
"Greutatea nu poate depasi 100 kg",
"phoneNSN must be a valid Romanian number"
],
"error": "Bad Request"
}| Code | What it means |
|---|---|
| 400 | Validation failed. Read the list in `message` — it says exactly which field is at fault. |
| 401 | Token missing, expired or invalid. Re-authenticate and repeat the request. |
| 403 | The resource belongs to another account, or the account has a restriction (overdue unpaid invoice — the body carries `code: "BILLING_LOCKED"`). |
| 404 | The resource does not exist. |
| 409 | Conflict. On cancellation it means the parcel is already with the courier; on quote selection, that the shipment has already been created. |
| 410 | The selected quote has expired. Request a new quote. |
| 422 | The request is understood but cannot be carried out: the billing details are missing, or the courier requires a field the recipient does not have (`code: "RECIPIENT_FIELDS_REQUIRED"`). |
| 429 | You exceeded the request limit. |
| 5xx | An error on our side or the courier’s. It can be retried, with backoff — see the warning below. |
Complete example
The whole flow, from authentication to the label, with curl and jq:
# 1. Authentication — the token is valid for one hour
TOKEN=$(curl -s -X POST https://www.api.livraria.ro/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"integrare@firma.ro","password":"..."}' \
| jq -r .data.accessToken)
# 2. Quotes (the request is saved on the account)
QUOTE=$(curl -s -X POST https://www.api.livraria.ro/public/awb/quotes \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d @quote-body.json)
QR_ID=$(echo "$QUOTE" | jq -r .quoteRequest.id)
# The cheapest courier that can carry the parcel.
# Never without the isDisabled filter: a disabled quote has amount 0.
CQ_ID=$(echo "$QUOTE" | jq -r \
'[.courierQuotes[] | select(.isDisabled == false)]
| sort_by(.amount) | .[0].id')
# 3. Choose the courier
curl -X PUT "https://www.api.livraria.ro/quote-request/$QR_ID/selected-courier-quote" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"courierQuoteId\":\"$CQ_ID\"}"
# 4. Attach the billing details
curl -X POST "https://www.api.livraria.ro/quote-request/$QR_ID/billing-info" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Firma Mea SRL","email":"facturare@firma.ro",
"street":"Calea Victoriei 10","city":"Bucuresti","county":"BUCURESTI"}'
# 5. Create the shipment — the AWB is generated at the courier
AWB=$(curl -s -X POST https://www.api.livraria.ro/expedition \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"quoteRequestId\":\"$QR_ID\"}" | jq -r .awbNumber)
# 6. Download the label
curl -o label.pdf -H "Authorization: Bearer $TOKEN" \
"https://www.api.livraria.ro/public/awb/print/$AWB?format=pdf&paperSize=A6"Quick reference routes
/auth/loginpublic10/min/public/awb/quotesBearer JWT120/min/quote-request/{id}/selected-courier-quoteBearer JWT/quote-request/{id}/billing-infoBearer JWT/expeditionBearer JWT/public/awb/print/{awbNumber}Bearer JWT/public/awb/cancel/{awbNumber}Bearer JWT/expedition/public/trackingpublic30/minNeed help with the integration?
Tell us which system you are integrating and at which step you stopped. If you already have a call that fails, send us the request body and the response you got.
Contact us