You are on page 1of 35

Direct Parcel Distribution SK, s.r.o.

Order integration via web service

Abbreviations, icons used


Service design
SOAP
JSON
Service endpoint
Authentication
Shipment
Order via web service
Structure
AddressEnvelope
PickupEnvelope
TimeWindowEnvelope
Additional services
Cod
BankAccountEnvelope
Swap
Saturday Delivery (SD)
Notification
Instruction
IDCheck
ParcelShopDelivery
CollectionRequest (CR)
CityService (CS)
Shipment types
Standard shipment
City Service shipment
Collection Request shipment
Response
Error output
Error codes

Abbreviations, icons used


Abbreviation Description

CR Collection request

CS City service

Icon Description

Mandatory field

Optional field

Conditionally mandatory field (mandatory, if....)

Value allowed

Value not allowed

Web service
Web service is a Remote Procedure Call (RPC) through HTTP protocols.

DPD supports two types of web service:

1. SOAP
2. JSON-RPC2

(c)2013 Page -1-


Direct Parcel Distribution SK, s.r.o.

Service design
RPC method for shipment storage is create.

SOAP
SOAP request consists of three parts:

1. ShipmentService_v1.wsdl - main definition file of service


2. ShipmentSchema_v1.xsd - defines the method structure
3. DPDSecurity_v2.xsd - authentication scheme

JSON
JSON request has a simpler structure, it is an object serialized with JSON. It has

following features:

jsonrpc - version of JSON-RPC protocol. Needs to be set to 2.0


method - string, which contains the name of the method
params - send array of objects as method arguments
id - request identification. Any type can be used. It is used for response and request pairing.

Service end point


SOAP - https://api.dpdportal.sk/shipment/soap
JSON-RPC2 - https://api.dpdportal.sk/shipment/json

Definition is fully valid in accordance with WS-I Compliance

Authentication
Correctly filled security token (DPDSecurity) is a condition for successful service call.

SOAP

<ns1:DPDSecurity>
<ns1:SecurityToken>
<ns1:ClientKey>?</ns1:ClientKey>
<ns1:Email>?</ns1:Email>
</ns1:SecurityToken>
</ns1:DPDSecurity>

JSON

"DPDSecurity":
{
"SecurityToken":
{
"ClientKey": "?",
"Email": "?"
}
}

(c)2013 Page -2-


Direct Parcel Distribution SK, s.r.o.

Security token includes two set of values:

ClientKey - it will be generated and send to you


Email - email address, which is used for your login www.dpdportal.sk

You have to create an account on www.dpdportal.sk and we will generate and provide you a ClientKey.

Shipment
Shipment is a transport order, which includes parcels, which have one recipient.

Order via web service

Order is sent to the relevant endpoint. Data is validated. If the data is correct, the shipment is stored. If the data is not correct, validation
reports are returned.
It is possible to send various shipments in one request.

Structure
Element Data type Description

reference varchar(35) Shipment identification


(should be a unique value).
Used for shipment
identification in response.

delisId varchar(25) Identification of contract customer.

addressSender AddressEnvelope Address of Sender

addressRecipient AddressEnvelope Address of Recipient

product integer Identification number of DPD


product

1 - DPD classic
2 - DPD 18:00
3 - DPD 10:00
4 - DPD 12:00
5 - COD (cash on delivery)
6 - Saturday Delivery
7 - Small Parcel
8 - DPD Guarantee
9 - DPD Home
10 - City service standard
17 - Parcelshop (consignor to
shop)

additionalServices array List of additional services

parcels array of ParcelEnvelopes List of parcels in shipment

note varchar(70) Shipment note (shown on the label)

pickup PickupEnvelope Shipment pick-up information

(c)2013 Page -3-


Direct Parcel Distribution SK, s.r.o.

AddressEnvelope
Address information.

Element Data type Description

id integer Address identification number

type char(3) Address type

b2b - business
b2c - client
psd - parcelShop

name varchar(50) Contact person

nameDetail varchar(50) Contact person [detail]

street varchar(35) Street (without house number)

houseNumber varchar(10) House number

streetDetail varchar(35) Street [detail] (without house number)

zip varchar(7) (depends on country) ZIP code

country smallint Country identification number

city varchar(35) City

phone varchar(30) Phone number

email varchar(50) Email address

reference varchar(35) Address reference (e.g.


specific code for the client)

note varchar(70) Address note

ico varchar(20) (type = b2b) Identification number

vatId varchar(20) (type = b2b) Tax identification number

vatId2 varchar(20) VAT identification number

Application:

only enter the address identification number. Existing address is used in this case.

SOAP

<ns1:address>
<ns1:id>?</ns1:id>
</ns1:address>

JSON

"address":
{
"id": ?
}

enter address details. New address is saved in this case.

(c)2013 Page -4-


Direct Parcel Distribution SK, s.r.o.

enter address details. New address is saved in this case.

SOAP

