Direct API
Create Order
Create a new shipment order with automatic AWB generation
Important Information
- • Orders are automatically paid from your wallet balance
- • Ensure sufficient wallet funds before creating orders
- • AWB is generated immediately upon successful order creation
- • Locker requirements vary by service type
Request Body
Carrier & Service Selection
| Name | Type | Required | Description |
|---|---|---|---|
| carrier_id | integer | Yes | Carrier ID (must be greater than 0) |
| service_id | integer | Yes | Service ID (must be greater than 0) |
Billing Information
| Name | Type | Required | Description |
|---|---|---|---|
| billing_to | object | Yes | Billing address information |
| billing_address_id | integer | Yes | Billing address ID - must be owned by the customer and of type "billing_address" |
Address Information
Note: You can either provide an existing address ID or full address details. For locality, provide either: locality_id OR postal_code OR (locality_name + county_name).
| Name | Type | Required | Description |
|---|---|---|---|
| address_from / address_to | object | Yes | Sender/Recipient address details |
| address_from_id / address_to_id | integer | No | If provided, other address fields can be null. Must be owned by the customer |
| string | conditional | Email address (required if address ID not provided, max 100 chars) | |
| phone | string | conditional | Phone number (required if address ID not provided, 7-64 chars) |
| contact | string | conditional | Contact name (required if address ID not provided, 5-100 chars) |
| company | string | No | Company name (optional, 5-64 chars) |
| country_code | string | conditional | Country code (required if address ID not provided, 2 chars, e.g., "RO") |
| locality_id | integer | conditional | Locality ID (sufficient by itself, validated against database) |
| postal_code | string | conditional | Postal code (sufficient by itself, 4-50 chars) |
| locality_name | string | conditional | Locality name (requires county_name if no postal_code/locality_id) |
| county_name | string | conditional | County name (if 1-2 chars, searches by county_code) |
| street_name | string | conditional | Street name (required if address ID not provided, 5-100 chars) |
| street_number | string | conditional | Street number (required if address ID not provided, max 25 chars) |
| street_details | string | No | Additional address details (optional, max 60 chars) |
| fixed_location_id | integer | conditional | Locker ID - see service requirements table |
Package Content
Important: Exactly one of envelopes_count, pallets_count, or parcels_count must be greater than 0.
| Name | Type | Required | Description |
|---|---|---|---|
| content | object | Yes | Package content details |
| envelopes_count | integer | Yes | Number of envelopes (exactly one count type must be > 0) |
| pallets_count | integer | Yes | Number of pallets (exactly one count type must be > 0) |
| parcels_count | integer | Yes | Number of parcels (exactly one count type must be > 0) |
| total_weight | number | Yes | Total weight in kg (must equal sum of parcel weights) |
| parcels | array | conditional | Parcel details (required when parcels_count > 0) |
| sequence_no | integer | Yes | Parcel sequence number (must be consecutive: 1, 2, 3...) |
| size | object | Yes | Parcel dimensions |
Extra Services
| Name | Type | Required | Description |
|---|---|---|---|
| extra | object | Yes | Extra services configuration |
| parcel_content | string | Yes | Package content description (max 100 chars) |
| internal_identifier | string | No | Your internal reference (max 100 chars) |
| sms_sender | boolean | No | Send SMS to sender |
| sms_recipient | boolean | No | Send SMS to recipient |
| open_package | boolean | No | Allow recipient to open package before accepting |
| return_package | boolean | No | Return package service |
| return_of_documents | boolean | No | Return of signed documents |
| insurance_amount | number | No | Insurance amount (requires insurance_amount_currency if > 0) |
| insurance_amount_currency | string | conditional | Insurance currency (required if insurance_amount > 0, e.g., "RON") |
| bank_repayment_amount | number | No | Cash on delivery amount |
| bank_repayment_currency | string | conditional | COD currency (required if bank_repayment_amount > 0) |
| bank_holder | string | conditional | Bank account holder name (max 200 chars). Required when bank_repayment_amount > 0. If omitted, the value from your customer profile will be used. If neither is set, the order will fail with error code MISSING_BANK_DETAILS. |
| bank_iban | string | conditional | Bank IBAN (max 34 chars). Required when bank_repayment_amount > 0. If omitted, the value from your customer profile will be used. If neither is set, the order will fail with error code MISSING_BANK_DETAILS. |
Code Examples
const axios = require('axios'); const orderData = { carrier_id: 1, service_id: 1, billing_to: { billing_address_id: 123 }, address_from: { email: "sender@example.com", phone: "0721234567", contact: "John Doe", country_code: "RO", locality_id: 10241, street_name: "Strada Exemplu", street_number: "10" }, address_to: { email: "recipient@example.com", phone: "0731234567", contact: "Jane Smith", country_code: "RO", postal_code: "400001", street_name: "Strada Destinatie", street_number: "20", street_details: "Bloc A, Ap. 5" }, content: { envelopes_count: 0, pallets_count: 0, parcels_count: 1, total_weight: 2.5, parcels: [ { sequence_no: 1, size: { weight: 2.5, width: 30, height: 20, length: 40 } } ] }, extra: { parcel_content: "Electronics", sms_recipient: true, insurance_amount: 500, insurance_amount_currency: "RON" } }; axios.post('https://api.europarcel.com/api/public/orders', orderData, { headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } }) .then(response => { // Order created successfully }) .catch(error => { // Handle error });
Response Structure
Success Response (201)
{
"data": {
"order_id": 123456,
"awb_number": "AWB123456",
"carrier_id": 1,
"carrier": "FAN Courier",
"service_id": 1,
"service_name": "De la ușă la ușă",
"price": {
"amount": 45.50,
"vat": 8.65,
"total": 54.15,
"currency": "RON"
},
"estimated_pickup_date": "2025-01-16",
"estimated_delivery_date": "2025-01-18",
"track_url": "https://www.eawb.ro/tracking?awb=AWB123456",
"extra": {
"sms_recipient": true,
"parcel_content": "Electronics",
"insurance_amount": 500,
"insurance_amount_currency": "RON"
}
},
"validation_address": {
"address_from": {
"locality_id": 10241,
"postal_code": "010001",
"locality_name": "București",
"county_name": "București",
"country_code": "RO"
},
"address_to": {
"locality_id": 456,
"postal_code": "400001",
"locality_name": "Cluj-Napoca",
"county_name": "Cluj",
"country_code": "RO"
}
}
}Error Responses
Validation Error (400)
{
"valid": false,
"message": "Validation failed",
"error_code": "VALIDATION_FAILED",
"errors": {
"billing_to.billing_address_id": [
"The specified address does not belong to this customer"
],
"address_from.locality_id": [
"The selected locality is invalid"
]
}
}Missing Bank Details (422)
{
"valid": false,
"message": "Bank IBAN and holder are required when bank_repayment_amount is greater than 0. You can set default bank details in your customer profile.",
"error_code": "MISSING_BANK_DETAILS",
"errors": {
"extra.bank_iban": [
"The bank_iban field is required when bank_repayment_amount is greater than 0."
],
"extra.bank_holder": [
"The bank_holder field is required when bank_repayment_amount is greater than 0."
]
}
}Insufficient Funds (402)
{
"valid": false,
"message": "Payment failed: Insufficient wallet funds",
"error_code": "PAYMENT_FAILED",
"order_id": 123456
}Locker Requirements by Service
| Service ID | Service Type | Pickup Location | Delivery Location |
|---|---|---|---|
| 1 | Door to Door | Not allowed | Not allowed |
| 2 | Door to Locker | Not allowed | Required |
| 3 | Locker to Door | Required | Not allowed |
| 4 | Locker to Locker | Required | Required |
| 11 | Cargo, door to door (quoted only for a parcel over the standard limits) | Not allowed | Not allowed |

