Documentația completă a API-ului Shipo: autentificare, endpoint-uri, parametri, exemple de cod și răspunsuri. Integrează platforma în aplicația ta și automatizează expedierea coletelor.
API-ul Shipo permite integrarea programatică cu platforma noastră de expediții. Prin intermediul acestui API poți crea expedieri, calcula tarife, gestiona adrese și urmări colete.
https://api.shipo.ro/
API-ul folosește autentificare în doi pași:
auth_key) prin endpoint-ul /authAuthorization pentru toate celelalte request-uriToate răspunsurile sunt în format JSON. Răspunsurile de succes includ de obicei un câmp success: true, iar erorile includ un câmp message cu detalii despre eroare.
| Cod | Descriere |
|---|---|
| 200 | Request procesat cu succes |
| 400 | Request invalid (date lipsă sau incorecte) |
| 401 | Neautorizat (token lipsă sau invalid) |
| 403 | Acces interzis (cheie API invalidă) |
| 405 | Metodă HTTP nepermisă |
| 500 | Eroare internă server |
Pentru a accesa API-ul, trebuie mai întâi să obții un token de acces. Cheia API o poți genera din Setări → API.
Trimite cheia ta API în header-ul auth_key pentru a primi un token de acces valid 1 oră.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
auth_key |
string | Da | Cheia ta de autentificare API, generată din setări |
// Obține access token
fetch("https://api.shipo.ro/auth", {
method: "POST",
headers: {
"auth_key": "CHEIA_TA_API"
}
})
.then(response => response.json())
.then(data => {
console.log("Access Token:", data.access_token);
console.log("Expiră în:", data.expires_in, "secunde");
});
$ch = curl_init("https://api.shipo.ro/auth");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"auth_key: CHEIA_TA_API"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
echo $response["access_token"];
echo $response["expires_in"]; // 3600 secunde
{
"access_token": "eyJhbGciOiJIUzI1NiIsIn...",
"expires_in": 3600
}
{ "error": "Unauthorized" }
{ "error": "Invalid AUTH_KEY" }
Authorization la fiecare request:Authorization: Bearer TOKEN_PRIMIT
Endpoint-uri pentru obținerea informațiilor despre contul tău și lista adreselor de ridicare.
Returnează informațiile de bază ale contului tău.
fetch("https://api.shipo.ro/client", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/client");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{
"id": 123,
"billing_type": "prepaid",
"name": "Ion Popescu",
"email": "[email protected]",
"status": "active",
"coord": [26.1027200000, 44.4361410000]
}
| Câmp | Tip | Descriere |
|---|---|---|
id | integer | ID-ul unic al clientului |
billing_type | string | Tipul de facturare: prepaid sau postpaid |
name | string | Numele clientului |
email | string | Email-ul clientului |
status | string | Statusul contului |
coord | array | Coordonatele implicite [longitudine, latitudine] |
Returnează lista tuturor adreselor de ridicare (sender) asociate contului tău. Folosește id-ul adresei ca sender_address_id la crearea expedierilor.
fetch("https://api.shipo.ro/client/address_list", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/client/address_list");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
[
{
"id": 1,
"client_id": 123,
"party": "sender",
"alias": "Sediu",
"name": "Ion Popescu",
"company_name": "SC Exemplu SRL",
"phone": "0712345678",
"address_city_id": 16404,
"address_street_id": 5001,
"address_street_no": "10"
}
]
Caută și găsește ID-ul orașului necesar pentru celelalte endpoint-uri.
Caută orașe după nume. Returnează o listă de orașe care corespund termenului, inclusiv coordonatele geografice.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
term | string | Da | Termenul de căutare (min. 2, max. 100 caractere) |
fetch("https://api.shipo.ro/city?term=Bucuresti", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/city?" . http_build_query(["term" => "Bucuresti"]));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
[
{
"id": 16404,
"label": "Bucuresti, Bucuresti",
"value": "Bucuresti",
"county": "Bucuresti",
"coord": [26.1027200000, 44.4361410000]
}
]
Caută străzi într-un anumit oraș. Rezultatele pot fi folosite ca sender_address_street_id sau recipient_address_street_id.
Caută străzi după nume într-un anumit oraș.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
term | string | Da | Numele străzii (min. 2, max. 100 caractere) |
city | string | Da | Numele orașului în care se caută strada |
fetch("https://api.shipo.ro/address?term=Victoriei&city=Bucuresti", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$query = http_build_query(["term" => "Victoriei", "city" => "Bucuresti"]);
$ch = curl_init("https://api.shipo.ro/address?" . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
[
{
"id": 5001,
"label": "Calea Victoriei",
"value": "Calea Victoriei"
}
]
Obține lista curierilor disponibili și serviciile lor.
Returnează lista curierilor activi împreună cu serviciile lor. Poți filtra după tipul adresei expeditorului.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
sender_address_type | string | Nu | Filtrează: address, locker, pudo |
fetch("https://api.shipo.ro/couriers", {
method: "POST",
headers: {
"Authorization": "Bearer TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
sender_address_type: "address"
})
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/couriers");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"sender_address_type" => "address"
])
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
[
{
"id": 1,
"name": "FAN Courier",
"slug": "fancourier",
"enabled": true,
"logo": "https://shipo.ro/assets/couriers/icon-square-fancourier.jpg",
"services": [
{
"id": 10,
"courier_id": 1,
"type": "standard",
"sender_address_type": "address",
"recipient_address_type": "address",
"description": "Livrare standard la adresă"
}
]
}
]
Calculează tarifele de expediere și obține lista serviciilor disponibile.
Returnează toate serviciile de expediere. Folosește id-ul ca rate_id la crearea expedierilor.
fetch("https://api.shipo.ro/rates/services", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/rates/services");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
[
{
"id": 10,
"courier_id": 1,
"type": "standard",
"sender_address_type": "address",
"recipient_address_type": "address",
"description": "Livrare standard la adresă"
}
]
| Câmp | Tip | Descriere |
|---|---|---|
id | integer | ID serviciu (folosește ca rate_id) |
courier_id | integer | ID curier |
type | string | Tipul serviciului |
sender_address_type | string | address, locker, pudo |
recipient_address_type | string | address, locker, pudo |
description | string | Descrierea serviciului |
Calculează tarifele de expediere în funcție de rută și colete.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
sender_city | integer | Da | ID adresă ridicare (din /client/address_list) |
delivery_city | string | Da | Orașul de livrare |
cod | float | Nu | Valoare ramburs (0 dacă nu se aplică) |
parcels | array | Nu | Lista coletelor. Implicit: 1 colet 30x20x10cm, 1kg |
courier | array | Nu | Filtrare după slug curier (ex: ["fancourier"]) |
sender_type | string | Nu | Filtrare: address sau locker |
| Câmp | Tip | Descriere |
|---|---|---|
length | integer | Lungime cm (implicit: 30) |
width | integer | Lățime cm (implicit: 20) |
height | integer | Înălțime cm (implicit: 10) |
weight | integer | Greutate kg (implicit: 1) |
fetch("https://api.shipo.ro/rates", {
method: "POST",
headers: {
"Authorization": "Bearer TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
sender_city: 1,
delivery_city: "Cluj-Napoca",
cod: 150.00,
parcels: [
{ length: 30, width: 20, height: 15, weight: 2 }
]
})
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/rates");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"sender_city" => 1,
"delivery_city" => "Cluj-Napoca",
"cod" => 150.00,
"parcels" => [
["length" => 30, "width" => 20, "height" => 15, "weight" => 2]
]
])
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{
"10": {
"rate_id": 10,
"courier_slug": "fancourier",
"courier_name": "FAN Courier",
"service_type": "standard",
"total_fee": 15.50,
"is_cod_available": true
},
"15": {
"rate_id": 15,
"courier_slug": "dpd",
"courier_name": "DPD",
"service_type": "standard",
"total_fee": 14.80,
"is_cod_available": true
}
}
{
"success": false,
"message": "No couriers deliver this shipment"
}
Creează, validează, trimite și anulează expedieri.
Returnează lista paginată a expedierilor contului autentificat. Maxim 500 expedieri per pagină.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
page_no | integer | Nu | Numărul paginii (default 1, min 1, max 100000) |
per_page | integer | Nu | Expedieri per pagină (default 100, min 1, max 500) |
status_order | string | Nu | Filtru pe status comandă: completed, paid, finalized, canceled, refunded |
status_delivery | string | Nu | Filtru pe status livrare: order_placed, collected, in_transit, out_for_delivery, delivered, canceled, dropoff_locker, dropoff_pudo, loaded_locker, loaded_pudo, return_to_sender |
awb | string | Nu | Filtru pe AWB exact (max 20 caractere alfanumerice) |
from | string | Nu | Data minimă placed_on (format YYYY-MM-DD) |
to | string | Nu | Data maximă placed_on (format YYYY-MM-DD) |
fetch("https://api.shipo.ro/shipments?page_no=1&per_page=100&status_delivery=delivered&from=2026-01-01&to=2026-04-29", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/shipments?page_no=1&per_page=100&status_delivery=delivered&from=2026-01-01&to=2026-04-29");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{
"success": true,
"pagination": {
"page": 1,
"per_page": 100,
"total": 237,
"total_pages": 3
},
"data": [
{
"id": 12345,
"awb": "2150012345678",
"order_id": "PICKUP-9876",
"courier": "fancourier",
"courier_name": "FAN Courier",
"status_order": "paid",
"status_delivery": "delivered",
"is_return": false,
"cost": 19.99,
"cod": 250.00,
"weight": 3,
"weight_initial": 3,
"parcel_count": 2,
"IBAN": "RO12BREL0005123456789012",
"account_holder": "SC Exemplu SRL",
"open_on_delivery": true,
"insurance": true,
"declared_value": 500,
"is_recalculated": false,
"is_reweighed": false,
"is_atypical": false,
"is_bnpl": false,
"is_oversized": false,
"is_redirected": false,
"is_quick_cod": false,
"contents": "Electronice",
"note": "Fragil",
"placed_on": "2026-04-15 12:34:56",
"added_on": "2026-04-15 12:30:00",
"label_a4": "https://shipo.ro/downloader/awb/label_a4_12345.pdf",
"label_a6": "https://shipo.ro/downloader/awb/label_a6_12345.pdf",
"sender": {
"name": "Ion Popescu",
"company_name": "SC Exemplu SRL",
"email": "[email protected]",
"phone": "0712345678",
"address": "Strada Exemplu nr. 10, Bucuresti",
"address_type": "address",
"address_country": "Romania",
"address_county": "Bucuresti",
"address_municipality": "Bucuresti",
"address_city": "Bucuresti",
"address_sector": "1",
"address_street": "Strada Exemplu",
"address_street_type": "Strada",
"address_street_no": "10",
"address_building": "",
"address_entrance": "",
"address_floor": "",
"address_apartment": "",
"address_postal_code": "010101",
"address_intercom": "",
"address_note": ""
},
"recipient": {
"name": "Maria Ionescu",
"company_name": "",
"email": "[email protected]",
"phone": "0723456789",
"address": "Strada Florilor nr. 25, Cluj-Napoca",
"address_type": "address",
"address_country": "Romania",
"address_county": "Cluj",
"address_municipality": "Cluj-Napoca",
"address_city": "Cluj-Napoca",
"address_sector": "",
"address_street": "Strada Florilor",
"address_street_type": "Strada",
"address_street_no": "25",
"address_building": "",
"address_entrance": "",
"address_floor": "",
"address_apartment": "",
"address_postal_code": "400123",
"address_intercom": "",
"address_note": ""
},
"parcels": [
{ "weight": 3, "initial_weight": 3, "length": 40, "width": 30, "height": 20 },
{ "weight": 1, "initial_weight": 1, "length": 20, "width": 15, "height": 10 }
]
}
]
}
is_return = true){
"id": 12346,
"is_return": true,
"pending_approval": false,
"return_reason": "Produs deteriorat",
"return_IBAN": "RO12BREL0005987654321098",
"return_account_holder": "Andrei Popa"
}
| Câmp | Tip | Descriere |
|---|---|---|
| Răspuns top-level | ||
success | boolean | Dacă operația a reușit |
pagination.page | integer | Pagina curentă |
pagination.per_page | integer | Expedieri per pagină |
pagination.total | integer | Total expedieri pentru filtrele selectate |
pagination.total_pages | integer | Total pagini disponibile |
data | array | Lista expedierilor (sortate după placed_on descrescător) |
| Identificatori | ||
data[].id | integer | ID expediție Shipo |
data[].awb | string | Numărul AWB (gol dacă nu s-a generat încă) |
data[].order_id | string | ID-ul ridicării (pickup ID-ul atribuit de curier) |
data[].courier | string | Slug curier (ex: fancourier, cargus, dpd) |
data[].courier_name | string | Nume curier |
| Statusuri | ||
data[].status_order | string | Status comandă (completed, paid, finalized, canceled, refunded) |
data[].status_delivery | string | Status livrare (order_placed, collected, in_transit, out_for_delivery, delivered, canceled, dropoff_locker, dropoff_pudo, loaded_locker, loaded_pudo, return_to_sender) |
| Date generale | ||
data[].is_return | boolean | Dacă expedierea este retur |
data[].cost | float | Cost total expediere (RON) |
data[].cod | float | Valoare ramburs (RON) |
data[].weight | float | Greutate totală curentă (kg) |
data[].weight_initial | float | Greutate totală inițială (kg) |
data[].parcel_count | integer | Număr colete |
data[].IBAN | string | IBAN pentru ramburs (gol dacă nu este COD) |
data[].account_holder | string | Titular cont IBAN |
data[].declared_value | float | Valoare declarată (RON) |
data[].contents | string | Conținut colet |
data[].note | string | Observații |
data[].placed_on | string | Data plasare AWB (YYYY-MM-DD HH:MM:SS) |
data[].added_on | string | Data creare în sistem |
data[].label_a4 | string|null | URL etichetă A4 |
data[].label_a6 | string|null | URL etichetă A6 |
| Servicii extra (boolean) | ||
data[].open_on_delivery | boolean | Deschidere la livrare |
data[].insurance | boolean | Asigurare colet |
| Flag-uri stare (boolean) | ||
data[].is_recalculated | boolean | Expedierea a fost recalculată |
data[].is_reweighed | boolean | Recalcularea a inclus o re-cântărire |
data[].is_atypical | boolean | Colet atipic |
data[].is_bnpl | boolean | Plată după livrare (Buy Now Pay Later) |
data[].is_oversized | boolean | Colet supradimensionat |
data[].is_redirected | boolean | Expediție redirecționată |
data[].is_quick_cod | boolean | Ramburs rapid |
Date expeditor (data[].sender) | ||
sender.name | string | Nume complet |
sender.company_name | string | Companie |
sender.email | string | |
sender.phone | string | Telefon |
sender.address | string | Adresă concatenată |
sender.address_type | string | Tip adresă: address, locker, pudo |
sender.address_country | string | Țară |
sender.address_county | string | Județ |
sender.address_municipality | string | Municipiu / oraș principal |
sender.address_city | string | Localitate |
sender.address_sector | string | Sector (1-6, doar București) |
sender.address_street | string | Stradă |
sender.address_street_type | string | Tip stradă (Strada, Bulevard, etc.) |
sender.address_street_no | string | Număr stradă |
sender.address_building | string | Bloc |
sender.address_entrance | string | Scara |
sender.address_floor | string | Etaj |
sender.address_apartment | string | Apartament |
sender.address_postal_code | string | Cod poștal |
sender.address_intercom | string | Interfon |
sender.address_note | string | Observații adresă |
Date destinatar (data[].recipient) | ||
Aceleași câmpuri ca sender, prefixate recipient. | ||
Colete (data[].parcels) | ||
parcels[].weight | float | Greutate curentă (kg) |
parcels[].initial_weight | float | Greutate inițială (kg) |
parcels[].length | float | Lungime (cm) |
parcels[].width | float | Lățime (cm) |
parcels[].height | float | Înălțime (cm) |
Câmpuri retur (doar dacă is_return = true) | ||
data[].pending_approval | boolean | Returul este în așteptare aprobare |
data[].return_reason | string | Motivul returului |
data[].return_IBAN | string | IBAN-ul clientului care a inițiat returul |
data[].return_account_holder | string | Titular cont IBAN client retur |
{
"success": false,
"message": "Validation failed",
"errors": {
"per_page": ["Câmpul per_page nu poate fi mai mare decât 500."]
}
}
Creează o nouă expediere. Răspunsul conține AWB-ul și link-urile pentru etichete.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
| Informații generale | |||
rate_id | integer | Da | ID serviciu curierat (din /rates/services) |
contents | string | Da | Conținut colet (max. 40 car., alfanumeric) |
note | string | Nu | Observații (max. 40 car.) |
parcels | array | Da | Lista coletelor (length, width, height, weight) |
| Servicii extra | |||
cod | float | Nu | Valoare ramburs. Contul tău trebuie să aibă IBAN și Titular cont completate în setări |
insurance | boolean | Nu | Asigurare colet |
declared_value | float | Condiționat | Obligatoriu dacă insurance=true. Între 1 și 5000 |
open_on_delivery | boolean | Nu | Deschidere la livrare |
notify_recipient | boolean | Nu | Notificare destinatar prin SMS la generarea AWB-ului |
| Adresa expeditor | |||
sender_address_id | integer|string | Condiționat | ID adresă salvată. Obligatoriu pt locker/pudo. Dacă specificat, câmpurile de adresă nu mai sunt necesare. |
sender_company_name | string | Nu | Companie expeditor (max. 35 car.) |
sender_name | string | Condiționat | Nume complet (max. 48 car.) |
sender_phone | integer|string | Condiționat | Telefon (max. 48 car.) |
oras_plecare | string | Condiționat | Oraș expeditor (sau sender_address_city_id) |
sender_address_city_id | integer | Condiționat | ID oraș expeditor (sau oras_plecare) |
sender_address_sector | integer | Condiționat | Sector 1-6. Obligatoriu pt București |
sender_address_street_id | integer | Condiționat | ID stradă (sau strada_plecare) |
strada_plecare | string | Condiționat | Stradă text liber (max. 48 car.) |
sender_address_street_no | integer|string | Condiționat | Nr. stradă (max. 10 car.). Obligatoriu dacă nu se folosește sender_address_id |
sender_address_building | integer|string | Nu | Bloc (max. 10 car.) |
sender_address_entrance | integer|string | Nu | Scara (max. 10 car.) |
sender_address_floor | integer|string | Nu | Etaj (max. 10 car.) |
sender_address_apartment | integer|string | Nu | Apartament (max. 10 car.) |
sender_address_postal_code | integer|string | Nu | Cod poștal (exact 6 cifre) |
| Adresa destinatar | |||
recipient_address_id | integer|string | Condiționat | ID punct livrare. Obligatoriu pt locker/pudo |
recipient_company_name | string | Nu | Companie destinatar (max. 35 car.) |
recipient_name | string | Da | Nume complet (max. 48 car.) |
recipient_phone | integer|string | Da | Telefon (max. 48 car.) |
recipient_email | string | Condiționat | Email (max. 80 car.). Obligatoriu pt locker/pudo |
oras_sosire | string | Condiționat | Oraș destinatar (sau recipient_address_city_id) |
recipient_address_city_id | integer | Condiționat | ID oraș (sau oras_sosire) |
recipient_address_sector | integer | Condiționat | Sector 1-6. Obligatoriu pt București |
recipient_address_street_id | integer | Condiționat | ID stradă (sau strada_sosire) |
strada_sosire | string | Condiționat | Stradă text liber (max. 48 car.) |
recipient_address_street_no | integer|string | Condiționat | Nr. stradă (max. 10 car.). Obligatoriu dacă nu se folosește recipient_address_id |
recipient_address_building | integer|string | Nu | Bloc (max. 10 car.) |
recipient_address_entrance | integer|string | Nu | Scara (max. 10 car.) |
recipient_address_floor | integer|string | Nu | Etaj (max. 10 car.) |
recipient_address_apartment | integer|string | Nu | Apartament (max. 10 car.) |
recipient_address_postal_code | integer|string | Nu | Cod poștal (exact 6 cifre) |
| Metadate | |||
meta | object | Nu | Info suplimentare (os_type, os_version, utm_url) |
sender_address_id (din /client/address_list), câmpurile individuale de adresă nu mai sunt necesare. Pentru locker/pudo, folosește recipient_address_id.fetch("https://api.shipo.ro/shipment", {
method: "POST",
headers: {
"Authorization": "Bearer TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
rate_id: 10,
contents: "Haine",
sender_address_id: 1,
recipient_name: "Maria Ionescu",
recipient_phone: "0723456789",
oras_sosire: "Cluj-Napoca",
recipient_address_street_id: 3001,
recipient_address_street_no: "15",
parcels: [
{ length: 30, width: 20, height: 10, weight: 1 }
]
})
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/shipment");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"rate_id" => 10,
"contents" => "Haine",
"sender_address_id" => 1,
"recipient_name" => "Maria Ionescu",
"recipient_phone" => "0723456789",
"oras_sosire" => "Cluj-Napoca",
"recipient_address_street_id" => 3001,
"recipient_address_street_no" => "15",
"parcels" => [
["length" => 30, "width" => 20, "height" => 10, "weight" => 1]
]
])
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
fetch("https://api.shipo.ro/shipment", {
method: "POST",
headers: {
"Authorization": "Bearer TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
rate_id: 10,
contents: "Electronice",
note: "Fragil",
cod: 250.00,
insurance: true,
declared_value: 500,
open_on_delivery: true,
notify_recipient: true,
sender_name: "Ion Popescu",
sender_phone: "0712345678",
sender_company_name: "SC Exemplu SRL",
oras_plecare: "Bucuresti",
sender_address_sector: 1,
sender_address_street_id: 5001,
sender_address_street_no: "10",
recipient_name: "Maria Ionescu",
recipient_phone: "0723456789",
recipient_email: "[email protected]",
oras_sosire: "Cluj-Napoca",
recipient_address_street_id: 3001,
recipient_address_street_no: "25",
parcels: [
{ length: 40, width: 30, height: 20, weight: 3 },
{ length: 20, width: 15, height: 10, weight: 1 }
]
})
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/shipment");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"rate_id" => 10,
"contents" => "Electronice",
"note" => "Fragil",
"cod" => 250.00,
"insurance" => true,
"declared_value" => 500,
"open_on_delivery" => true,
"notify_recipient" => true,
"sender_name" => "Ion Popescu",
"sender_phone" => "0712345678",
"sender_company_name" => "SC Exemplu SRL",
"oras_plecare" => "Bucuresti",
"sender_address_sector" => 1,
"sender_address_street_id" => 5001,
"sender_address_street_no" => "10",
"recipient_name" => "Maria Ionescu",
"recipient_phone" => "0723456789",
"recipient_email" => "[email protected]",
"oras_sosire" => "Cluj-Napoca",
"recipient_address_street_id" => 3001,
"recipient_address_street_no" => "25",
"parcels" => [
["length" => 40, "width" => 30, "height" => 20, "weight" => 3],
["length" => 20, "width" => 15, "height" => 10, "weight" => 1]
]
])
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{
"success": true,
"expedition": 12345,
"awb": "2150012345678",
"label_a4": "https://shipo.ro/downloader/awb/label_a4_12345.pdf",
"label_a6": "https://shipo.ro/downloader/awb/label_a6_12345.pdf",
"message": "Shipment created successfully."
}
| Câmp | Tip | Descriere |
|---|---|---|
success | boolean | Dacă operația a reușit |
expedition | integer | ID expediție |
awb | string | Numărul AWB |
label_a4 | string | URL etichetă A4 |
label_a6 | string | URL etichetă A6 |
{
"success": false,
"message": "Validation failed",
"errors": {
"rate_id": ["Câmpul rate_id este obligatoriu."],
"contents": ["Câmpul contents este obligatoriu."]
}
}
Validează datele fără a crea expedierea. Aceiași parametri ca POST /shipment.
fetch("https://api.shipo.ro/shipment/validate", {
method: "POST",
headers: {
"Authorization": "Bearer TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
rate_id: 10,
contents: "Haine",
sender_address_id: 1,
recipient_name: "Maria Ionescu",
recipient_phone: "0723456789",
oras_sosire: "Cluj-Napoca",
recipient_address_street_id: 3001,
recipient_address_street_no: "15",
parcels: [{ length: 30, width: 20, height: 10, weight: 1 }]
})
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/shipment/validate");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"rate_id" => 10,
"contents" => "Haine",
"sender_address_id" => 1,
"recipient_name" => "Maria Ionescu",
"recipient_phone" => "0723456789",
"oras_sosire" => "Cluj-Napoca",
"recipient_address_street_id" => 3001,
"recipient_address_street_no" => "15",
"parcels" => [["length" => 30, "width" => 20, "height" => 10, "weight" => 1]]
])
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{ "success": true, "message": "Validation passed" }
{
"success": false,
"message": "Validation failed",
"errors": { "recipient_name": ["Câmpul recipient_name este obligatoriu."] }
}
Trimite o expediere existentă către curier.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
id | integer | Da | ID expediție (din răspunsul de creare) |
fetch("https://api.shipo.ro/shipment/send/12345", {
method: "POST",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/shipment/send/12345");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{
"success": true,
"ec": "1",
"expedition": 12345,
"awb": "2150012345678",
"label_a4": "https://shipo.ro/downloader/awb/label_a4_12345.pdf",
"label_a6": "https://shipo.ro/downloader/awb/label_a6_12345.pdf",
"message": "Shipment sent to courier successfully."
}
{
"success": false,
"ec": "1",
"expedition": 12345,
"message": "Shipment could not be sent to courier."
}
Anulează o expediere existentă folosind numărul AWB.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
awb | string | Da | Numărul AWB (2-100 caractere) |
fetch("https://api.shipo.ro/shipment/cancel/2150012345678", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/shipment/cancel/2150012345678");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{ "success": true, "message": "Shipment canceled successfully." }
{ "success": false, "message": "Shipment could not be canceled." }
{ "success": false, "message": "Shipment not found." }
Endpoint dedicat clienților care au magazine online asociate. Returnează retururile expediate către magazinele tale, inclusiv pe cele plătite de clientul care a inițiat returul (acelea nu apar în /shipments pentru că nu sunt asociate contului tău).
/shipments. Date sensibile precum IBAN-ul, costul expedierii, valoarea rambursului și flag-urile de stare sunt omise, deoarece returul poate aparține altui client.
Returnează lista paginată a retururilor expediate către magazinele online asociate contului autentificat. Maxim 500 retururi per pagină. Sortate descrescător după placed_on.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
page_no | integer | Nu | Numărul paginii (default 1, min 1, max 100000) |
per_page | integer | Nu | Retururi per pagină (default 100, min 1, max 500) |
status_order | string | Nu | Filtru pe status comandă: completed, paid, finalized, canceled, refunded |
status_delivery | string | Nu | Filtru pe status livrare: order_placed, collected, in_transit, out_for_delivery, delivered, canceled, dropoff_locker, dropoff_pudo, loaded_locker, loaded_pudo, return_to_sender |
awb | string | Nu | Filtru pe AWB exact (max 20 caractere alfanumerice) |
from | string | Nu | Data minimă placed_on (format YYYY-MM-DD) |
to | string | Nu | Data maximă placed_on (format YYYY-MM-DD) |
pending_approval | boolean | Nu | Filtrează după starea de aprobare: 1 sau true pentru retururi în așteptare aprobare, 0 sau false pentru cele deja procesate |
fetch("https://api.shipo.ro/store-returns?page_no=1&per_page=100&pending_approval=1", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/store-returns?page_no=1&per_page=100&pending_approval=1");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{
"success": true,
"pagination": {
"page": 1,
"per_page": 100,
"total": 18,
"total_pages": 1
},
"data": [
{
"id": 12345,
"awb": "2150012345678",
"order_id": "PICKUP-9876",
"courier": "fancourier",
"courier_name": "FAN Courier",
"status_order": "paid",
"status_delivery": "delivered",
"is_return": true,
"belongs_to_store": false,
"pending_approval": false,
"return_reason": "Produs deteriorat",
"weight": 3,
"parcel_count": 2,
"contents": "Electronice",
"note": "Fragil",
"placed_on": "2026-04-15 12:34:56",
"added_on": "2026-04-15 12:30:00",
"sender": {
"name": "Maria Ionescu",
"company_name": "",
"email": "[email protected]",
"phone": "0723456789",
"address": "Strada Florilor nr. 25, Cluj-Napoca",
"address_type": "address",
"address_country": "Romania",
"address_county": "Cluj",
"address_municipality": "Cluj-Napoca",
"address_city": "Cluj-Napoca",
"address_sector": "",
"address_street": "Strada Florilor",
"address_street_type": "Strada",
"address_street_no": "25",
"address_building": "",
"address_entrance": "",
"address_floor": "",
"address_apartment": "",
"address_postal_code": "400123",
"address_intercom": "",
"address_note": ""
},
"recipient": {
"name": "Ion Popescu",
"company_name": "SC Exemplu SRL",
"email": "[email protected]",
"phone": "0712345678",
"address": "Strada Exemplu nr. 10, Bucuresti",
"address_type": "address",
"address_country": "Romania",
"address_county": "Bucuresti",
"address_municipality": "Bucuresti",
"address_city": "Bucuresti",
"address_sector": "1",
"address_street": "Strada Exemplu",
"address_street_type": "Strada",
"address_street_no": "10",
"address_building": "",
"address_entrance": "",
"address_floor": "",
"address_apartment": "",
"address_postal_code": "010101",
"address_intercom": "",
"address_note": ""
},
"parcels": [
{ "weight": 3, "initial_weight": 3, "length": 40, "width": 30, "height": 20 },
{ "weight": 1, "initial_weight": 1, "length": 20, "width": 15, "height": 10 }
]
}
]
}
| Câmp | Tip | Descriere |
|---|---|---|
| Răspuns top-level | ||
success | boolean | Dacă operația a reușit |
pagination.page | integer | Pagina curentă |
pagination.per_page | integer | Retururi per pagină |
pagination.total | integer | Total retururi pentru filtrele selectate |
pagination.total_pages | integer | Total pagini disponibile |
data | array | Lista retururilor (sortate după placed_on descrescător) |
| Identificatori | ||
data[].id | integer | ID expediție Shipo |
data[].awb | string | Numărul AWB (gol dacă nu s-a generat încă, ex: retur în așteptare aprobare) |
data[].order_id | string | ID-ul ridicării (pickup ID-ul atribuit de curier) |
data[].courier | string | Slug curier (ex: fancourier, cargus, dpd) |
data[].courier_name | string | Nume curier |
| Statusuri | ||
data[].status_order | string | Status comandă (completed, paid, finalized, canceled, refunded) |
data[].status_delivery | string | Status livrare (order_placed, collected, in_transit, out_for_delivery, delivered, canceled, dropoff_locker, dropoff_pudo, loaded_locker, loaded_pudo, return_to_sender) |
| Date retur | ||
data[].is_return | boolean | Întotdeauna true pe acest endpoint |
data[].belongs_to_store | boolean | true dacă returul este în contul tău (magazinul a plătit prin fluxul de aprobare, deci apare și în /shipments). false dacă returul este în contul altui client (clientul care a inițiat returul a plătit, deci nu apare în /shipments) |
data[].pending_approval | boolean | Returul este în așteptare aprobare |
data[].return_reason | string | Motivul returului |
| Date generale | ||
data[].weight | float | Greutate totală (kg) |
data[].parcel_count | integer | Număr colete |
data[].contents | string | Conținut colet |
data[].note | string | Observații |
data[].placed_on | string | Data plasare retur (YYYY-MM-DD HH:MM:SS) |
data[].added_on | string | Data creare în sistem |
Date expeditor (data[].sender) — clientul care returnează | ||
sender.name | string | Nume complet |
sender.company_name | string | Companie |
sender.email | string | |
sender.phone | string | Telefon |
sender.address | string | Adresă concatenată |
sender.address_type | string | Tip adresă: address, locker, pudo |
sender.address_country | string | Țară |
sender.address_county | string | Județ |
sender.address_municipality | string | Municipiu / oraș principal |
sender.address_city | string | Localitate |
sender.address_sector | string | Sector (1-6, doar București) |
sender.address_street | string | Stradă |
sender.address_street_type | string | Tip stradă (Strada, Bulevard, etc.) |
sender.address_street_no | string | Număr stradă |
sender.address_building | string | Bloc |
sender.address_entrance | string | Scara |
sender.address_floor | string | Etaj |
sender.address_apartment | string | Apartament |
sender.address_postal_code | string | Cod poștal |
sender.address_intercom | string | Interfon |
sender.address_note | string | Observații adresă |
Date destinatar (data[].recipient) — magazinul tău | ||
Aceleași câmpuri ca sender, prefixate recipient. | ||
Colete (data[].parcels) | ||
parcels[].weight | float | Greutate curentă (kg) |
parcels[].initial_weight | float | Greutate inițială (kg) |
parcels[].length | float | Lungime (cm) |
parcels[].width | float | Lățime (cm) |
parcels[].height | float | Înălțime (cm) |
{
"success": false,
"message": "Validation failed",
"errors": {
"per_page": ["Câmpul per_page nu poate fi mai mare decât 500."]
}
}
Urmărește statusul expedierilor tale.
Returnează statusul curent și istoricul statusurilor.
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
awb | string | Da | Numărul AWB al expedierii |
fetch("https://api.shipo.ro/tracking?awb=2150012345678", {
method: "GET",
headers: {
"Authorization": "Bearer TOKEN"
}
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init("https://api.shipo.ro/tracking?" . http_build_query(["awb" => "2150012345678"]));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer TOKEN"
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
{
"success": true,
"data": {
"awb": "2150012345678",
"status": "in_transit",
"statusName": "În tranzit",
"statusClasses": {
"order_placed": "pastStep",
"picked_up": "pastStep",
"in_transit": "currentStep",
"out_for_delivery": "futureStep",
"delivered": "futureStep"
},
"statusLog": {}
}
}
| Câmp | Tip | Descriere |
|---|---|---|
awb | string | Numărul AWB |
status | string | Statusul curent |
statusName | string | Numele statusului în română |
statusClasses | object | Clase CSS: pastStep, currentStep, futureStep |
statusLog | object | Istoricul statusurilor |
{ "success": false, "message": "Missing awb" }