DPD Romania

DPD Romania - REST API examples

All examples are based on the PHP cURL options, JSON structured data and standard html POST method.

Table of contents:
Guidelines
Other resources

First we define some variables and functions used in examples below.
#-> GLobal variables
define('API_USERNAME', 'xxxxxx');
define('API_PASSWORD', 'yyyyyy');
define('API_BASE_URL', 'https://api.dpd.ro/v1/');
define('LANGUAGE', 'EN');


#-> Function for api requests via cURL functions. In the examples we are using POST requests.
function apiRequest($apiURL, $jsonData)
   {
   #-> Encode the array into JSON.
   $jsonDataEncoded = json_encode($jsonData);

   #-> Initiate cURL
   $curl = curl_init($apiURL);

   #-> Set curl options
   curl_setopt($curl, CURLOPT_POST, 1); // Tell cURL that we want to send a POST request.
   curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // Verify the peer's SSL certificate.
   curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // Stop showing results on the screen.
   curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); // The number of seconds to wait while trying to connect. Use 0 to wait indefinitely.
   curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); // Set the content type to application/json
   curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonDataEncoded); // Attach our encoded JSON string to the POST fields.
   
   #-> Get the response
   $jsonResponse = curl_exec($curl);
         
   if ( $jsonResponse === FALSE)
      { exit("cURL Error: ".curl_error($curl)); }
      
   return($jsonResponse);
   }

Create Shipment Request examples view API documentation
PHP example: The same example as JSON:
#-> Example 1a - A shipment to an address

#-> I. SENDER
$senderArray = array(
   'phone1' => array('number' => '0999123456'),
   'contactName' => 'ION POPESCU',
   'email' => '[email protected]',
   /* 'clientId' => 1234567890 */ // Not required
);
/* 
* If you have a warehouse in Bucharest, a shop in Brasov and an office in Braila, you'll have three objects with different clientIds, one for each object.
* When you want to send from one of these addresses of your objects, you can set the appropriate 'clientId'. 
* If you skip it, the sender will be the default one for the username with all the address and contact information. 
* All your 'clientId's can be obtained from the result of the Get Contract Clients Request.
*/

#-> For drop off shipment (The 'dropoffOfficeId' property overrides the address details)
//$senderArray['dropoffOfficeId'] = 926; // BUCHAREST - MOGOSOAIA (DPD OFFICE). The 'dropoffOfficeId' can be obtained from the result of a Find Office Request.


#-> II. RECIPIENT
$recipientArray = array(
   'phone1' => array('number' => '0999654321'),	
   'privatePerson' => true,
   'clientName' => 'ALEX MARIN',
   'email' => '[email protected]'
);

#-> If the shipment is to an address. There are several options to define an address. Check the examples bellow.
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request.
   'siteId' => 642279132, // BUCHAREST. The 'siteId' can be obtained from the result of a Find Site Request.
   'streetId' => 642077434, // A street named 'ALECU MATEEVICI'. The 'streetId' can be obtained from the result of a Find Street Request.
   'streetNo' => '1',
   'blockNo' => '101',
   'entranceNo' => '2',
   'floorNo' => '3',
   'apartmentNo' => '4'
);
$recipientArray['address'] = $recipientAddressArray;

#-> For self collection shipment from office (use it instead of $recipientArray['address'])
//$recipientArray['pickupOfficeId'] = 901; // SIBIU (OFFICE), The 'pickupOfficeId' can be obtained from the result of a Find Office Request.


#-> III. SERVICE DETAILS
$serviceArray = array(
   'autoAdjustPickupDate' => true, // Not mandatory
   'serviceId' => 2505, // The 'serviceId' can be obtained from the result of a Destination Services Request.
   'saturdayDelivery' => true // Not mandatory. Use it if you want delivery on Saturday/Holiday.
);

/* Cash on delivery - Not mandatory */
$cashOnDeliveryArray = array(
   'amount' => 100,
   'processingType' => 'CASH' // (CASH, POSTAL_MONEY_TRANSFER)
);

/* Options before payment - Not mandatory */
$optionsBeforePaymentArray = array(
   'option' => 'OPEN', 
   'returnShipmentServiceId' => 2505,
   'returnShipmentPayer' => 'SENDER' // (SENDER, RECIPIENT, THIRD_PARTY). The sender of the returning shipment is the recipient of the primary shipment.
);
/* 
* 'returnShipmentServiceId' is the service for the returning shipment in case the recipient refuses to accept the primary shipment. 
* It can be the same serviceId as in the primary shipment or one obtained from the result of a Destination Services Request.
*/

/* Declared value - Not mandatory */
$declaredValueArray = array(
   'amount' => 100, 
   'fragile' => true 
);

/* Additional services */
$additionalServicesArray = array(
   'cod' => $cashOnDeliveryArray,
   'obpd' => $optionsBeforePaymentArray,
   'declaredValue' => $declaredValueArray
);

/* Add additional services to the main service array */
$serviceArray['additionalServices'] = $additionalServicesArray;


#-> IV. CONTENT OF THE PARCEL
$contentArray = array(
   'parcelsCount' => 1,
   'contents' => 'MOBILE PHONE',
   'package' => 'BOX',
   'totalWeight' => 0.6
);


#-> V. PAYMENTS
$paymentArray = array(
   'courierServicePayer' => 'RECIPIENT', // (SENDER, RECIPIENT, THIRD_PARTY)
   'declaredValuePayer' => 'RECIPIENT' // Mandatory only if the shipment has a 'declaredValue'.
);
      

#-> VI. JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'sender' => $senderArray, // You can skip the sender data. In this case the sender will be the default one for the username with all the address and contact information.
   'recipient' => $recipientArray,
   'service' => $serviceArray,
   'content' => $contentArray,
   'payment' => $paymentArray,
   'ref1' => 'ORDER 123456'
);


#-> Create Shipment Request
$jsonResponse = apiRequest(API_BASE_URL.'shipment/', $jsonData);		
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
A shipment to an address:
      
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "sender" : {
    "phone1" : {
      "number" : "0999123456"
    },
    "contactName" : "ION POPESCU",
    "email" : "[email protected]"
  },
  "recipient" : {
    "phone1" : {
      "number" : "0999654321"
    },
    "clientName" : "ALEX MARIN",
    "email" : "[email protected]",
    "privatePerson" : true,
    "address" : {
      "countryId" : 642,
      "siteId" : 642279132,
      "streetId" : 642077434,
      "streetNo" : "1",
      "blockNo" : "101",
      "entranceNo" : "2",
      "floorNo" : "3",
      "apartmentNo" : "4"
    }
  },
  "service" : {
    "serviceId" : 2505,
    "additionalServices" : {
      "cod" : {
        "amount" : 100.0,
        "processingType" : "CASH"
      },
      "declaredValue" : {
        "amount" : 100.0,
        "fragile" : true,
        "ignoreIfNotApplicable" : true
      },
      "obpd" : {
        "option" : "OPEN",
        "returnShipmentServiceId" : 2505,
        "returnShipmentPayer" : "SENDER"
      }
    },
    "saturdayDelivery" : true,
    "autoAdjustPickupDate" : true
  },
  "content" : {
    "parcelsCount" : 1,
    "totalWeight" : 0.6,
    "contents" : "MOBILE PHONE",
    "package" : "BOX"
  },
  "payment" : {
    "courierServicePayer" : "RECIPIENT",
    "declaredValuePayer" : "RECIPIENT"
  },
  "ref1" : "ORDER 123456"
}
      
#-> Example 1b - A shipment to an office

#-> I. SENDER
$senderArray = array(
   'phone1' => array('number' => '0999123456'),
   'contactName' => 'ION POPESCU',
   'email' => '[email protected]',
   /* 'clientId' => 1234567890 */ // Not required
);
/* 
* If you have a warehouse in Bucharest, a shop in Brasov and an office in Braila, you'll have three objects with different clientIds, one for each object.
* When you want to send from one of these addresses of your objects, you can set the appropriate 'clientId'. 
* If you skip it, the sender will be the default one for the username with all the address and contact information. 
* All your 'clientId's can be obtained from the result of the Get Contract Clients Request.
*/

#-> For drop off shipment (The 'dropoffOfficeId' property overrides the address details)
//$senderArray['dropoffOfficeId'] = 926; // BUCHAREST - MOGOSOAIA (DPD OFFICE). The 'dropoffOfficeId' can be obtained from the result of a Find Office Request.


#-> II. RECIPIENT
$recipientArray = array(
   'phone1' => array('number' => '0999654321'), 
   'privatePerson' => true,
   'clientName' => 'ALEX MARIN',
   'email' => '[email protected]',
   // For self collection shipment from office (use it instead of $recipientArray['address'])
   'pickupOfficeId' => 901 // The 'pickupOfficeId' can be obtained from the result of a Find Office Request.
);