<ns1:address>
<ns1:type>?</ns1:type>
<ns1:name>?</ns1:name>
<ns1:nameDetail>?</ns1:nameDetail>
<ns1:street>?</ns1:street>
<ns1:streetDetail>?</ns1:streetDetail>
<ns1:houseNumber>?</ns1:houseNumber>
<ns1:zip>?</ns1:zip>
<ns1:country>?</ns1:country>
<ns1:city>?</ns1:city>
<ns1:phone>?</ns1:phone>
<ns1:email>?</ns1:email>
<ns1:reference>?</ns1:reference>
<ns1:note>?</ns1:note>
<ns1:ico>?</ns1:ico>
<ns1:vatId>?</ns1:vatId>
<ns1:vatId2></ns1:vatId3>
</ns1:address>

JSON

"address":
{
"type": "?",
"name": "?",
"nameDetail: "?",
"street: "?",
"streetDetail: "?",
"houseNumber: "?",
"zip: "?",
"country: "?",
"city: "?",
"phone: "?",
"email: "?",
"reference: "?",
"note: "?",
"ico: "?",
"vatId: "?",
"vatId2": "?"
}

ParcelEnvelope
Element Data type Description

reference1 varchar(35) Reference no. 1 for given parcel

reference2 varchar(35) Reference no. 2 for given parcel

(c)2013 Page-5-
Direct Parcel Distribution SK, s.r.o.

reference3 varchar(35) Reference no. 3 for given parcel

weight float(3,2) Parcel weight in kg

width smallint (in case of standard shipment) Parcel width in cm

height smallint (in case of standard shipment) Parcel height in cm

Parcel depth in cm
depth smallint (in case of standard shipment)

Parcel reference is an own identification for given parcel (defined by customer).

SOAP

<ns1:parcel>
<ns1:reference1>?</ns1:reference1>
<ns1:reference2>?</ns1:reference2>
<ns1:reference3>?</ns1:reference3>
<ns1:weight>?</ns1:weight>
<ns1:height>?</ns1:height>
<ns1:width>?</ns1:width>
<ns1:depth>?</ns1:depth>
</ns1:parcel>

JSON

"parcel":
{
"reference1": "?",
"reference2": "?",
"reference3": "?",
"weight": ?,
"height": ?,
"width": ?,
"depth": ?
}

PickupEnvelope
Pickup determines the date and time when the shipment is picked up.

Pick up creation:

if pick-up is not created for a given day, it will be created automatically.


if a pick-up is created for a given day, this pick-up shall be used for that day.

Element Data type


Description

(c)2013 Page-6-
Direct Parcel Distribution SK, s.r.o.

date char(8) Pick-up date format


YYYYMMDD
YYYY - year
MM - month
DD - day

Example:
20140101 means date
01.01.2014

timeWindow TimeWindowEnvelope (in case of standard shipment) Pick-up time window (time, when
the shipment is to be picked up)

note varchar(70) Pick-up note

SOAP

<ns1:pickup>
<ns1:date>?</ns1:date>
<ns1:timeWindow>
<ns1:beginning>?</ns1:beginning>
<ns1:end>?</ns1:end>
</ns1:timeWindow>
<ns1:note>?</ns1:note>
</ns1:pickup>

JSON

"pickup":
{
"date": "?",
"timeWindow": [TimeWindowEnvelope],
"note": "?"
}

TimeWindowEnvelope
Time (from-to) when the shipment is to be picked up.

Minimal difference between the beginning and end of interval is four hours.

Interval beginning (from):

for pick up for given day - 12:00


for pick up in future - 09:00

Interval end (to):

for pick up for given day - 17:00


for pick up in future - 19:00

If interval end is not set and interval beginning is set (e.g. at 10:00), interval end is then automatically set four hours later (e.g. at 14:00).
If interval beginning is not set and interval end is set (e.g. at 14:00), interval beginning is then automatically set four hours earlier (e.g. at
10:00).

Element Data type Description

(c)2013 Page-7-
Direct Parcel Distribution SK, s.r.o.

beginning char(4) (If second interval end Time window beginning format
is not set) HHMM (24 hour format)
HH - hour

MM - minutes

Example:

0910 means 09:10


(AM)
1701 means 17:01,
(05:01 PM)

end char(4)

(If second interval end Time window beginning format


is not set) HHMM (24 hour format)

HH - hour
MM - minutes

Example:

0910 means 09:10


(AM)
1701 means 17:01,
(05:01 PM)

SOAP

<ns1:timeWindow>
<ns1:beginning>?</ns1:beginning>
<ns1:end>?</ns1:end>
</ns1:timeWindow>

JSON
"timeWindow":
{
"beginning": "?",
"end": "?"
}

Additional services
Cod
Cod (cash on delivery) is an additional service, that allows the customer to pay on delivery.

Element Data type Description

amount float(10,2) The required amount to be


paid by recipient on delivery of
shipments

Page-8-
Direct Parcel Distribution SK, s.r.o.

currency varchar(3) ISO code of currency:

EUR
CZK
PLN
HUF

bankAccount BankAccountEnvelope Bank account of Sender


for COD to be paid.

paymentMethod smallint Payment method of COD


Recipient:

0 - cash only

1 - cash and card

variableSymbol varchar(10) Variable symbol

SOAP

