Direct API

Create Order

Create a new shipment order with automatic AWB generation

Endpoint

POST /orders

Authentication

API Key required

Swagger Documentation

View in Swagger

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_idintegerYesCarrier ID (must be greater than 0)
service_idintegerYesService ID (must be greater than 0)

Billing Information

Name Type Required Description
billing_toobjectYesBilling address information
billing_address_idintegerYesBilling 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_toobjectYesSender/Recipient address details
address_from_id / address_to_idintegerNoIf provided, other address fields can be null. Must be owned by the customer
emailstringconditionalEmail address (required if address ID not provided, max 100 chars)
phonestringconditionalPhone number (required if address ID not provided, 7-64 chars)
contactstringconditionalContact name (required if address ID not provided, 5-100 chars)
companystringNoCompany name (optional, 5-64 chars)
country_codestringconditionalCountry code (required if address ID not provided, 2 chars, e.g., "RO")
locality_idintegerconditionalLocality ID (sufficient by itself, validated against database)
postal_codestringconditionalPostal code (sufficient by itself, 4-50 chars)
locality_namestringconditionalLocality name (requires county_name if no postal_code/locality_id)
county_namestringconditionalCounty name (if 1-2 chars, searches by county_code)
street_namestringconditionalStreet name (required if address ID not provided, 5-100 chars)
street_numberstringconditionalStreet number (required if address ID not provided, max 25 chars)
street_detailsstringNoAdditional address details (optional, max 60 chars)
fixed_location_idintegerconditionalLocker 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
contentobjectYesPackage content details
envelopes_countintegerYesNumber of envelopes (exactly one count type must be > 0)
pallets_countintegerYesNumber of pallets (exactly one count type must be > 0)
parcels_countintegerYesNumber of parcels (exactly one count type must be > 0)
total_weightnumberYesTotal weight in kg (must equal sum of parcel weights)
parcelsarrayconditionalParcel details (required when parcels_count > 0)
sequence_nointegerYesParcel sequence number (must be consecutive: 1, 2, 3...)
sizeobjectYesParcel dimensions

Extra Services

Name Type Required Description
extraobjectYesExtra services configuration
parcel_contentstringYesPackage content description (max 100 chars)
internal_identifierstringNoYour internal reference (max 100 chars)
sms_senderbooleanNoSend SMS to sender
sms_recipientbooleanNoSend SMS to recipient
open_packagebooleanNoAllow recipient to open package before accepting
return_packagebooleanNoReturn package service
return_of_documentsbooleanNoReturn of signed documents
insurance_amountnumberNoInsurance amount (requires insurance_amount_currency if > 0)
insurance_amount_currencystringconditionalInsurance currency (required if insurance_amount > 0, e.g., "RON")
bank_repayment_amountnumberNoCash on delivery amount
bank_repayment_currencystringconditionalCOD currency (required if bank_repayment_amount > 0)
bank_holderstringconditionalBank 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_ibanstringconditionalBank 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

Create Order 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)

Success ResponseJSON
{
  "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)

Validation ErrorJSON
{
  "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)

Missing Bank Details ErrorJSON
{
  "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)

Payment ErrorJSON
{
  "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
1Door to DoorNot allowedNot allowed
2Door to LockerNot allowedRequired
3Locker to DoorRequiredNot allowed
4Locker to LockerRequiredRequired
11Cargo, door to door (quoted only for a parcel over the standard limits)Not allowedNot allowed