#-> III. SERVICE DETAILS
$serviceArray = array(
   'autoAdjustPickupDate' => true, // Not mandatory
   'serviceId' => 2505, // The 'serviceId' can be obtained from the result of a Destination Services Request.
   'saturdayDelivery' => true // Not mandatory. Use it if you want delivery on Saturday/Holiday.
);

/* Cash on delivery - Not mandatory */
$cashOnDeliveryArray = array(
   'amount' => 100,
   'processingType' => 'CASH' // (CASH, POSTAL_MONEY_TRANSFER)
);

/* Options before payment - Not mandatory */
$optionsBeforePaymentArray = array(
   'option' => 'OPEN', 
   'returnShipmentServiceId' => 2505,
   'returnShipmentPayer' => 'SENDER' // (SENDER, RECIPIENT, THIRD_PARTY). The sender of the returning shipment is the recipient of the primary shipment.
);
/* 
* 'returnShipmentServiceId' is the service for the returning shipment in case the recipient refuses to accept the primary shipment. 
* It can be the same serviceId as in the primary shipment or one obtained from the result of a Destination Services Request.
*/

/* Declared value - Not mandatory */
$declaredValueArray = array(
   'amount' => 100, 
   'fragile' => true 
);

/* Additional services */
$additionalServicesArray = array(
   'cod' => $cashOnDeliveryArray,
   'obpd' => $optionsBeforePaymentArray,
   'declaredValue' => $declaredValueArray
);

/* Add additional services to the main service array */
$serviceArray['additionalServices'] = $additionalServicesArray;


#-> IV. CONTENT OF THE PARCEL
$contentArray = array(
   'parcelsCount' => 1,
   'contents' => 'MOBILE PHONE',
   'package' => 'BOX',
   'totalWeight' => 0.6
);


#-> V. PAYMENTS
$paymentArray = array(
   'courierServicePayer' => 'RECIPIENT', // (SENDER, RECIPIENT, THIRD_PARTY)
   'declaredValuePayer' => 'RECIPIENT' // Mandatory only if the shipment has a 'declaredValue'.
);
      

#-> VI. JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'sender' => $senderArray, // You can skip the sender data. In this case the sender will be the default one for the username with all the address and contact information.
   'recipient' => $recipientArray,
   'service' => $serviceArray,
   'content' => $contentArray,
   'payment' => $paymentArray,
   'ref1' => 'ORDER 123456'
);


#-> Create Shipment Request
$jsonResponse = apiRequest(API_BASE_URL.'shipment/', $jsonData);		
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
A shipment to an office:
      
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "service" : {
    "serviceId" : 2505,
    "additionalServices" : {
      "cod" : {
        "amount" : 100.0,
        "processingType" : "CASH"
      },
      "declaredValue" : {
        "amount" : 100.0,
        "fragile" : true,
        "ignoreIfNotApplicable" : true
      },
      "obpd" : {
        "option" : "OPEN",
        "returnShipmentServiceId" : 2505,
        "returnShipmentPayer" : "SENDER"
      }
    },
    "saturdayDelivery" : true,
    "autoAdjustPickupDate" : true
  },
  "content" : {
    "parcelsCount" : 1,
    "totalWeight" : 0.6,
    "contents" : "MOBILE PHONE",
    "package" : "BOX"
  },
  "payment" : {
    "courierServicePayer" : "RECIPIENT",
    "declaredValuePayer" : "RECIPIENT"
  },
  "sender" : {
    "phone1" : {
      "number" : "0999123456"
    },
    "contactName" : "ION POPESCU",
    "email" : "[email protected]"
  },
  "recipient" : {
    "phone1" : {
      "number" : "0999654321"
    },
    "clientName" : "ALEX MARIN",
    "email" : "[email protected]",
    "privatePerson" : true,
    "pickupOfficeId" : 901
  },
  "ref1" : "ORDER 123456"
} 
      
#-> Example 1c - A shipment from an office and Third Party Payer

#-> I. SENDER
$senderArray = array(
   'phone1' => array('number' => '0999123456'),
   'privatePerson' => false,
   'clientName' => 'Company LTD',
   'contactName' => 'ION POPESCU',
   'email' => '[email protected]',
   /* 'clientId' => 1234567890 */ // Not required
   'dropoffOfficeId' => 926 // The 'dropoffOfficeId' can be obtained from the result of a Find Office Request.
);
/*
* If you have a warehouse in Sofia, a shop in Varna and an office in Plovdiv, you'll have three objects with different clientIds, one for each object.
* When you want to send from one of these addresses of your objects, you can set the appropriate 'clientId'.
* If you skip it, the sender will be the default one for the username with all the address and contact information.
* All your 'clientId's can be obtained from the result of the Get Contract Clients Request.
*/


#-> II. RECIPIENT
$recipientArray = array(
   'phone1' => array('number' => '0999654321'),	
   'privatePerson' => true,
   'clientName' => 'ALEX MARIN',
   'email' => '[email protected]'
);

#-> If the shipment is to an address. There are several options to define an address. Check the examples bellow.
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request.
   'siteId' => 642279132, // BUCHAREST. The 'siteId' can be obtained from the result of a Find Site Request.
   'streetId' => 642077434, // A street named 'ALECU MATEEVICI'. The 'streetId' can be obtained from the result of a Find Street Request.
   'streetNo' => '1',
   'blockNo' => '101',
   'entranceNo' => '2',
   'floorNo' => '3',
   'apartmentNo' => '4'
);
$recipientArray['address'] = $recipientAddressArray;

#-> For self collection shipment from office (use it instead of $recipientArray['address'])
//$recipientArray['pickupOfficeId'] = 901; // SIBIU (OFFICE), The 'pickupOfficeId' can be obtained from the result of a Find Office Request.


#-> III. SERVICE DETAILS
$serviceArray = array(
   'autoAdjustPickupDate' => true, // Not mandatory
   'serviceId' => 2505, // The 'serviceId' can be obtained from the result of a Destination Services Request.
   'saturdayDelivery' => true // Not mandatory. Use it if you want delivery on Saturday/Holiday.
);

/* Cash on delivery - Not mandatory */
$cashOnDeliveryArray = array(
   'amount' => 100,
   'processingType' => 'CASH' // (CASH, POSTAL_MONEY_TRANSFER)
);

/* Options before payment - Not mandatory */
$optionsBeforePaymentArray = array(
   'option' => 'OPEN',
   'returnShipmentServiceId' => 2505,
   'returnShipmentPayer' => 'THIRD_PARTY' // (SENDER, RECIPIENT, THIRD_PARTY). The sender of the returning shipment is the recipient of the primary shipment.
);
/*
* 'returnShipmentServiceId' is the service for the returning shipment in case the recipient refuses to accept the primary shipment.
* It can be the same serviceId as in the primary shipment or one obtained from the result of a Destination Services Request.
*/

/* Declared value - Not mandatory */
$declaredValueArray = array(
   'amount' => 100,
   'fragile' => true
);

/* Additional services */
$additionalServicesArray = array(
   'cod' => $cashOnDeliveryArray,
   'obpd' => $optionsBeforePaymentArray,
   'declaredValue' => $declaredValueArray
);

/* Add additional services to the main service array */
$serviceArray['additionalServices'] = $additionalServicesArray;


#-> IV. CONTENT OF THE PARCEL
$contentArray = array(
   'parcelsCount' => 1,
   'contents' => 'MOBILE PHONE',
   'package' => 'BOX',
   'totalWeight' => 0.6
);


#-> V. PAYMENTS
$paymentArray = array(
   'courierServicePayer' => 'THIRD_PARTY', // (SENDER, RECIPIENT, THIRD_PARTY)
   'declaredValuePayer' => 'THIRD_PARTY', // Mandatory only if the shipment has a 'declaredValue'.
   'thirdPartyClientId' => 88888888889000,  // All your 'clientId's can be obtained from the result of the Get Contract Clients Request.
   'senderBankAccount' => array(
      'iban' => 'RO49AAAA1B31007593840000',
      'accountHolder' => 'Company LTD'
   )
);


#-> VI. JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'sender' => $senderArray, // You can skip the sender data. In this case the sender will be the default one for the username with all the address and contact information.
   'recipient' => $recipientArray,
   'service' => $serviceArray,
   'content' => $contentArray,
   'payment' => $paymentArray,
   'ref1' => 'ORDER 123456'
);


