API documentation Deliveries
Contents
Get delivery information
Provides all available information about a parcel's most recent delivery, such as the tracking code, the state, and a URL to download the label. Note that labels are generated asynchronously and may take up to one minute to be available. Generally, labels are generated between 1 and 5 seconds after the delivery is created.
We recommend implementing a retry strategy with exponential backoff in case the label is not available yet. For example, if the label is not available yet, retry after 1 second, then 2 seconds, then 4 seconds, etc. until the label is available.
Endpoint
[GET] /v4/parcels/{client_ref}/delivery
Attributes
Key | Description | Datatype | Constraints |
courier | Name of courier | String | |
first_ehub_scan_at | Timestamp of delivery's first scan at our eHub | Timestamp | |
delivered_at | Timestamp of parcel's delivery at the consignee | String | |
label_url | URL where the PDF version of the label can be downloaded | String | |
rejection_reason | Reason for courier rejecting delivery data | String | |
state | State of delivery | String |
Can be
|
tracking_code | Parcel tracking code, as assigned by the courier | String | |
label_text | The label text is a simplified indicator of the destination of the parcels used internally by ViaEurope | String |
Example
Response
{ "courier": "UPS", "delivered_at": null, "first_ehub_scan_at": "2018-11-04T15:47:37.000+01:00", "label_download_url": "https://…", "rejection_reason": null, "state": "at_courier", "tracking_code": "1Z30RF786800000000", "label_text": null, "shipment_reference": "VIALH-828A9FE2" }
Create new delivery
Creates a new delivery in the ViaEurope system. This endpoint has no response, other than a HTTP status code to indicate success or failure, along with possible errors.
Endpoint
[POST] /v4/parcels/{client-ref}/delivery
Attributes
Key | Description | Datatype | Constraints | Errors |
service | Courier & service to use | String |
Must be a valid service for the given address shortcode and parcel type. Valid address shortcodes
per parcel type and service are available via
our app
and
Address Shortcode API, e.g.
DPD_NL
(for regular parcels only)
or
COLLISSIMO
(for flat parcels only)
|
|
additional_label_text | Additional reference to print on label | String | Optional. Maximum 30 characters, must only contain characters A-Z, 0-9, minus and underscore |
|
weight | Weight of parcel | Integer |
Must be greater than 0. Must be in grams, e.g.
21500
for 21.5 kg.
Please note that different couriers and services impose different weight limits on parcels.
Exceeding these limits may cause surcharges to be levied by the courier, and by ViaEurope.
|
|
dimensions | Dimensions of parcel | Array of integers |
Must be in centimeters. Must have three sides, e.g.
[21, 15, 10]
Please note that different couriers and services impose different dimension limits on parcels.
Exceeding these limits may cause surcharges to be levied by the courier, and by ViaEurope.
|
|
tracking_code | Tracking code | String |
Only for services
*
BEX
and
UPS_PREBOOKED.
For the
UPS_PREBOOKED
service, it has to be a unique value across the last 90 days.
* Only allowed clients can set tracking code on
BEX
|
|
address | Attributes for the delivery address | JSON |
|
|
shortcode | Name | String | Optional. An alternative to passing full address parameters. When submitting address data, it's possible to send only shortcode and name1, and the rest of the attributes (name2, street, city, zip, country) will be selected and assigned by matching the shortcode. |
|
name1 | Name | String | Maximum 35 characters. Must only contain latin or printable ASCII characters. Must not contain line breaks. |
|
name2 | Name (continued) | String | Optional. Maximum 35 characters. Must only contain latin or printable ASCII characters. Must not contain line breaks. |
|
street | Street | String | Maximum 70 characters. Must only contain latin or printable ASCII characters. Must not contain line breaks. Must not contain zip code. Must not contain city. |
|
city | City | String | 2-35 characters. Must only contain latin or printable ASCII characters. Must not contain line breaks. |
|
country | Country | String | 2 character ISO 3166-Alpha 2 country code. See Countries list for more information. |
|
zip | Zip | String | Zipcode associated with the address |
|
Email of recipient | String | Optional. Maximum 50 characters |
|
|
phone | Phone number | String | Optional. Maximum 15 characters. Must only contain characters 0-9, plus and minus. |
|
Example
Request
{ "additional_label_text": null, "address": { "name1": "Mr Appleseed", "name2": "The Fruit Company, Building A", "street": "Example Street 1", "city": "Example City", "zip": "12345", "country": "DE", "phone": "0044123456" }, "service": "DPD_BE_B2B", "weight": 10000, "dimensions": [ 12, 24, 36 ] }
Cancel delivery
Will cancel the parcel's most recent delivery. This cannot be undone! This endpoint has no response, other than a HTTP status code to indicate success or failure, along with possible errors.
Endpoint
[DELETE] /v4/parcels/{client_ref}/delivery