<ns1:cod>
<ns1:amount>?</ns1:amount>
<ns1:currency>?</ns1:currency>
<ns1:bankAccount>
[BankAccountEnvelope]
</ns1:bankAccount>
<ns1:variableSymbol>?</ns1:variableSymbol>
<ns1:paymentMethod>?</ns1:paymentMethod>
</ns1:cod>

JSON

"cod":
{
"amount": ?,
"currency": "?",
"bankAccount": [BankAccountEnvelope],
"variableSymbol": "?",
"paymentMethod": "?"
}

BankAccountEnvelope
Bank account details.

Element Data type Description

id int Bank account identification


number

name varchar(25) Bank account name

prefix integer Bank account prefix

number varchar(30) Bank account number

bankCode varchar(4) Bank code

(c)2013 Page-9-
Direct Parcel Distribution SK, s.r.o.

iban varchar(40) IBAN

swift varchar(20) SWIFT

Applications:

enter only Bank account identification number. Current account is used in this case.

SOAP

<ns1:bankAccount>
<ns1:id>?</ns1:id>
</ns1:bankAccount>

JSON
"bankAccount":
{
"id": ?
}

enter Bank account details. New bank account is saved in this case.

SOAP

<ns1:bankAccount>
<ns1:name>?</ns1:name>
<ns1:prefix>?</ns1:prefix>
<ns1:number>?</ns1:number>
<ns1:bankCode>?</ns1:bankCode>
<ns1:iban>?</ns1:iban>
<ns1:swift>?</ns1:swift>
</ns1:bankAccount>

JSON

"bankAccount":
{
"name: "?",
"prefix: "?",
"number: "?",
"bankCode: "?",
"iban: "?",
"swift": "?"
}

Swap
SWAP (swap parcel) is an additional service, which allows the exchange of product or parcel on delivery and its subsequent sending.

Example for the use of SWAP service:

(c)2013 Page-10-
Direct Parcel Distribution SK, s.r.o.

Example for use of SWAP service:

Sender address is A ,recipient address is B.

If AB type of SWAP service is chosen, the sender address of the return parcel is set to B and recipient address to A

If ABC type of SWAP service is chosen , the sender address of the return parcel is set to B and recipient address to C

Element Data type Description

type Varchar(3) SWAP service type:

AB - vice versa

ABC - to 3rd address

address AddressEnvelope (type = ABC) Address, where the return parcel


is to be returned

note Varchar(70) Note for return parcel

count smallint Return parcel count

SOAP

<ns1:swap>
<ns1:type>?</ns1:type>
<ns1:address>
[AddressEnvelope]
</ns1:address>
<ns1:note>?</ns1:note>
<ns1:count>?</ns1:count>
</ns1:swap>

"swap":
{
"type": "?",
"address": [AddressEnvelope],
"note": "?",
"count": ?
}

Saturday Delivery (SD)


Saturday delivery is an additional service, which ensures that your shipment is delivered to the recipient during the weekend. Shipment will be
delivered on Saturday by 17:00, but on standard by 12:00. Saturday delivery can be used only in selected cities.

If you wish to use this service. please enter one of the following values:

Value JSON SOAP

true

TRUE

If you do not wish to use this service, do not enter this service but enter one of the following values:

(c)2013 Page-11-
Direct Parcel Distribution SK, s.r.o.

Value JSON SOAP

false

FALSE

SOAP

<ns1:saturdayDelivery>?</ns1:saturdayDelivery>

JSON

"saturdayDelivery": ?

Notification
Notification on shipment delivery

You can use more notifications, but the notification types cannot be identical.

Element Data type Description

type smallint Notification type:

1 - e-mail [default]
3 - sms

destination Varchar(50) “Destination” of notification delivery.

Phone number:

+421908123123

E-mail:

example@mail.com

rule Smallint Notification rule:

1 - notification about
delivery next day
904 - interactive delivery
[default]
902 - delivery to DPD
ParcelShop

language Varchar(2) Alpha 2 ISO country


code/language [SK is default]

(c)2013 Page-12-
Direct Parcel Distribution SK, s.r.o.

SOAP

<ns1:notifications>
<ns1:notification>
<ns1:destination>?</ns1:destination>
<ns1:type>?</ns1:type>
<ns1:rule>?</ns1:rule>
<ns1:language>?</ns1:language>
</ns1:notification>
</ns1:notifications>

JSON