#-> Create Shipment Request
$jsonResponse = apiRequest(API_BASE_URL.'shipment/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
A shipment from an office and Third Party Payer:
{ "userName" : "xxxxxx", "password" : "yyyyyy", "language" : "EN", "sender" : { "phone1" : { "number" : "0999123456" }, "clientName" : "Company LTD", "contactName" : "ION POPESCU", "email" : "[email protected]", "privatePerson" : false, "dropoffOfficeId" : 926 }, "recipient" : { "phone1" : { "number" : "0999654321" }, "clientName" : "ALEX MARIN", "email" : "[email protected]", "privatePerson" : true, "address" : { "countryId" : 642, "siteId" : 642279132, "streetId" : 642077434, "streetNo" : "1", "blockNo" : "101", "entranceNo" : "2", "floorNo" : "3", "apartmentNo" : "4" } }, "service" : { "serviceId" : 2505, "additionalServices" : { "cod" : { "amount" : 100.0, "processingType" : "CASH" }, "declaredValue" : { "amount" : 100.0, "fragile" : true, "ignoreIfNotApplicable" : true }, "obpd" : { "option" : "OPEN", "returnShipmentServiceId" : 2505, "returnShipmentPayer" : "THIRD_PARTY" } }, "saturdayDelivery" : true, "autoAdjustPickupDate" : true }, "content" : { "parcelsCount" : 1, "totalWeight" : 0.6, "contents" : "MOBILE PHONE", "package" : "BOX" }, "payment" : { "courierServicePayer" : "THIRD_PARTY", "declaredValuePayer" : "THIRD_PARTY", "thirdPartyClientId" : 1234567890, "senderBankAccount" : { "iban" : "RO49AAAA1B31007593840000", "accountHolder" : "Company LTD" } }, "ref1" : "ORDER 123456" }
#-> Example 1d - An injected shipment in an office in Greece to an address in Greece

#-> I. SENDER
$senderArray = array(
   'contactName' => 'JOHN SMITH',
   'phone1' => array(
      'number' => '+30217654321'
   ),
   'email' => '[email protected]',
   'dropoffOfficeId' => 52
);


#-> II. RECIPIENT
$recipientArray = array(
   'clientName' => 'GEORGIOS PAPADOPULUS',
   'phone1' => array(
      'number' => '+30211234567'
   ),
   'email' => '[email protected]',
   'privatePerson' => true,
   'address' => array(
      'countryId' => 300, // GREECE
      'siteName' => 'THESSALONIKI',
      'postCode' => 54629,
      'addressLine1' => '28 Monastiriou str',
      'addressLine2' => 'Bus station' /* Not mandatory */
   )
);


#-> III. SERVICE DETAILS
$serviceArray = array(
   'autoAdjustPickupDate' => true,
   'serviceId' => 312,
   'saturdayDelivery' => false
);


#-> IV. CONTENT OF THE PARCEL
$contentsArray = array(
   'parcelsCount' => 1,
   'contents' => 'Books',
   'package' => 'ENVELOPE',
   'totalWeight' => 0.5
);


#-> V. PAYMENTS
$paymentsArray = array(
   'courierServicePayer' => 'SENDER', // (SENDER, RECIPIENT, THIRD_PARTY)
);


#-> VI. JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => 'EN',
   'sender' => $senderArray,
   'recipient' => $recipientArray,
   'service' => $serviceArray,
   'content' => $contentsArray,
   'payment' => $paymentsArray,
   'ref1' => 'ORDER 123456'
);


#-> Create Shipment Request
$jsonResponse = apiRequest(API_BASE_URL.'shipment/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
An injected shipment in an office in Greece to an address in Greece:
{ "userName" : "xxxxxx", "password" : "yyyyyy", "language" : "EN", "sender" : { "phone1" : { "number" : "+30217654321" }, "contactName" : "JOHN SMITH", "email" : "[email protected]", "dropoffOfficeId" : 52 }, "recipient" : { "phone1" : { "number" : "+30211234567" }, "clientName" : "GEORGIOS PAPADOPULUS", "email" : "[email protected]", "privatePerson" : true, "address" : { "countryId" : 300, "siteName" : "THESSALONIKI", "postCode" : "54629", "addressLine1" : "28 Monastiriou str", "addressLine2" : "Bus station" } }, "service" : { "serviceId" : 312, "saturdayDelivery" : false, "autoAdjustPickupDate" : true }, "content" : { "parcelsCount" : 1, "totalWeight" : 0.5, "contents" : "Books", "package" : "ENVELOPE" }, "payment" : { "courierServicePayer" : "SENDER" }, "ref1" : "Order: 123456" }
#-> Example 1e - A shipment from an address to a merchant's object

#-> I. SENDER
$senderArray = array(
   'clientName' => 'ION POPESCU',
   'phone1' => array('number' => '0999123456'),
   'privatePerson' => true
);

$senderAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request.
   'siteId' => 642279132, // BUCHAREST. The 'siteId' can be obtained from the result of a Find Site Request.
   'streetId' => 642077434, // A street named 'ALECU MATEEVICI'. The 'streetId' can be obtained from the result of a Find Street Request.
   'streetNo' => '1A',
   'blockNo' => '301',
   'entranceNo' => '2',
   'floorNo' => '3',
   'apartmentNo' => '4'
);
$senderArray['address'] = $senderAddressArray;


#-> II. RECIPIENT
$recipientArray = array(
   'clientId' => 1234567890, // An object of Company XYZ
   'contactName' => 'ALEX MARIN',
   'phone1' => array('number' => '0899445566')
);


#-> III. SERVICE DETAILS
$serviceArray = array(
   'autoAdjustPickupDate' => true, // Not mandatory
   'serviceId' => 2505 // The 'serviceId' can be obtained from the result of a Destination Services Request.
);


#-> IV. CONTENT OF THE PARCEL
$contentArray = array(
   'parcelsCount' => 1,
   'contents' => 'MOBILE PHONE',
   'package' => 'BOX',
   'totalWeight' => 0.6
);


#-> V. PAYMENTS
$paymentArray = array(
   'courierServicePayer' => 'RECIPIENT'
);


#-> VI. JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'sender' => $senderArray,
   'recipient' => $recipientArray,
   'service' => $serviceArray,
   'content' => $contentArray,
   'payment' => $paymentArray,
   'ref1' => 'ORDER 123456'
);


#-> Create Shipment Request
$jsonResponse = apiRequest(API_BASE_URL.'shipment/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
A shipment from an address to a merchant's object:
{ "userName" : "xxxxxx", "password" : "yyyyyy", "language" : "EN", "sender" : { "phone1" : { "number" : "0999123456" }, "clientName" : "ION POPESCU", "privatePerson" : true, "address" : { "countryId" : 642, "siteId" : 642279132, "streetId" : 642077434, "streetNo" : "1A", "blockNo" : "301", "entranceNo" : "2", "floorNo" : "3", "apartmentNo" : "4" } }, "recipient" : { "clientId" : 1234567890, "contactName" : "ALEX MARIN", "phone1" : { "number" : "0899445566" }, }, "service" : { "serviceId" : 2505, "autoAdjustPickupDate" : true }, "content" : { "parcelsCount" : 1, "totalWeight" : 0.6, "contents" : "MOBILE PHONE", "package" : "BOX" }, "payment" : { "courierServicePayer" : "RECIPIENT" }, "ref1" : "ORDER 123456" }
#-> Example 1f - A shipment from an address to an office

#-> I. SENDER
$senderArray = array(
   'clientName' => 'ION POPESCU',
   'phone1' => array('number' => '0999123456'),
   'privatePerson' => true
);

$senderAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request.
   'siteId' => 642279132, // BUCHAREST. The 'siteId' can be obtained from the result of a Find Site Request.
   'streetId' => 642077434, // A street named 'ALECU MATEEVICI'. The 'streetId' can be obtained from the result of a Find Street Request.
   'streetNo' => '1A',
   'blockNo' => '301',
   'entranceNo' => '2',
   'floorNo' => '3',
   'apartmentNo' => '4'
);
$senderArray['address'] = $senderAddressArray;


#-> II. RECIPIENT
$recipientArray = array(
   'clientId' => 1234567890, // Company XYZ
   'contactName' => 'ALEX MARIN',
   'phone1' => array('number' => '0899445566'),
   'pickupOfficeId' => 901   
);


#-> III. SERVICE DETAILS
$serviceArray = array(
   'autoAdjustPickupDate' => true, // Not mandatory
   'serviceId' => 2505 // The 'serviceId' can be obtained from the result of a Destination Services Request.
);


#-> IV. CONTENT OF THE PARCEL
$contentArray = array(
   'parcelsCount' => 1,
   'contents' => 'MOBILE PHONE',
   'package' => 'BOX',
   'totalWeight' => 0.6
);


#-> V. PAYMENTS
$paymentArray = array(
   'courierServicePayer' => 'RECIPIENT'
);


#-> VI. JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'sender' => $senderArray,
   'recipient' => $recipientArray,
   'service' => $serviceArray,
   'content' => $contentArray,
   'payment' => $paymentArray,
   'ref1' => 'ORDER 123456'
);


#-> Create Shipment Request
$jsonResponse = apiRequest(API_BASE_URL.'shipment/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
A shipment from an address to an office:
{ "userName" : "xxxxxx", "password" : "yyyyyy", "language" : "EN", "sender" : { "phone1" : { "number" : "0999123456" }, "clientName" : "ION POPESCU", "privatePerson" : true, "address" : { "countryId" : 642, "siteId" : 642279132, "streetId" : 642077434, "streetNo" : "1A", "blockNo" : "301", "entranceNo" : "2", "floorNo" : "3", "apartmentNo" : "4" } }, "recipient" : { "clientId" : 1234567890, "contactName" : "ALEX MARIN", "phone1" : { "number" : "0899445566" }, "pickupOfficeId" : 901 }, "service" : { "serviceId" : 2505, "autoAdjustPickupDate" : true }, "content" : { "parcelsCount" : 1, "totalWeight" : 0.6, "contents" : "MOBILE PHONE", "package" : "BOX" }, "payment" : { "courierServicePayer" : "RECIPIENT" }, "ref1" : "ORDER 123456" }

Print Request example view API documentation
PHP example: The same example as JSON:
#-> Example 1. Print a waybill (with one parcel).
$parcelsArray = array(
   array(
      'parcel' => array(
         'id' => '1234567890'
      )
   )
);

#-> The JSON data.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'paperSize' => 'A4', // A4, A6, A4_4xA6
   'parcels' => $parcelsArray
);

$jsonResponse = apiRequest(API_BASE_URL.'print/', $jsonData);
         
header("Content-type: application/octet-stream");
header("Content-Type: application/pdf");
   
echo $jsonResponse;
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "paperSize" : "A4",
  "parcels" : [ {
    "parcel" : {
      "id" : "1234567890"
    }
  } ],
  "additionalWaybillSenderCopy" : "NONE"
}      
      
#-> Example 2. Print a waybill created with more than one parcel.
$parcelsArray = array(
   array(
      'parcel' => array(
         'id' => '1234567890' // The first parcel is always the waybill number
      )
   ),
   array(
      'parcel' => array(
         'id' => '123456789024' // Second parcel of the 1234567890 waybill (it is a unique number returned by the Create Shipment Request)
      )
   ),
   array(
      'parcel' => array(
         'id' => '123456789030' // Third parcel of the 1234567890 waybill (it is a unique number)
      )
   )
);

#-> The JSON data.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'paperSize' => 'A4', // A4, A6, A4_4xA6
   'parcels' => $parcelsArray
);

$jsonResponse = apiRequest(API_BASE_URL.'print/', $jsonData);
         
header("Content-type: application/octet-stream");
header("Content-Type: application/pdf");
   
echo $jsonResponse;
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "paperSize" : "A4",
  "parcels" : [ { 
      "parcel" : { 
          "id" : "1234567890" 
          } 
      }, { 
      "parcel" : { 
          "id" : "123456789024" 
          } 
      }, { 
      "parcel" : { 
          "id" : "123456789030" 
          } 
       } ],
  "additionalWaybillSenderCopy" : "NONE"
}      
      

Get Contract Clients Request example
Retrieve all clientIds, of the own contract, and other details like names, addresses etc. Use the clientIds in your requests. view API documentation
PHP example: The same example as JSON:
#-> JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE
);

#-> Get Contract Clients Request
$jsonResponse = apiRequest(API_BASE_URL.'client/contract/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN"
}      
      

Find Country Request examples
Get 'id' and other details for countries. The search can be by name, part of the name or country ISO code. The 'id' is the unique identifier of the country and is used to define an address. view API documentation
PHP example: The same example as JSON:
#-> Example 1. Search by full country name.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'name' => 'ROMANIA'
);
/*
* The result from the example will return all data for ROMANIA such as id, isoAlpha2, isoAlpha3, currencyCode, postCodeFormats, requireState etc.
* If the result for a country has a property named 'currencyCode' and selected service allows it, you can use Cash On Delivery in your parcels for this country. 
*/

#-> Find Country Request
$jsonResponse = apiRequest(API_BASE_URL.'location/country/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "name" : "ROMANIA"
}
      
#-> Example 2. Search by part of the country name.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'name' => 'GER' // The 'name' is partial
);
/* The result from the example will return all countries which contain 'GER' in their names: GERMANY, ALGERIA, NIGER, NIGERIA. */

#-> Find Country Request
$jsonResponse = apiRequest(API_BASE_URL.'location/country/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "name" : "GER"
}
      
#-> Example 3. Search by country isoAlpha2.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'isoAlpha2' => 'GR'
);
/* The result from the example will return all data for GREECE. The 'isoAlpha2' and 'isoAlpha3' are unique. */

#-> Find Country Request
$jsonResponse = apiRequest(API_BASE_URL.'location/country/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "isoAlpha2" : "GR"
}
      

Find State Request examples
Get 'id' (stateId) and other details for states. The search can be by name, part of the name. The 'id' is the unique identifier of the state and is used to define an address. view API documentation
PHP example: The same example as JSON:
#-> Example 1. Search by full state name.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 840, // USA
   'name' => 'ALABAMA'
);
/*
* The result from the example will return all data for ALABAMA including its id.
*/

#-> Find Country Request
$jsonResponse = apiRequest(API_BASE_URL.'location/state/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 840,
  "name" : "ALABAMA"
}
      
#-> Example 2a. Search by part of state name.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 840, // USA
   'name' => 'AR'
);
/* The result from the example will return data for states in USA,
* witch contain 'AR' in their names: 'ARKANSAS' and 'ARIZONA'. You will have to select one of the records. 
*/

#-> Find Country Request
$jsonResponse = apiRequest(API_BASE_URL.'location/state/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 840,
  "name" : "AR"
}
      
#-> Example 2b. Search by part of state name.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 124, // CANADA
   'name' => 'N'
);
/* The result from the example will return data for states in CANADA,
* witch contain 'AR' in their names: 'NEW BRUNSWICK', 'NEWFOUNDLAND AND LABRADOR', 'NOVA SCOTIA', etc. You will have to select one of the records. 
*/

#-> Find Country Request
$jsonResponse = apiRequest(API_BASE_URL.'location/state/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 124,
  "name" : "N"
}
      

Find Office Request examples
Get 'id' and other details for offices. The search can be by name, part of name, site etc. The 'id' is the unique identifier of the office and is used in create shipment or calculation requests. view API documentation
PHP example: The same example as JSON:
#-> Example 1. Find offices in a country.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 642, // ROMANIA
);
/* The result from the example will return all offices in ROMANIA. 
*  To find offices in BULGARIA use 100 instead of 642 for countryId. For GREECE use 300. 
*/

#-> Find Office Request
$jsonResponse = apiRequest(API_BASE_URL.'location/office/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 642
}
      
#-> Example 2. Find offices in a site.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'siteId' => 642279132, // BUCHAREST
);
/* The result from the example will return all offices in BUCHAREST. */

#-> Find Office Request
$jsonResponse = apiRequest(API_BASE_URL.'location/office/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "siteId" : 642279132
}
      
#-> Example 3. Find office by country and part of the name. The 'countryId' is not mandatory.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 642, // ROMANIA
   'name' => 'BAS' // The name can be partial
);
/* The result from the example will return all offices in ROMANIA which names contain 'BAS'. */

#-> Find Office Request
$jsonResponse = apiRequest(API_BASE_URL.'location/office/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 642,
  "name" : "BAS" 
}
      
#-> Example 4. Find office in a site by part of the name. The 'siteId' is not mandatory.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'siteId' => 642279132, // BUCHAREST
   'name' => 'BAS' // The name can be partial
);
/* The result from the example will return all offices in BUCHAREST which names contain 'BAS'. */

#-> Find Office Request
$jsonResponse = apiRequest(API_BASE_URL.'location/office/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "siteId" : 642279132,
  "name" : "BAS" 
}
      

Find Site Request examples
Get site details such as id, type, name etc. Use these details to define an address. The 'id' is the unique identifier of the site. view API documentation
PHP example: The same example as JSON:
#-> Example 1. Search by part of the site name.
$jsonData = array(
   'userName' => DPDRO_API_USERNAME,
   'password' => DPDRO_API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 642, // ROMANIA
   'name' => 'BRAS'
);
/* The result from the example will return data (such as id, type, post code) for all sites in ROMANIA,
* witch contain 'BRAS' in their names: 'BRASOV', 'BRASAUTI', 'BRASCA', 'POIANA BRASOV' etc. 
*/

#-> Find site Request
$jsonResponse = apiRequest(DPDRO_API_BASE_URL.'location/site/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 642, 
  "name" : "BRAS"
}
      