"notification":
[
{
"destination": "?",
"type": ?,
"rule": ?,
"language": "?"
},

Instruction
Instruction/information from the customer. It is a free text, but only ASCII characters are supported. Allowed after request of the customer.

SOAP

<ns1:instruction>?</ns1:instruction>

JSON

"instruction": "?"

IDCheck
Once this additional service is chosen for your shipment, this will be delivered exclusively into the hands of the given person, after providing an
identification document (ID card, passport or driving license). Delivery shall be recorded in our system, with the number of the document, which
can be easily verified.

Element Data type Description

name varchar(35) Name of person to be checked

(c)2013 Page-13-
Direct Parcel Distribution SK, s.r.o.

surname varchar(35)
Surname of person to be checked

documentId varchar(35) Document number (ID card,


passport, driving license )

SOAP

<ns1:idCheck>
<ns1:name>?</ns1:name>
<ns1:surname>?</ns1:surname>
<ns1:documentID>?</ns1:documentID>
</ns1:idCheck>

JSON

"idCheck":
{
"name": "?",
"surname": "?",
"documentID": "?"
}

ParcelShopDelivery
Delivery to one of the DPD parcelShops. Identification number of DPD parcelShop is entered.

In case of ParcelShopDelivery additional service use:

recipient address type must be psd


product must be set to 17 (Parcelshop - consignor to shop)

SOAP

<ns1:parcelShopDelivery>
<ns1:parcelShopId>?<ns1:parcelshopId>
</ns1:parcelShopDelivery>

JSON

"parcelShopDelivery":
{
"parcelShopId": ?
}

CollectionRequest (CR)
Collection Request is an additional service, which means that the DPD will collect the shipment from you and will deliver it to you or third person,
e.g. producer. Place of collection or delivery can be any address in Slovakia. Collection request service can be used by customer, who has a
sender contract concluded with DPD Transport costs are covered by the customer.

(c)2013
Page-14-
Direct Parcel Distribution SK, s.r.o.

If you wish to use this service. please enter one of the following values:

Value JSON SOAP

true

TRUE

If you do not wish to use this service, do not enter this service but enter one of the following values:

Value JSON SOAP

false

FALSE

SOAP

<ns1:collectionRequest>?</ns1:collectionRequest>

JSON

"collectionRequest": ?

CityService (CS)
Additional service City Service is suitable for the delivery of urgent shipments, documents, samples or contracts that require the fastest
possible delivery to the recipient. City Service can be used only in selected cities

CityService enables the transport of parcels weighing up to 31.5 kg and with the combination of City Service with SWAP product, the customers of
DPD can have their urgent shipment sent back right away (for example - signed contracts).

In case of additional service City Service use:

product must be set to 10 (City service standard)

Element Data type Description

generateLabels boolean If it is set to TRUE, the response


will include reference with
labels

subProduct integer Service type identification number


City service:

0 - city-service-standard [default]

(c)2013 Page-15-
Direct Parcel Distribution SK, s.r.o.

SOAP

<ns1:cityService>
<ns1:generateLabels>?</ns1:generateLabels>
<ns1:subProduct>?</ns1:subProduct>
</ns1:cityService>

JSON
"cityService":
{
"generateLabels": ?,
"subProduct": ?
}

Shipment type
Standard shipment
City Service shipment (includes additional service City Service)
Collection Request shipment (includes additional service Collection Request)

Standard shipment
Sample request:

SOAP

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns2="http://www.dpdportal.sk/XMLSchema/DPDSecurity/v2"
xmlns:ns1="http://www.dpdportal.sk/XMLSchema/SHIPMENT/v1">
<soapenv:Header>
<ns2:DPDSecurity>
<ns2:SecurityToken>
<ns2:ClientKey>?</ns2:ClientKey>
<ns2:Email>?</ns2:Email>
</ns2:SecurityToken>
</ns2:DPDSecurity>
</soapenv:Header>
<soapenv:Body>
<ns1:CreateRequest>
<!--1 or more repetitions:-->
<ns1:shipment>
<ns1:reference>?</ns1:reference>
<ns1:delisId>?</ns1:delisId>
<ns1:note>?</ns1:note>
<ns1:product>?</ns1:product>
<ns1:pickup>
<ns1:date>?</ns1:date>
<ns1:timeWindow>
<ns1:beginning>?</ns1:beginning>
<ns1:end>?</ns1:end>

(c)2013 Page-16-
Direct Parcel Distribution SK, s.r.o.

<ns1:end>?</ns1:end>
</ns1:timeWindow>
<ns1:note>?</ns1:note>
</ns1:pickup>
<ns1:addressSender>
<ns1:id>?</ns1:id>
</ns1:addressSender>
<ns1:addressRecipient>
<ns1:type>?</ns1:type>
<ns1:name>?</ns1:name>
<ns1:nameDetail>?</ns1:nameDetail>
<ns1:street>?</ns1:street>
<ns1:streetDetail>?</ns1:streetDetail>
<ns1:houseNumber>?</ns1:houseNumber>
<ns1:zip>?</ns1:zip>
<ns1:country>?</ns1:country>
<ns1:city>?</ns1:city>
<ns1:phone>?</ns1:phone>
<ns1:email>?</ns1:email>
<ns1:reference>?</ns1:reference>
<ns1:note>?</ns1:note>
<ns1:ico>?</ns1:ico>
<ns1:vatId>?</ns1:vatId>
<ns1:vatId2>?</ns1:vatId2>
</ns1:addressRecipient>
<ns1:parcels>
<!--1 or more repetitions:-->
<ns1:parcel>
<ns1:reference1>?</ns1:reference1>
<ns1:reference2>?</ns1:reference2>
<ns1:reference3>?</ns1:reference3>
<ns1:weight>?</ns1:weight>
<ns1:height>?</ns1:height>
<ns1:width>?</ns1:width>
<ns1:depth>?</ns1:depth>
</ns1:parcel>
</ns1:parcels>
<ns1:services>
<ns1:cod>
<ns1:amount>?</ns1:amount>
<ns1:currency>?</ns1:currency>
<ns1:bankAccount>
<ns1:id>?</ns1:id>
<ns1:name>?</ns1:name>
<ns1:prefix>?</ns1:prefix>
<ns1:number>?</ns1:number>
<ns1:bankCode>?</ns1:bankCode>
<ns1:iban>?</ns1:iban>
<ns1:swift>?</ns1:swift>
</ns1:bankAccount>
<ns1:variableSymbol>?</ns1:variableSymbol>
<ns1:paymentMethod>?</ns1:paymentMethod>
</ns1:cod>
<ns1:swap>
<ns1:type>?</ns1:type>
<ns1:address>
<ns1:type>?</ns1:type>
<ns1:name>?</ns1:name>
<ns1:nameDetail>?</ns1:nameDetail>
<ns1:street>?</ns1:street>

(c)2013 Page-17-
Direct Parcel Distribution SK, s.r.o.

<ns1:street>?</ns1:street>
<ns1:streetDetail>?</ns1:streetDetail>
<ns1:houseNumber>?</ns1:houseNumber>
<ns1:zip>?</ns1:zip>
<ns1:country>?</ns1:country>
<ns1:city>?</ns1:city>
<ns1:phone>?</ns1:phone>
<ns1:email>?</ns1:email>
<ns1:reference>?</ns1:reference>
<ns1:note>?</ns1:note>
<ns1:ico>?</ns1:ico>
<ns1:vatId>?</ns1:vatId>
<ns1:vatId2>?</ns1:vatId2>
</ns1:address>
<ns1:note>?</ns1:note>
<ns1:count>?</ns1:count>
</ns1:swap>
<ns1:saturdayDelivery>?</ns1:saturdayDelivery>
<ns1:notifications>
<!--1 to 5 repetitions:-->
<ns1:notification>
<ns1:destination>?</ns1:destination>
<ns1:type>?</ns1:type>
<ns1:rule>?</ns1:rule>
<ns1:language>?</ns1:language>
</ns1:notification>
</ns1:notifications>
<ns1:idCheck>
<ns1:name>?</ns1:name>
<ns1:surname>?</ns1:surname>
<ns1:documentID>?</ns1:documentID>
</ns1:idCheck>
<ns1:parcelShopDelivery>
<ns1:parcelShopId>?<ns1:parcelShopId>
</ns1:parcelShopDelivery>
<ns1:instruction>?</ns1:instruction>
</ns1:services>
</ns1:shipment>

</ns1:CreateRequest>

(c)2013 Page-18-
Direct Parcel Distribution SK, s.r.o.

</ns1:CreateRequest>
</soapenv:Body>
</soapenv:Envelope>

JSON

{
"jsonrpc":"2.0",
"method":"create",
"params":
{
"DPDSecurity":
{
"SecurityToken":
{
"ClientKey": "?",
"Email": "?"
}
},
"shipment":
[
{
"reference": ?,
"delisId": "?",
"note": "?",
"product": ?,
"pickup":
{
"date": "?",
"timeWindow":
{
"beginning": "?",
"end": "?"
},
"note": "?"
},
"addressSender":
{
"id": ?
},
"addressRecipient":
{
"type": "?",
"name": "?",
"nameDetail": "?",
"street": "?",
"streetDetail": "?",
"houseNumber": "?",
"zip": "?",
"country": ?,
"city": "?",
"phone": "?",
"email": "?",
"reference": "?",
"note": "?",
"ico": "?",

(c)2013 Page-19-
Direct Parcel Distribution SK, s.r.o.

"ico": "?",
"vatId": "?",
"vatId2": "?"
},
"parcels":
{
"parcel":
[
{
"reference1": "?",
"reference2": "?",
"reference3": "?",
"weight": "?",
"height": ?,
"width": ?,
"depth": ?
},

]
},
"services":
{
"cod":
{
"amount": "?",
"currency": "?",
"bankAccount":
{
"id": ?,
"name: "?",
"prefix: "?",
"number: "?",
"bankCode: "?",
"iban: "?",
"swift": "?"
},
"variableSymbol":"?",
"paymentMethod": ?
},
"swap":
{
"type": "?",
"address":
{
"type": "?",
"name": "?",
"nameDetail": "?",
"street": "?",
"streetDetail": "?",
"houseNumber": "?",
"zip": "?",
"country": ?,
"city": "?",
"phone": "?",
"email": "?",
"reference": "?",
"note": "?",
"ico": "?",
"vatId": "?",
"vatId2": "?"

(c)2013 Page-20-
Direct Parcel Distribution SK, s.r.o.

"vatId2": "?"
},
"note": "?",
"count": ?
},
"saturdayDelivery": ?,
"notifications":
{
"notification":
[
{
"destination": "?",
"type": ?,
"rule": ?,
"language": "?"
},

]
},
"instruction": "?",
"idCheck":
{
"name": "?",
"surname": "?",
"documentID": "?"
},
"parcelShopDelivery":
{
"parcelShopId": ?
}
}
},

},

(c)2013 Page-21-
Direct Parcel Distribution SK, s.r.o.

},
"id":"null"
}

City Service shipment


Following parts are different for CS shipment:

addressSender
addressRecipient
pickup
additionalServices

Their structure is shown in sample request:

SOAP

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns2="http://www.dpdportal.sk/XMLSchema/DPDSecurity/v2"
xmlns:ns1="http://www.dpdportal.sk/XMLSchema/SHIPMENT/v1">
<soapenv:Header>
<ns2:DPDSecurity>
<ns2:SecurityToken>
<ns2:ClientKey>?</ns2:ClientKey>
<ns2:Email>?</ns2:Email>
</ns2:SecurityToken>
</ns2:DPDSecurity>
</soapenv:Header>
<soapenv:Body>
<ns1:CreateRequest>
<!--1 or more repetitions:-->
<ns1:shipment>
<ns1:reference>?</ns1:reference>
<ns1:delisId>?</ns1:delisId>
<ns1:note>?</ns1:note>
<ns1:product>?</ns1:product>
<ns1:pickup>
<ns1:date>?</ns1:date>
</ns1:pickup>
<ns1:addressSender>
<ns1:type>?</ns1:type>
<ns1:name>?</ns1:name>
<ns1:nameDetail>?</ns1:nameDetail>
<ns1:street>?</ns1:street>
<ns1:streetDetail>?</ns1:streetDetail>
<ns1:houseNumber>?</ns1:houseNumber>
<ns1:zip>?</ns1:zip>
<ns1:country>?</ns1:country>
<ns1:city>?</ns1:city>
<ns1:phone>?</ns1:phone>
<ns1:email>?</ns1:email>
<ns1:reference>?</ns1:reference>
<ns1:note>?</ns1:note>
<ns1:ico>?</ns1:ico>
<ns1:vatId>?</ns1:vatId>
<ns1:vatId2>?</ns1:vatId2>

(c)2013 Page-22-
Direct Parcel Distribution SK, s.r.o.

<ns1:vatId2>?</ns1:vatId2>
</ns1:addressSender>
<ns1:addressRecipient>
<ns1:type>?</ns1:type>
<ns1:name>?</ns1:name>
<ns1:nameDetail>?</ns1:nameDetail>
<ns1:street>?</ns1:street>
<ns1:streetDetail>?</ns1:streetDetail>
<ns1:houseNumber>?</ns1:houseNumber>
<ns1:zip>?</ns1:zip>
<ns1:country>?</ns1:country>
<ns1:city>?</ns1:city>
<ns1:phone>?</ns1:phone>
<ns1:email>?</ns1:email>
<ns1:reference>?</ns1:reference>
<ns1:note>?</ns1:note>
<ns1:ico>?</ns1:ico>
<ns1:vatId>?</ns1:vatId>
<ns1:vatId2>?</ns1:vatId2>
</ns1:addressRecipient>
<ns1:parcels>
<!--1 or more repetitions:-->
<ns1:parcel>
<ns1:weight>?</ns1:weight>
<ns1:height>?</ns1:height>
<ns1:width>?</ns1:width>
<ns1:depth>?</ns1:depth>
</ns1:parcel>
</ns1:parcels>
<ns1:services>
<ns1:cityService>
<ns1:generateLabels>?</ns1:generateLabels>
<ns1:subProduct>?</ns1:subProduct>
</ns1:cityService>
<ns1:cod>
<ns1:amount>?</ns1:amount>
<ns1:currency>?</ns1:currency>
<ns1:bankAccount>
<ns1:id>?</ns1:id>
<ns1:name>?</ns1:name>
<ns1:prefix>?</ns1:prefix>
<ns1:number>?</ns1:number>
<ns1:bankCode>?</ns1:bankCode>
<ns1:iban>?</ns1:iban>
<ns1:swift>?</ns1:swift>
</ns1:bankAccount>
<ns1:variableSymbol>?</ns1:variableSymbol>
<ns1:paymentMethod>?</ns1:paymentMethod>
</ns1:cod>
<ns1:swap>
<ns1:type>?</ns1:type>
<ns1:address>
<ns1:type>?</ns1:type>
<ns1:name>?</ns1:name>
<ns1:nameDetail>?</ns1:nameDetail>
<ns1:street>?</ns1:street>
<ns1:streetDetail>?</ns1:streetDetail>
<ns1:houseNumber>?</ns1:houseNumber>
<ns1:zip>?</ns1:zip>
<ns1:country>?</ns1:country>

(c)2013 Page-23-
Direct Parcel Distribution SK, s.r.o.

<ns1:country>?</ns1:country>
<ns1:city>?</ns1:city>
<ns1:phone>?</ns1:phone>
<ns1:email>?</ns1:email>
<ns1:reference>?</ns1:reference>
<ns1:note>?</ns1:note>
<ns1:ico>?</ns1:ico>
<ns1:vatId>?</ns1:vatId>
<ns1:vatId2>?</ns1:vatId2>
</ns1:address>
<ns1:note>?</ns1:note>
<ns1:count>?</ns1:count>
</ns1:swap>
</ns1:services>
</ns1:shipment>

</ns1:CreateRequest>

(c)2013 Page-24-
Direct Parcel Distribution SK, s.r.o.

</ns1:CreateRequest>
</soapenv:Body>
</soapenv:Envelope>

JSON

{
"jsonrpc":"2.0",
"method":"create",
"params":
{
"DPDSecurity":
{
"SecurityToken":
{
"ClientKey": "?",
"Email": "?"
}
},
"shipment":
[
{
"reference": ?,
"delisId": "?",
"note": "?",
"product": ?,
"pickup":
{
"date": "?"
},
"addressSender":
{
"type": "?",
"name": "?",
"nameDetail": "?",
"street": "?",
"streetDetail": "?",
"houseNumber": "?",
"zip": "?",
"country": ?,
"city": "?",
"phone": "?",
"email": "?",
"reference": "?",
"note": "?",
"ico": "?",
"vatId": "?",
"vatId2": "?"
},
"addressRecipient":
{
"type": "?",
"name": "?",
"nameDetail": "?",
"street": "?",
"streetDetail": "?",

(c)2013 Page-25-
Direct Parcel Distribution SK, s.r.o.

"streetDetail": "?",
"houseNumber": "?",
"zip": "?",
"country": ?,
"city": "?",
"phone": "?",
"email": "?",
"reference": "?",
"note": "?",
"ico": "?",
"vatId": "?",
"vatId2": "?"
},
"parcels":
{
"parcel":
[
{
"weight": "?",
"height": ?,
"width": ?,
"depth": ?
},

]
},
"services":
{
"cityService":
{
"generateLabels": ?,
"subProduct": ?
},
"cod":
{
"amount": "?",
"currency": "?",
"bankAccount":
{
"id": ?,
"name: "?",
"prefix: "?",
"number: "?",
"bankCode: "?",
"iban: "?",
"swift": "?"
},
"variableSymbol":"?",
"paymentMethod": ?
},
"swap":
{
"type": "?",
"address":
{
"type": "?",
"name": "?",
"nameDetail": "?",
"street": "?",
"streetDetail": "?",

(c)2013 Page-26-
Direct Parcel Distribution SK, s.r.o.

"streetDetail": "?",
"houseNumber": "?",
"zip": "?",
"country": ?,
"city": "?",
"phone": "?",
"email": "?",
"reference": "?",
"note": "?",
"ico": "?",
"vatId": "?",
"vatId2": "?"
},
"note": "?",
"count": ?
}
}
},

},

(c)2013 Page-27-
Direct Parcel Distribution SK, s.r.o.

},
"id":"null"
}

Collection Request shipment


Following parts are different for CR shipment:

addressSender
addressRecipient
pickup
additionalServices

Their structure is shown in sample request:

SOAP

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns2="http://www.dpdportal.sk/XMLSchema/DPDSecurity/v2"
xmlns:ns1="http://www.dpdportal.sk/XMLSchema/SHIPMENT/v1">
<soapenv:Header>
<ns2:DPDSecurity>
<ns2:SecurityToken>
<ns2:ClientKey>?</ns2:ClientKey>
<ns2:Email>?</ns2:Email>
</ns2:SecurityToken>
</ns2:DPDSecurity>
</soapenv:Header>
<soapenv:Body>
<ns1:CreateRequest>
<!--1 or more repetitions:-->
<ns1:shipment>
<ns1:reference>?</ns1:reference>
<ns1:delisId>?</ns1:delisId>
<ns1:note>?</ns1:note>
<ns1:product>?</ns1:product>
<ns1:pickup>
<ns1:date>?</ns1:date>
</ns1:pickup>
<ns1:addressSender>
<ns1:type>?</ns1:type>
<ns1:name>?</ns1:name>
<ns1:nameDetail>?</ns1:nameDetail>
<ns1:street>?</ns1:street>
<ns1:streetDetail>?</ns1:streetDetail>
<ns1:houseNumber>?</ns1:houseNumber>
<ns1:zip>?</ns1:zip>
<ns1:country>?</ns1:country>
<ns1:city>?</ns1:city>
<ns1:phone>?</ns1:phone>
<ns1:email>?</ns1:email>
<ns1:reference>?</ns1:reference>
<ns1:note>?</ns1:note>
<ns1:ico>?</ns1:ico>
<ns1:vatId>?</ns1:vatId>
<ns1:vatId2>?</ns1:vatId2>
</ns1:addressSender>

(c)2013 Page-28-
Direct Parcel Distribution SK, s.r.o.

</ns1:addressSender>
<ns1:addressRecipient>
<ns1:type>?</ns1:type>
<ns1:name>?</ns1:name>
<ns1:nameDetail>?</ns1:nameDetail>
<ns1:street>?</ns1:street>
<ns1:streetDetail>?</ns1:streetDetail>
<ns1:houseNumber>?</ns1:houseNumber>
<ns1:zip>?</ns1:zip>
<ns1:country>?</ns1:country>
<ns1:city>?</ns1:city>
<ns1:phone>?</ns1:phone>
<ns1:email>?</ns1:email>
<ns1:reference>?</ns1:reference>
<ns1:note>?</ns1:note>
<ns1:ico>?</ns1:ico>
<ns1:vatId>?</ns1:vatId>
<ns1:vatId2>?</ns1:vatId2>
</ns1:addressRecipient>
<ns1:parcels>
<!--1 or more repetitions:-->
<ns1:parcel>
<ns1:weight>?</ns1:weight>
<ns1:height>?</ns1:height>
<ns1:width>?</ns1:width>
<ns1:depth>?</ns1:depth>
</ns1:parcel>
</ns1:parcels>
<ns1:services>
<ns1:collectionRequest>?</ns1:collectionRequest>
</ns1:services>
</ns1:shipment>

</ns1:CreateRequest>

(c)2013 Page-29-
Direct Parcel Distribution SK, s.r.o.

</ns1:CreateRequest>
</soapenv:Body>
</soapenv:Envelope>

JSON

{
"jsonrpc":"2.0",
"method":"create",
"params":
{
"DPDSecurity":
{
"SecurityToken":
{
"ClientKey": "?",
"Email": "?"
}
},
"shipment":
[
{
"reference": ?,
"delisId": "?",
"note": "?",
"product": ?,
"pickup":
{
"date": "?"
},
"addressSender":
{
"type": "?",
"name": "?",
"nameDetail": "?",
"street": "?",
"streetDetail": "?",
"houseNumber": "?",
"zip": "?",
"country": ?,
"city": "?",
"phone": "?",
"email": "?",
"reference": "?",
"note": "?",
"ico": "?",
"vatId": "?",
"vatId2": "?"
},
"addressRecipient":
{
"type": "?",
"name": "?",
"nameDetail": "?",
"street": "?",
"streetDetail": "?",

(c)2013 Page-30-
Direct Parcel Distribution SK, s.r.o.

"streetDetail": "?",
"houseNumber": "?",
"zip": "?",
"country": ?,
"city": "?",
"phone": "?",
"email": "?",
"reference": "?",
"note": "?",
"ico": "?",
"vatId": "?",
"vatId2": "?"
},
"parcels":
{
"parcel":
[
{
"weight": "?",
"height": ?,
"width": ?,
"depth": ?
},

]
},
"services":
{
"collectionRequest": ?
}
},

},

(c)2013 Page-31-
Direct Parcel Distribution SK, s.r.o.

},
"id":"null"
}

Response
If the validation is successful ,success is set to TRUE.

If invalid data is sent, success is set to FALSE and validation reports are sent to the messages part.

Element Data type Description

reference varchar(35) Shipment identification from request

ackCode varchar(35) Acknowledgment code, which describes the


state of shipment placement

Value Description

success Shipment placed


without problems

successWithWarni Shipment placed


ng with warning

failure Shipment not


placed

validation Shipment data


incorrect/ invalid

success boolean TRUE - Shipment placed

FALSE - Shipment not placed (reason


shown in ackCode messages)

messages array List of messages/ information from server

mpsid varchar(22) DPD shipment identification (MPS ID)

label text Reference for shipment label generation

(c)2013 Page-32-
Direct Parcel Distribution SK, s.r.o.

SOAP

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.dpdportal.sk/XMLSchema/SHIPMENT/v1">
<SOAP-ENV:Body>
<ns1:CreateResponse>
<!--1 or more repetitions:-->
<ns1:result>
<ns1:reference>?</ns1:reference>
<ns1:ackCode>?</ns1:ackCode>
<ns1:success>true</ns1:success>
<ns1:messages>
<!--1 or more repetitions:-->
<ns1:message>?</ns1:message>
</ns1:messages>
<ns1:mpsid>?</ns1:mpsid>
<ns1:label>?</ns1:label>
</ns1:result>
</ns1:CreateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

JSON

{
"jsonrpc":"2.0",
"id":"null",
"result":
{
"result":
[
{
"reference": "?",
"ackCode": "?"
"success": ?,
"messages":
[
"?",

],
"mpsid": "?",
"label": "?"
},

]
}
}
Message element structure

Element Data type Description

envelope varchar(max) Serves as identification of data envelope.

Includes route to given envelope.

Examples of use:

• addressRecipient

• cod>bankAccount

• swap>Address

Enevelope separator is >.

element varchar(max) Name of element that is faulty.

value varchar(max) Validation report

For more complex validation rules, where the validation rule involves more elements (e.g. validation of combinations of product and type the recipient's

address), the validation report (message element) does not have to include the envelope and / or element.

Error output

(c)2013 Page-33-
Direct Parcel Distribution SK, s.r.o.

SOAP

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>[error code]</faultcode>
<faultstring>[error message]</faultstring>
<faultactor/>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

JSON

{
"jsonrpc": "2.0",
"id": null,
"error":
{
"code": [error code],
"message": "[error message]",
"data":null
}
}

Error codes

Error code Description of error

301 Failed authentication

401 Request sent without data

500 Internal server error

519 Parcel time series is not available

(c)2013 Page-34-

You might also like