#-> Example 2. Search by exact site name. The site names in ROMANIA are not unique.
$jsonData = array(
   'userName' => DPDRO_API_USERNAME,
   'password' => DPDRO_API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 642, // ROMANIA
   'name' => 'BRABETI'
);
/* The result from the example will return 2 sites in ROMANIA but with 2 different types, post codes, regions, coordinates etc. 
* You will have to select one of the records or add another filter for more precise result. 
*/

#-> Find site Request
$jsonResponse = apiRequest(DPDRO_API_BASE_URL.'location/site/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 642, 
  "name" : "BRABETI"
}
      
#-> Example 3. Search site by name and post code. The combination from the name and post code is unique.
$jsonData = array(
   'userName' => DPDRO_API_USERNAME,
   'password' => DPDRO_API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 642, // ROMANIA
   'name' => 'BRABETI', // The name can be partial
   'postCode' => 207216 
);
/* The result from the example will be an exact match for the search criteria and will return only one site. */

#-> Find site Request
$jsonResponse = apiRequest(DPDRO_API_BASE_URL.'location/site/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 642, 
  "name" : "BRABETI",
  "postCode" : 207216
}
      
#-> Example 4. Search by site post code. The post codes in ROMANIA are not unique.
$jsonData = array(
   'userName' => DPDRO_API_USERNAME,
   'password' => DPDRO_API_PASSWORD,
   'language' => LANGUAGE,
   'countryId' => 642, // ROMANIA
   'postCode' => 510002 
);
/* The result from the example will return two sites with this post code: 'ALBA IULIA' and 'MICESTI'. 
* You will have to select one of the records or add another filter for more precise result. 
*/

#-> Find site Request
$jsonResponse = apiRequest(DPDRO_API_BASE_URL.'location/site/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "countryId" : 642, 
  "postCode" : "510002"
}  
      

Find Street Request examples
Get the street details and use them to define an address. The 'id' is the unique identifier of the street. view API documentation
PHP example: The same example as JSON:
#-> Example 1. Search street details by part of the name.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'siteId' => 642279132, // BUCHAREST
   'name' => 'ANDR'
);
/* The result from the example will return data (such as id, type and name) for all streets in BUCHAREST,
* witch contain 'AND' in their names: 'ANDREI BARSEANU', 'ANDREI MURESANU', 'ANDRONACHE', etc. You will have to select one of the records. 
*/

#-> Find Street Request
$jsonResponse = apiRequest(API_BASE_URL.'location/street/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "siteId" : 642279132,
  "name" : "ANDR"
}
      
#-> Example 2. Search street details by full street name.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'siteId' => 642279132, // BUCHAREST
   'name' => 'ANDREI BARSEANU'
);
/* The result from the example will return 2 streets in BUCHAREST named 'ANDREI BARSEANU',
* but with 2 different types: 'int.' and 'str.', and you will have to select one of the records. 
*/

#-> Find Street Request
$jsonResponse = apiRequest(API_BASE_URL.'location/street/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "siteId" : 642279132,
  "name" : "ANDREI BARSEANU"
}
      
#-> Example 3. Search street details by full name and type.
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'siteId' => 642279132, // BUCHAREST
   'name' => 'ANDREI BARSEANU',
   'type' => 'str.'
);
/* The result from the example will be an exact match for the search criteria and will return only one street. */

#-> Find Street Request
$jsonResponse = apiRequest(API_BASE_URL.'location/street/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "siteId" : 642279132,
  "name" : "ANDREI BARSEANU",
  "type" : "str."
}  
      

Destination Services Request examples
Destination Services Request will return all valid services between the sender and recipient addresses. view API documentation.
PHP example: The same example as JSON:
#-> Example 1. The sender has clientId, the recipient is a private person.
#-> SENDER
$senderArray = array(
   'clientId' => 1234567890
);
/* 
* If you have a warehouse in Bucharest, a shop in Brasov and an office in Braila, you'll have three objects with different clientIds, one for each object.
* When you want to send from one of these addresses of your objects, you can set the appropriate 'clientId'. 
* If you skip it, the sender will be the default one for the username with all the address and contact information. 
* All your 'clientId's can be obtained from the result of the Get Contract Clients Request.
*/

#-> RECIPIENT
$recipientArray = array(
   'privatePerson' => true,
   'addressLocation' => array(
      'siteId' => 642279132 // BUCHAREST
   )
); 
/* There is no need to define full address. The price of the courier service is the same for different addresses in a site. */

#-> JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'date' => date('Y-m-d'),
   'sender' => $senderArray, // You can skip the sender data. In this case the sender will be the default one for the username with all the address and contact information.
   'recipient' => $recipientArray
); 

#-> Destination Services Request
$jsonResponse = apiRequest(API_BASE_URL.'services/destination', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "date" : "2021-05-31",
  "sender" : {
    "clientId" : 1234567890
  },
  "recipient" : {
    "privatePerson" : true,
    "addressLocation" : {
      "siteId" : 642279132
    }
  }
}
      
#-> Example 2. The sender has clientId, the recipient is a private person in another country.
#-> SENDER
$senderArray = array(
   'clientId' => 1234567890
);
/* 
* If you have a warehouse in Bucharest, a shop in Brasov and an office in Braila, you'll have three objects with different clientIds, one for each object.
* When you want to send from one of these addresses of your objects, you can set the appropriate 'clientId'. 
* If you skip it, the sender will be the default one for the username with all the address and contact information. 
* All your 'clientId's can be obtained from the result of the Get Contract Clients Request.
*/

#-> RECIPIENT
$recipientArray = array(
   'privatePerson' => true,
   'addressLocation' => array(
      'countryId' => 300, // GREECE
      'postCode' => 54248 // Thessaloniki
   )
);

#-> JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'date' => date('Y-m-d'),
   'sender' => $senderArray, 
   'recipient' => $recipientArray
);

#-> Destination Services Request
$jsonResponse = apiRequest(API_BASE_URL.'services/destination', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "date" : "2021-05-31",
  "sender" : {
    "clientId" : 1234567890
  },
  "recipient" : {
    "privatePerson" : true,
    "addressLocation" : {
      "countryId" : 300,
      "postCode" : "54248"
    }
  }
}
      
#-> Example 3. The sender has clientId, the recipient is a private person in another country with full site nomenclature.
#-> SENDER
$senderArray = array(
   'clientId' => 1234567890
);
/* 
* If you have a warehouse in Bucharest, a shop in Brasov and an office in Braila, you'll have three objects with different clientIds, one for each object.
* When you want to send from one of these addresses of your objects, you can set the appropriate 'clientId'. 
* If you skip it, the sender will be the default one for the username with all the address and contact information. 
* All your 'clientId's can be obtained from the result of the Get Contract Clients Request.
*/

#-> RECIPIENT
$recipientArray = array(
   'privatePerson' => true,
   'addressLocation' => array(
      'countryId' => 100, // BULGARIA
      'siteId' => 68134 // SOFIA
   )
);

#-> JSON DATA
$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'date' => date('Y-m-d'),
   'sender' => $senderArray, 
   'recipient' => $recipientArray
);

#-> Destination Services Request
$jsonResponse = apiRequest(API_BASE_URL.'services/destination', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "date" : "2021-05-31",
  "sender" : {
    "clientId" : 1234567890
  },
  "recipient" : {
    "privatePerson" : true,
    "addressLocation" : {
      "countryId" : 100,
      "siteId" : 68134
    }
  }
}
      

Calculation Request Example view API documentation
PHP example: The same example as JSON:
#-> IA. SENDER (from an address)
$senderArray = array(
   'clientId' => 1234567890
);
/* 
* If you have a warehouse in Bucharest, a shop in Brasov and an office in Braila, you'll have three objects with different clientIds, one for each object.
* When you want to send from one of these addresses of your objects, you can set the appropriate 'clientId'. 
* If you skip it, the sender will be the default one for the username with all the address and contact information. 
* All your 'clientId's can be obtained from the result of the Get Contract Clients Request.
*/

#-> IB. SENDER (from an office)
$senderArray = array(s
   'clientId' => 1234567890,
   'dropoffOfficeId' => 926 // BUCHAREST - MOGOSOAIA (DPD OFFICE). The 'dropoffOfficeId' property overrides the address details
);



#-> IIA. RECIPIENT (to an address)
$recipientArray = array(
   'privatePerson' => true,
   'addressLocation' => array(
   'siteId' => 642140205 // BRASOV. The 'siteId' can be obtained from the result of a Find Site Request.
   )
);

#-> IIB. RECIPIENT (for self collection shipment from office)
$recipientArray = array(
   'privatePerson' => true,
   'pickupOfficeId' => 907 // BRASOV (DPD OFFICE). The 'pickupOfficeId' can be obtained from the result of a Find Office Request.
);



#-> III. SERVICE DETAILS
$serviceArray = array(
   'autoAdjustPickupDate' => true,
   'serviceIds' => array(2505) // The 'serviceId' list can be obtained from the result of a Destination Services Request.
);

#-> Additional services
/* Cash on delivery - Not mandatory */
$cashOnDeliveryArray = array(
   'amount' => 100,
   'processingType' => 'CASH' // (CASH, POSTAL_MONEY_TRANSFER)
);

/* Options before payment - Not mandatory */
$optionsBeforePaymentArray = array(
   'option' => 'OPEN', 
   'returnShipmentServiceId' => 2505, 
   'returnShipmentPayer' => 'SENDER' // (SENDER, RECIPIENT, THIRD_PARTY). The sender of the returning shipment is the recipient of the primary shipment.
);
/* 
The 'returnShipmentServiceId' property is the service for the returning shipment in case the recipient refuses to accept the primary shipment. 
It can be the same serviceId as in the primary shipment or one obtained from the result of a Destination Services Request.
*/

/* Declared value - Not mandatory */
$declaredValueArray = array(
   'amount' => 100, 
   'fragile' => true 
);

/* Additional services */
$additionalServicesArray = array(
   'cod' => $cashOnDeliveryArray,
   'obpd' => $optionsBeforePaymentArray,
   'declaredValue' => $declaredValueArray
);

/* Add additional services to the main service array */
$serviceArray['additionalServices'] = $additionalServicesArray;



#-> IV. CALCULATION CONTENT OF THE PARCEL
$contentArray = array(
   'parcelsCount' => 1,
   'totalWeight' => 0.6
);


#-> V. PAYMENTS
$paymentArray = array(
   'courierServicePayer' => 'RECIPIENT' // (SENDER, RECIPIENT, THIRD_PARTY)
);


#-> VI. JSON DATA.
$jsonData = array(
   'userName' => DPDRO_API_USERNAME,
   'password' => DPDRO_API_PASSWORD,
   'language' => LANGUAGE,
   'sender' => $senderArray, // You can skip the sender data. In this case the sender will be the default one for the username with all the address and contact information.
   'recipient' => $recipientArray,
   'service' => $serviceArray,
   'content' => $contentArray,
   'payment' => $paymentArray
);


#-> Calculate Request
$jsonResponse = apiRequest(DPDRO_API_BASE_URL.'calculate/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
A calculation to an address
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "sender" : {
    "clientId" : 1234567890
  },
  "recipient" : {
    "privatePerson" : true,
    "addressLocation" : {
      "siteId" : 642140205
    }
  },
  "service" : {
    "autoAdjustPickupDate" : true,
    "serviceIds" : [ 2505 ],
    "additionalServices" : {
      "cod" : {
        "amount" : 100.0,
        "processingType" : "CASH"
      },
      "declaredValue" : {
        "amount" : 100.0,
        "fragile" : true,
        "ignoreIfNotApplicable" : true
      },
      "obpd" : {
        "option" : "OPEN",
        "returnShipmentServiceId" : 2505,
        "returnShipmentPayer" : "SENDER"
      }
    }

  },
  "content" : {
    "parcelsCount" : 1,
    "totalWeight" : 0.6
  },
  "payment" : {
    "courierServicePayer" : "RECIPIENT"
  }
}



A calculation to an office
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "sender" : {
    "clientId" : 1234567890
  },
  "recipient" : {
    "privatePerson" : true,
    "pickupOfficeId" : 907
  },
  "service" : {
    "autoAdjustPickupDate" : true,
    "serviceIds" : [ 2505 ],
    "additionalServices" : {
      "cod" : {
        "amount" : 100.0,
        "processingType" : "CASH"
      },
      "declaredValue" : {
        "amount" : 100.0,
        "fragile" : true,
        "ignoreIfNotApplicable" : true
      },
      "obpd" : {
        "option" : "OPEN",
        "returnShipmentServiceId" : 2505,
        "returnShipmentPayer" : "SENDER"
      }
    }

  },
  "content" : {
    "parcelsCount" : 1,
    "totalWeight" : 0.6
  },
  "payment" : {
    "courierServicePayer" : "RECIPIENT"
  }
}
      

Track Request examples
For testing purposes, please use the provided bills of lading: 299999990, 299999991, 299999992, 299999993. view API documentation

Good practices using the tracking method:
- Use the tracking method 3 to 5 times per day for a shipment or on demand;
- In case you are tracking the shipment more than once, and updating its status locally, set the "lastOperationOnly" property to "true". The volume of data in the response will be smaller and the execution time faster.
- Do not track already delivered shipments. The following statuses are final for a shipment, and after such a status, there will be no other status:
- Do not track old shipments for which you are receiving such an error message "Shipment data is no longer available";
- Do not track shipments with the error message "Shipment is not accessible". You haven't permission to do it;
- Avoid to track the shipments during nighttime. At this time the shipments are traveling and you will not receive any valuable information.
PHP example: The same example as JSON:
#-> Example 1. Track a parcel.
$parcelsArray = array(
   array('id' => 299999990)
);

$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'parcels' => $parcelsArray
);

#-> Track parcel Request
$jsonResponse = apiRequest(API_BASE_URL.'track/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "parcels" : [ {
    "id" : "299999990"
  } ]
}
      
#-> Example 2. Track a parcel and return only last operation.
$parcelsArray = array(
   array('id' => 299999990)
);

$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'parcels' => $parcelsArray,
   'lastOperationOnly' => true
);

#-> Track parcel Request
$jsonResponse = apiRequest(API_BASE_URL.'track/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "parcels" : [ {
    "id" : "299999990"
  } ],
  "lastOperationOnly" : true
}
      
#-> Example 3. Track more than one (up to 10) parcels with one request.
$parcelsArray = array(
   array('id' => 299999990),
   array('id' => 299999991),
   array('id' => 299999992),
   array('id' => 299999993)
);

$jsonData = array(
   'userName' => API_USERNAME,
   'password' => API_PASSWORD,
   'language' => LANGUAGE,
   'parcels' => $parcelsArray
);

#-> Track parcel Request
$jsonResponse = apiRequest(API_BASE_URL.'track/', $jsonData);
$jsonResponse = json_decode($jsonResponse, true);

#-> Print the result
print_r($jsonResponse);     
{
  "userName" : "xxxxxx",
  "password" : "yyyyyy",
  "language" : "EN",
  "parcels" : [ {
    "id" : "299999990"
  }, {
    "id" : "299999991"
  }, {
    "id" : "299999992"
  }, {
    "id" : "299999993"
  } ]
}
      
Define address examples.
The address structure is used to provide addresses. Addresses are two types:
- Address type 1 (local addresses - currently supported by Romania and Bulgaria);
- Address type 2 (foreign addresses - all non-local countries);
'addressType' property obtained from the result of a Find Country Request

When address is required (i.e. when clientId is null), the following rule must be met:
not empty street (streetId or type&name) and (streetNo or blockNo)
or
not empty complex (complexId or type&name) and (streetNo or blockNo)
or
not empty poi (poiId)
or
all components of the address within the site stored in addressNote.

If the addressType is 1 and 'addressNomenclature' property for the site is 1 or 2, you should try to define the address using ids of site, street, complex etc.
or by exact match from 'complexType' and 'complexName' or/and by exact match from 'streetType' and 'streetName'.
When the address is well defined via ids or/and matches it will be processed automatically.
Otherwise the address will be placed in the 'addressNote' property. It will not be processed automatically and there are probabilities for mistakes and delay of the delivery.

PHP example: The same example as JSON:
#-> Example 1. Defined address via ids (the 'addressType' property has a value 1 and 'addressNomenclature' property of the site has value 1 or 2).
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request.
   'siteId' => 642279132, // BUCHAREST. The 'siteId' can be obtained from the result of a Find Site Request.
   'streetId' => 642077434, // A street named 'ALECU MATEEVICI'. The 'streetId' can be obtained from the result of a Find Street Request.
   'streetNo' => '1',
   'blockNo' => '101',
   'entranceNo' => '2',
   'floorNo' => '3',
   'apartmentNo' => '4'
);
"address" : {
  "countryId" : 642,
  "siteId" : 642279132,
  "streetId" : 642077434,
  "streetNo" : "1",
  "blockNo" : "101",
  "entranceNo" : "2",
  "floorNo" : "3",
  "apartmentNo" : "4"
}
      
#-> Example 2a. An address defined by exact match from 'siteType' and 'siteName' exact match from 'streetType' and 'streetName' 
#-> (the 'addressType' property has a value 1 and 'addressNomenclature' property of the site has value 1 or 2).
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteType' => 'or.', // The 'siteType' can be obtained from the result of a Find Country Request.
   'siteName' => 'BUCHAREST', 
   'streetType' => 'str.', // The 'streetType' can be obtained from the result of a Find Country Request.
   'streetName' => 'ALECU MATEEVICI', // The 'streetName' can be obtained from the result of a Find Street Request.
   'streetNo' => '1'
);
/* 
* If there is exact match from 'siteType' and 'siteName', the id of the site will be added automatically. 
* If there is exact match from 'streetType' and 'streetName', the id of the street will be added automatically. 
* If there is not exact match from 'streetType' and 'streetName' the address will be placed in the 'addressNote' property.
*/
"address" : {
  "countryId" : 642,
  "siteType" : "or.",
  "siteName" : "BUCHAREST",
  "streetType" : "str.",
  "streetName" : "ALECU MATEEVICI",
  "streetNo" : "1"
}
      
#-> Example 2b. An address defined by exact match from 'siteType' and 'postCode' exact match from 'streetType' and 'streetName' 
#-> (the 'addressType' property has a value 1 and 'addressNomenclature' property of the site has value 1 or 2).
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteName' => 'BUCHAREST', 
   'postCode' => '010011', 
   'streetType' => 'str.', // The 'streetType' can be obtained from the result of a Find Country Request.
   'streetName' => 'ALECU MATEEVICI', // The 'streetName' can be obtained from the result of a Find Street Request.
   'streetNo' => '1'
);
/* 
* If there is exact match from 'siteType' and 'postCode', the id of the site will be added automatically. 
* If there is exact match from 'streetType' and 'streetName', the id of the street will be added automatically. 
* If there is not exact match from 'streetType' and 'streetName' the address will be placed in the 'addressNote' property.
*/
"address" : {
  "countryId" : 642,
  "siteName" : "BUCHAREST",
  "postCode" : "010011",
  "streetType" : "str.",
  "streetName" : "ALECU MATEEVICI",
  "streetNo" : "1"
}
      
#-> Example 5. An address defined by 'siteId' and exact match from 'streetType' and 'streetName'.
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteId' => 642279132, // BUCHAREST. The 'siteId' can be obtained from the result of a Find Site Request.
   'streetType' => 'str.', // The 'streetType' can be obtained from the result of a Find Country Request.
   'streetName' => 'ALECU MATEEVICI', // The 'streetName' can be obtained from the result of a Find Street Request.
   'streetNo' => '1'
);
/* 
* If there is exact match from 'streetType' and 'streetName', the id of the street will be added automatically. 
* If there is not exact match, the address will be placed in the 'addressNote' property.
*/
"address" : {
  "countryId" : 642,
  "siteId" : 642279132,
  "streetType" : "str.",
  "streetName" : "ALECU MATEEVICI",
  "streetNo" : "1"
}
      
#-> Example 6. The address defined by 'poiId' and some additional info filled in the 'addressNote'.
$recipientAddressArray = array(
   'countryId' => 100, // BULGARIA. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteId' => 68134, // SOFIA. The 'siteId' can be obtained from the result of a Find Site Request.
   'poiId' => 68134000483088, // NATIONAL ART GALLERY. The 'poiId' can be obtained from the result of a Find POI Request.
   'addressNote' => '2nd floor, office 201'
);
"address" : {
  "countryId" : 100,
  "siteId" : 68134,
  "poiId" : 68134000483088,
  "addressNote" : "2nd floor, office 201"
}
      
#-> Example 7a. The whole address is placed in the 'addressNote' field. 
#-> It will be not processed automatically and there are probabilities for mistakes and delay of the delivery.
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteId' => 642279132, // BUCHAREST. The 'siteId' can be obtained from the result of a Find Site Request.
   'addressNote' => 'ALECU MATEEVICI str., No.1, bl.301, ent.2, fl.3, ap.4' 
);
"address" : {
  "countryId" : 642,
  "siteId" : 642279132,
  "addressNote" : "ALECU MATEEVICI str., No.1, bl.301, ent.2, fl.3, ap.4"
}
      
#-> Example 7b. The whole address is placed in the 'addressNote' field. 
#-> It will be not processed automatically and there are probabilities for mistakes and delay of the delivery.
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteType' => 'or.', // The 'siteType' can be obtained from the result of a Find Country Request.
   'siteName' => 'BUCHAREST', 
   'addressNote' => 'ALECU MATEEVICI str., No.1, bl.301, ent.2, fl.3, ap.4' 
);
/* If there is exact match from 'siteType' and 'siteName', the id of the site will be added automatically. */
"address" : {
  "countryId" : 642,
  "siteType" : "or.",
  "siteName" : "BUCHAREST",
  "addressNote" : "ALECU MATEEVICI str., No.1, bl.301, ent.2, fl.3, ap.4"
}
      
#-> Example 7c. The whole address is placed in the 'addressNote' field. 
#-> It will be not processed automatically and there are probabilities for mistakes and delay of the delivery.
$recipientAddressArray = array(
   'countryId' => 642, // ROMANIA. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteName' => 'BUCHAREST', 
   'postCode' => 010011, 
   'addressNote' => 'ALECU MATEEVICI str., No.1, bl.301, ent.2, fl.3, ap.4' 
);
/* If there is exact match from 'siteName' asd 'postCode', the id of the site will be added automatically. */
"address" : {
  "countryId" : 642,
  "siteName" : "BUCHAREST",
  "postCode" : "010011",  
  "addressNote" : "ALECU MATEEVICI str., No.1, bl.301, ent.2, fl.3, ap.4"
}  
      
#-> Example 8a. A foreign address (the addressType property has a value 2).
$recipientAddressArray = array(
   'countryId' => 276, // GERMANY. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteName' => 'MUNICH', 
   'postCode' => 80331, // Depends from the 'postCodeFormats' property from the result of a Find Country Request. It shows the required post code format. 
   'addressLine1' => 'Sankt-Jakobs-Platz 1', // Required for 'addressType' 2
   'addressLine2' => 'Munich Stadtmuseum' /* Not mandatory */
);
"address" : {
  "countryId" : 276,
  "siteName" : "MUNICH",
  "postCode" : "80331",  
  "addressLine1" : "Sankt-Jakobs-Platz 1",
  "addressLine2" : "Munich Stadtmuseum"
}    
      
#-> Example 8b. A foreign address (the addressType property has a value 2).
$recipientAddressArray = array(
   'countryId' => 300, // GREECE. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteName' => 'THESSALONIKI', 
   'postCode' => 54629, // Depends from the 'postCodeFormats' property from the result of a Find Country Request. It shows the required post code format. 
   'addressLine1' => '28 Monastiriou str', // Required for 'addressType' 2
   'addressLine2' => 'Bus station' /* Not mandatory */
);
"address" : {
  "countryId" : 300,
  "siteName" : "THESSALONIKI",
  "postCode" : "54629",  
  "addressLine1" : "28 Monastiriou str",
  "addressLine2" : "Bus station"
}    
      
#-> Example 8c. A foreign address (the addressType property has a value 2).
$recipientAddressArray = array(
   'countryId' => 250, // FRANCE. The 'countryId' can be obtained from the result of a Find Country Request. 
   'siteName' => 'PARIS', 
   'postCode' => 75016, // Depends from the 'postCodeFormats' property from the result of a Find Country Request. It shows the required post code format. 
   'addressLine1' => '24 Rue du Commandant Guilbaud', // Required for 'addressType' 2
   'addressLine2' => 'Parc des Princes Stadium' /* Not mandatory */
);
"address" : {
  "countryId" : 250,
  "siteName" : "PARIS",
  "postCode" : "75016",  
  "addressLine1" : "24 Rue du Commandant Guilbaud",
  "addressLine2" : "Parc des Princes Stadium"
}    
      

Describe parcels or pallets examples view API documentation
PHP example: The same example as JSON:
// Array for all parcels. All dimensions are in centimeteres. For pallets use standart pallet's dimensions such as 120/80/130.
$parcelsArray = array(); 

// Parcel 1
$parcelSizeArray = array(
   'width' => 10,
   'depth' => 20,
   'height' => 30
);
$parcelArray = array(
   'seqNo' => 1,
   'size' => $parcelSizeArray,
   'weight' => 1.5,
   'ref1' => 'ORDER 123456, 1st Box'
);
$parcelsArray[] = $parcelArray; // Add first parcel

// Parcel 2
$parcelSizeArray = array(
   'width' => 5,
   'depth' => 15,
   'height' => 25
);
$parcelArray = array(
   'seqNo' => 2,
   'size' => $parcelSizeArray,
   'weight' => 0.5,
   'ref1' => 'ORDER 123456, 2nd Box'
);
$parcelsArray[] = $parcelArray; // Add second parcel

$contentArray['parcels'] = $parcelsArray; // Add all parcels in the content array in the Create Shipment Request above.
  "parcels" : [ {
    "seqNo" : 1,
    "size" : {
      "width" : 10,
      "height" : 30,
      "depth" : 20
    },
    "weight" : 1.5,
    "ref1" : "ORDER 123456, 1st Box"
  }, {
    "seqNo" : 2,
    "size" : {
      "width" : 5,
      "height" : 25,
      "depth" : 15
    },
    "weight" : 0.5,
    "ref1" : "ORDER 123456, 2nd Box"
  } ]
      

Additional explanation of some errors


Access to detailed/licensed address nomenclatures required
"context" : "",
"message" : "Access to detailed/licensed address nomenclatures required ({errorCode})",
To receive information from some methods such as "Get All Streets", "Get All Complexes", "Get All Blocks", and "Get All Points of Interests" a license for address nomenclatures is required. Such license can be purchased from DATAMAP-EUROPE. Your Speedy representative can assist you. After purchasing we will permit your username to access the nomenclature.

Collection time is after courier address serving deadline. You can change collection date to next available day
"context" : "collection-term-expired",
"message" : "Collection time is after courier address serving deadline. You can change collection date to next available day ({errorCode}),
The reason for such an error is that the shipment creation moment is after the end of the working time of the couriers or the serving time of the city/village of the sender.
The error is displayed when the shipment is from an address and you skipped "pickupDate" property or provided the current date.
To avoid similar errors you can use the "autoAdjustPickupDate" property (service -> autoAdjustPickupDate) or set another future pickup date.
"autoAdjustPickupDate" will set automatically the next possible date. In case you want to specify the date, you can select one from the next 10 possible pickup dates that can be retrieved using the Pickup Terms method.

Money transfer amount not allowed for the selected sender
"context" : "sla.cod.moneyTransfer.money-transfer-not-allowed-for-sender",
"message" : "Money transfer amount not allowed for the selected sender ({errorCode}),
Possible reasons for such error can be:
- The usage of the money transfer has to be allowed in the contract of the sender. For more information, please get in touch with your Speedy representative.
- Money transfer is a domestic additional service allowed only for shipments within Bulgaria.

No connection to external carrier ACS
"context" : "connection_exception",
"message" : "No connection to external carrier ACS ({errorCode})",
For some international shipments we are using external carrier partners. The error "says" the connection to our external carrier is temporary unavailable. Try again later.

Options before payment details: Options before payment are not allowed for shipments with Locker pickup
"context" : "sla.cod.obpDetails.apt-pickup-not-allowed-with-obp",
"message" : "Options before payment details: Options before payment are not allowed for shipments with Locker pickup ({errorCode})",
Тhe options before payment are not allowed for shipments to a locker. The reason is that the potential return is not allowed.
The locker is a machine, and there is no courier to hand over the shipment for contents check.

Options before payment details: Service not allowed
"context" : "sla.cod.obpDetails.sla.serviceId.service-not-allowed",
"message" : "Options before payment details: Service not allowed ({errorCode})",
The provided service in the "obpd" structure is not allowed or not applicable between the locations of the sender and the recipient.
Usually, the service for the return is the same as the primary one. Also, you can call the Destination Services method to get all valid services that you can use.

Parcels: Parcel size is required
"context" : "content.parcels..require_parcel_size",
"message" : "Parcels: Parcel size is required ({errorCode})",
The error indicates that for the shipment with provided data, parcel sizes are required. Describe the parcels in the "content" > "parcels" structure of the used method for calculating or creating a shipment.
Here are some examples of how to do it Describe parcels or pallets examples.

Payer: Your own client or contract client should be payer or sender
"context" : "payment.csPayment.payerRole.payer-should-be-contract-client-or-own-client",
"message" : "Payer: Your own client or contract client should be payer or sender ({errorCode})",
The error means that you (the user who is creating the shipment) have to be the payer of the courier service or the sender of the shipment.
It may refer to the payer of the declared value if it is provided or to the packaging if it must be paid.
Please, check the Shipment Payment structure.
Regardless of whether you are the sender or the recipient, always try to represent yourself using your client ID (the "cliеntId" property) in the "sender" or the "recipient" structure. The "clientId" summarizes your address and company data. Using the "clientId" property, there is no need to provide address details and client name. Using the ID, we are recognizing you.
In case you are a third party, you must always be the payer of the courier service. Set your client ID in the "thirdPartyClientId" property and "courierServicePayer" property to "THIRD_PARTY" (in the "ShipmentPayment" structure).
You can retrieve your client IDs using a "Get Contract Clients" request.

Recipient Locality: Invalid site
"context" : "receiver.address.siteId.valid-locality-id",
"message" : "Recipient Locality: Invalid site ({errorCode})",
Such an error appears because of an invalid recipient site (city/village). Check the recipient address data. Possible mistakes are:
- The "siteId" property has an invalid value. The "siteId" can be found using the Find Site request. Also, all site IDs in Bulgaria/Romania can be retrieved and stored locally via the Get All Sites requst.
- An invalid name was provided in the "siteName" property. It has to contain only the name of the site ("SOFIA", "VARNA", etc.), without any other details as type, postcode, etc. Keep in mind that there can be more than one site with the same name, so you can try to provide additional information, such as the postcode in the appropriate field.
- Invalid combination of values for the "siteName" and "postCode" properties.
- Invalid combination of values for the "siteId" and "postCode" properties (in general, the combination of these two properties is possible, but if you are providing "siteId", there is no need to provide any other data for the site).

Recipient - Pickup office: Invalid recipient pickup office
"context" : "shipment_party_validator.recipient.office.invalid",
"message" : "Recipient - Pickup office: Invalid recipient pickup office (id: {officeId}) ({errorCode})",
The provided pickup point is not working on the calculated delivery date, or it is permanently closed.
To avoid such errors, you can download a full list of offices (pickup/drop-off points), store it locally, and offer the users to select from this list. To retrieve the list once per day is enough.

Recipient Post code: Invalid post code
"context" : "receiver.address.postCode.invalid-postcode",
"message" : "Recipient Post code: Invalid post code ({errorCode})",
The error means that the provided postcode is invalid or not served by our international partners if the shipment is for another country. Before calling the "Create Shipment" method, you can validate the postcode using the Validate Postcode request. Also, you can download a list with all post codes in Bulgaria and Romania using the Get All Postcodes method and make your own validation.
In case the recipient is not in Bulgaria or Romania, you can realize other validation. Call the Find Country request, and check the Find Country Response for the "postCodeFormats" property. It will show you the required postcodes formats.

Sender site is not served on pickup date
"context" : "address-collection-abroad-not-allowed",
"message" : "Sender site is not served on pickup date ({errorCode})",
The pickup date has to be a working day (not a holiday), and the site to be serviced on the date.
To avoid such errors, you can use the "autoAdjustPickupDate" property in the Create Shipment method. This property will automatically set the first available date for pickup.
If you still want to use the "pickupDate" property, you can call the "Pickup Terms" method to receive the next 10 available dates for pickup and provide one of them for "pickupDate".

Service: Service not allowed
"context" : "sla.serviceId.service-not-allowed",
"message" : "Service: Service not allowed ({errorCode})",
The provided service is not allowed or not applicable. When you know the recipient's address, you can call the Destination Services method to get all valid services you can use in this case.

Shipment data is no longer available
"context" : "shipment-data-no-longer-available",
"message" : "Shipment data is no longer available ({errorCode})",
The error appears when the Track method is used. It means that the shipment is old, and we do not provide data for shipments older than 6 months.
Please, contact your Speedy representative if you need information about an old shipment.

Shipment is not accessible
"context" : "shipment-not-accessible",
"message" : "Shipment is not accessible ({errorCode})",
The shipment you are trying to track is not yours. The users cannot track shipments created by other users from different contracts, even if the contracts are for the same client.
Verify that the user you are using in the request for retrieving the information is the same one who created the waybill.
If in the scope of the contract, there is more than one user, each one of them can check waybills created by another one.

Weight: Weight is over allowed maximum of 30kg. for selected service ({errorCode})
"context" : "content.weight.weight-over-maximum",
"message" : "Weight: Weight is over allowed maximum of 30kg. for selected service ({errorCode})",
Such an error appears when the weight is more than what is allowed for the service or the destination.
In case you are providing parcel size, also check the provided dimensions.
We are calculating volumetric weight based on the sizes. The volumetric weight is determined at a ratio 1 cubic meter = 200 kg.
For example, the volumetric weight of a parcel with dimensions 63 x 46 x 53 in centimeters is 0.63 x 0.46 x 0.53 * 200 = 30.719 kg.
The tariff weight of the parcel on which it is charged is the higher between the physical and volumetric weight.
You can receive more information by visiting our website or contacting your Speedy representative.
DPD Romania, 2025.