Introduction
⛔️ UPDATE: THIS VERSION OF API HAS BEEN DEPRECATED AND NO LONGER SUPPORTED. ⛔️
A new version has been released. You can read more about it here: Shipmondo API v3
This is the official API for pakkelabels.dk. The version is v2. Should we introduce any new changes in the API which will break the structure of any existing API calls, these new changes will be introduced in a new version. This ensures that any systems which integrates up against our system will not be affected.
We provide an official library for PHP
Authentication
All calls to the API must contain a token. To obtain such a token, you need to call the login method under the users ressource (see below).
To login, you need a api_user and api_key. These can be generated once you are logged under Settings -> API
Users
Login
<?php
$label = new Pakkelabels('api_user', 'api_key');
?>
curl --data "api_user=your_api_user&api_key=your_api_key" https://app.pakkelabels.dk/api/public/v2/users/login
The above command returns JSON structured like this:
{
"token":"fr79337HtCkRBGp3OysgWvqtJrX62cpqsdkX2H8m",
"expires_at":"2015-10-14T10:02:03.255+02:00"
}
Login and retch a token. The returned token is required for all subsequent calls to the API.
HTTP Request
POST https://app.pakkelabels.dk/api/public/v2/users/login
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
api_user | string | true | Your API user |
api_key | string | true | Your API key |
Balance
<?php
echo $label->balance();
?>
curl https://app.pakkelabels.dk/api/public/v1/users/balance?token=fr79337HtCkRBGp3OysgWvqtJrX62cpqsdkX2H8m
The above command returns JSON structured like this:
{
"balance":777.15
}
Fetch the current balance
HTTP Request
GET https://app.pakkelabels.dk/api/public/v2/users/balance
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | The token obtained when loggin in |
Payment Requests
<?php
print_r($label->payment_requests());
?>
curl https://app.pakkelabels.dk/api/public/v1/users/payment_requests?token=fr79337HtCkRBGp3OysgWvqtJrX62cpqsdkX2H8m
The above command returns JSON structured like this:
[
{
"id":10,
"reference": "Efterkrav for pakkelabel 29000",
"amount": 42.0
},
{
"id":11,
"reference":"Efterkrav for pakkelabel 29001",
"amount":10.0
}
]
Fetch any open payment requests
HTTP Request
GET https://app.pakkelabels.dk/api/public/v2/users/payment_requests
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | The token obtained when loggin in |
Shipments
Create shipment
<?php
$data = array(
'shipping_agent' => 'pdk',
'weight' => '1000',
'receiver_name' => 'John Doe',
'receiver_address1' => 'Some Street 42',
'receiver_zipcode' => '5230',
'receiver_city' => 'Odense M',
'receiver_country' => 'DK',
'receiver_email' => 'test@test.dk',
'receiver_mobile' => '12345678',
'sender_name' => 'John Wayne',
'sender_address1' => 'The Batcave 1',
'sender_zipcode' => '5000',
'sender_city' => 'Odense C',
'sender_country' => 'DK',
'shipping_product_id' => '51',
'services' => '11,12',
'test' => 'true'
);
$shipment = $label->create_shipment($data);
print_r($shipment);
?>
curl --data "token=BpLqF4fQtp4NLwp10dI-YvdF5LGIBkFE3GYuhq4M&shipping_agent=pdk\
&weight=1000&receiver_name=John Doe&receiver_address1=Some Street 42\
&receiver_zipcode=5230&receiver_city=Odense M&receiver_country=DK\
&receiver_email=test@test.dk&receiver_mobile=12345678\
&sender_name=John Wayne&sender_address1=The Batcave 1&sender_zipcode=5000\
&sender_city=Odense C&sender_country=DK&shipping_product_id=51\
&services=11,12&test=true" https://app.pakkelabels.dk/api/public/v2/shipments/shipment
The above command returns JSON structured like this:
{
"shipment_id": 42,
"order_id": 101,
"pkg_no": "00370720682192068269",
"base64": "..."
}
For some shipping agents, there can be an additional element called additional_data, which includes hipping agent specific data like below:
{
"shipment_id": 42,
"order_id": 101,
"pkg_no": "JD014600003459067113",
"base64": "...",
"additiondal_data": {
"airway_bill_number": "4458467871"
}
}
Create a shipment. The price of the shipment is automatically substracted from your balance. If the balance of the user is not enough, an error will be raised. Once the shipment has been created, the base64 encoding of the label is returned in base64. When testing, set the paramter test to true. You can then create labels even if your balance is zero. When using test mode (test=true), it is only possible to test with either shipping_agent pdk or gls and receiver_country DK. The returned values are dummy and to illustrate the proof of concept.
HTTP Request
POST https://app.pakkelabels.dk/api/public/v2/shipments/shipment
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
receiver_name | string | true | Receiver name |
receiver_attention | string | false | Receiver attention. This field is required when creating shipment to a business address. |
receiver_address1 | string | true | Receiver address 1 |
receiver_address2 | string | false | Receiver address 2 |
receiver_zipcode | string | true | Receiver zipcode |
receiver_city | string | true | Receiver city |
receiver_country | string | true | Receiver country (e.g. DK) |
receiver_email | string | false | Receiver email |
receiver_mobile | string | false | Receiver mobile |
auto_select_droppoint | string | false | Specify if you want the nearest droppoint (currently only supports GLS “PakkeShop”) to be seleced automatically based on the receivers address. If this is true, receiver_address2 should not be filled, and receiver_address1 should contain the address of the receiver. |
sender_name | string | true | Sender name |
sender_address1 | string | true | Sender address 1 |
sender_address2 | string | false | Sender address 2 |
sender_zipcode | string | true | Sender zipcode |
sender_city | string | true | Sender city |
sender_country | string | true | Sender country |
sender_email | string | false | Sender email |
custom_delivery | boolean | false | Specify if you want delivery to a custom droppoint. This only applies for Post Danmark and DAO shipments without delivery. If this is set to true, all fields starting with delivery_ must be set, as well as service_point_id. To find valid droppoints, use the API call pickup_points. Defaults to false |
delivery_name | string | false | The name of the delivery point. Note that this is NOT the name of the person which will pick of the parcel. Use the field company_name from the API call pickup_points. |
delivery_address1 | string | false | The address of the delivery point. |
delivery_zipcode | string | false | The zipcode of the delivery point. |
delivery_city | string | false | The city of the delivery point. |
delivery_country | string | false | country of the delivery point. |
service_point_id | string | false | The ID of the service point. Use the field number from the API call pickup_points. Note, this should only be used for Bring, DAO, GLS and Post Danmark shipments when delivering through a service point. For GLS shipments, if service_point_id is specified, the information of the service point will be filled out in fields for receiver according to GLS requirements. |
shipping_agent | string | true | Shipping agent. Currently supporting pdk, gls, dao and bring. |
shipping_product_id | integer | true | The ID of shipping product to use. You can see which products are available to your user from the API call freight_rates |
services | string | false | A comma separated list of services to add to the product. You can see which services are available to your user from the API call freight_rates |
weight | integer | true | Specify the weight of the shipment. You can get a list of supported weights from the API call freight_rates. |
order_id | string | false | Allows you to specify a custom order id to a shipment. This id has no functional impact, but is only for your own convenience |
receipt | string | false | Specifies if you want a receipt send to your mail. Defaults to false |
label_format | string | false | Specify the format of the label (a5, 10x19 or zpl). Defaults to a5 |
reference | string | false | Specify a custom text to be printed on the label. This can be used to display the order number or other useful information |
add_to_print_queue | string | false | If set to true, the newly created shipment is added to the printqueue |
delivery_instruction | string | false | Specify the delivery instruction that is transffered to shipping agent and visible label. Currently only available for PostNord / Post Danmark. Service ID 33 - Flexdelivery also needs to be used. |
test | boolean | false | If this is true, a test label will be generated. No money will be charges from your account. Defaults to false |
Create shipment own customer number
<?php
$data = array(
'shipping_agent' => 'pdk',
'weight' => '1000',
'receiver_name' => 'John Doe',
'receiver_address1' => 'Some Street 42',
'receiver_zipcode' => '5230',
'receiver_city' => 'Odense M',
'receiver_country' => 'DK',
'receiver_email' => 'test@test.dk',
'receiver_mobile' => '12345678',
'sender_name' => 'John Wayne',
'sender_address1' => 'The Batcave 1',
'sender_zipcode' => '5000',
'sender_city' => 'Odense C',
'sender_country' => 'DK',
'shipping_product_id' => '51',
'services' => '11,12',
'test' => 'true'
);
$shipment = $label->create_shipment_own_customer_number($data);
print_r($shipment);
?>
curl --data "token=BpLqF4fQtp4NLwp10dI-YvdF5LGIBkFE3GYuhq4M&shipping_agent=pdk\
&weight=1000&receiver_name=John Doe&receiver_address1=Some Street 42\
&receiver_zipcode=5230&receiver_city=Odense M&receiver_country=DK\
&receiver_email=test@test.dk&receiver_mobile=12345678\
&sender_name=John Wayne&sender_address1=The Batcave 1&sender_zipcode=5000\
&sender_city=Odense C&sender_country=DK&shipping_product_id=517\
&services=191,192&test=true" https://app.pakkelabels.dk/api/public/v2/shipments/shipment_own_customer_number
The above command returns JSON structured like this:
{
"shipment_id": 42,
"order_id": 101,
"pkg_no": "00370720682192068269",
"base64": "..."
}
For some shipping agents, there can be an additional element called additional_data, which includes hipping agent specific data like below:
{
"shipment_id": 42,
"order_id": 101,
"pkg_no": "JD014600003459067113",
"base64": "...",
"additiondal_data": {
"airway_bill_number": "4458467871"
}
}
Example for the extra element
{
"extra": {
"dfm":{
"delivery_instruction":"The delivery instruction",
"dot_type":"0",
"insurance_amount":"10000",
"insurance_type":"ZFA",
"pallets1":"0",
"pallets2":"0",
"pallets4":"1",
"pickup_date":"2017-01-13",
"pickup_instruction":"The pickup instruction",
"goods":[
{
"amount":"1",
"content":"Test Content",
"length":"30",
"width":"20",
"height":"10",
"weight":"10",
"volume":"0.006",
"running_meter":"",
"packing":"PL4"
}
]
}
}
}
"delivery_instruction": Optional
"dot_type": DOT type for Danske Fragtmænd, send 0 as default. Other values D01, D02, D03 or D04
"insurance_amount": Insurance Amount in DKK, optional
"insurance_type": Insurance Type, optional
"pallets1": Pallet Exchange, quantity of whole pallet
"pallets2": Pallet Exchange, quantity of half pallet
"pallets4": Pallet Exchange, quantity of quart pallet
"pickup_date": Mandatory
"pickup_instruction": "The pickup instruction",
"goods": Can contain more lines, not all fields in goods line are mandatory.
"amount": Quantity of collis with same dimensions described in this line
"content": Description of contents
"length": In CM
"width": In CM
"height": In CM
"weight": In KG
"volume": In cubic meter
"running_meter": Running Meter
"packing": Packing type
Create a shipment using your own customer number/contract from the shipping agent. In this way, you will pay directly to the corresponding shipping agent. The customer number will automatically be fetched from your account. Once the shipment has been created, the base64 encoding of the label is returned in base64. When testing, set the paramter test to true. You can then create labels even if your balance is zero. When using test mode (test=true), it is only possible to test with either shipping_agent pdk or gls and receiver_country DK. The returned values are dummy and to illustrate the proof of concept.
HTTP Request
POST https://app.pakkelabels.dk/api/public/v2/shipments/shipment_own_customer_number
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
receiver_name | string | true | Receiver name |
receiver_attention | string | false | Receiver attention. This field is required when creating shipment to a business address. |
receiver_address1 | string | true | Receiver address 1 |
receiver_address2 | string | false | Receiver address 2 |
receiver_zipcode | string | true | Receiver zipcode |
receiver_city | string | true | Receiver city |
receiver_country | string | true | Receiver country (e.g. DK) |
receiver_email | string | false | Receiver email |
receiver_mobile | string | false | Receiver mobile |
auto_select_droppoint | string | false | Specify if you want the nearest droppoint (currently only supports GLS “PakkeShop”) to be seleced automatically based on the receivers address. If this is true, receiver_address2 should not be filled, and receiver_address1 should contain the address of the receiver. |
sender_name | string | true | Sender name |
sender_address1 | string | true | Sender address 1 |
sender_address2 | string | false | Sender address 2 |
sender_zipcode | string | true | Sender zipcode |
sender_city | string | true | Sender city |
sender_country | string | true | Sender country |
sender_email | string | false | Sender email |
custom_delivery | boolean | false | Specify if you want delivery to a custom droppoint. This only applies for Post Danmark and DAO shipments without delivery. If this is set to true, all fields starting with delivery_ must be set, as well as service_point_id. To find valid droppoints, use the API call pickup_points. Defaults to false |
delivery_name | string | false | The name of the delivery point. Note that this is NOT the name of the person which will pick of the parcel. Use the field company_name from the API call pickup_points. |
delivery_address1 | string | false | The address of the delivery point. |
delivery_zipcode | string | false | The zipcode of the delivery point. |
delivery_city | string | false | The city of the delivery point. |
delivery_country | string | false | country of the delivery point. |
service_point_id | string | false | The ID of the service point. Use the field number from the API call pickup_points. Note, this should only be used for Post Danmark, GLS, DAO og Bring shipments when sending parcel through a serviec point. For GLS shipments, if service_point_id is specified, the information of the service point will be filled out in fields for receiver according to GLS requirements. |
shipping_agent | string | true | Shipping agent. Currently supporting pdk, gls, dao, bring, dhl_express and dfm. |
shipping_product_id | integer | true | The ID of shipping product to use. You can see which products are available to your user from the API call freight_rates |
services | string | false | A comma separated list of services to add to the product. You can see which services are available to your user from the API call freight_rates |
weight | integer | true | Specify the weight of the shipment. You can get a list of supported weights from the API call freight_rates. |
order_id | string | false | Allows you to specify a custom order id to a shipment. This id has no functional impact, but is only for your own convenience |
receipt | string | false | Specifies if you want a receipt send to your mail. Defaults to false |
label_format | string | false | Specify the format of the label (a5, 10x19 or zpl). Defaults to a5 |
reference | string | false | Specify a custom text to be printed on the label. This can be used to display the order number or other useful information |
add_to_print_queue | string | false | If set to true, the newly created shipment is added to the printqueue |
number_of_collis | string | false | Specifies the number of collis for this shipment. Defaults to 1 |
delivery_instruction | string | false | Specify the delivery instruction that is transffered to shipping agent and visible label. Currently only available for PostNord / Post Danmark. Service ID 33 - Flexdelivery also needs to be used. |
test | boolean | false | If this is true, a test label will be generated. No money will be charges from your account. Defaults to false |
extra | object | false | This parameter can be used in order to send additional data |
Create imported shipment
<?php
$data = array(
'shipping_agent' => 'pdk',
'receiver_name' => 'John Doe',
'receiver_address1' => 'Some Street 42',
'receiver_zipcode' => '5230',
'receiver_city' => 'Odense M',
'receiver_country' => 'DK',
'receiver_email' => 'test@test.dk',
'receiver_mobile' => '12345678',
'sender_name' => 'John Wayne',
'sender_address1' => 'The Batcave 1',
'sender_zipcode' => '5000',
'sender_city' => 'Odense C',
'sender_country' => 'DK',
'shipping_agent' => 'pdk',
'order_id' => '42',
'shipping_product_id' => 51,
'shipping_product_services' => '11,12'
);
$shipment = $label->create_imported_shipment($data);
print_r($shipment);
?>
curl --data "token=BpLqF4fQtp4NLwp10dI-YvdF5LGIBkFE3GYuhq4M&shipping_agent=pdk\
&weight=1000&receiver_name=John Doe&receiver_address1=Some Street 42\
&receiver_zipcode=5230&receiver_city=Odense M&receiver_country=DK\
&receiver_email=test@test.dk&receiver_mobile=12345678\
&sender_name=John Wayne&sender_address1=The Batcave 1&sender_zipcode=5000\
&sender_city=Odense C&sender_country=DK&shipping_agent=pdk&order_id=42&shipping_product_id=51&shipping_product_services=11,12" https://app.pakkelabels.dk/api/public/v2/shipments/imported_shipment
The above command returns JSON structured like this:
{
"id": 42
}
Create an imported shipment. Imported shipments is completely free to create. From the webinterface, they can be used as a template to buy a label. Below are listed some scenarios where imported shipments are useful:
- You (or your customer) wants to buy the labels through our webinterface, but uses a webplatform we don’t have an official integration for.
- You have special requirements which means that our officlal integrations aren’t feasible.
HTTP Request
POST https://app.pakkelabels.dk/api/public/v2/shipments/imported_shipment
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
receiver_name | string | true | Receiver name |
receiver_attention | string | false | Receiver attention. This field is required when creating shipment to a business address. |
receiver_address1 | string | true | Receiver address 1 |
receiver_address2 | string | false | Receiver address 2. |
receiver_zipcode | string | true | Receiver zipcode |
receiver_city | string | true | Receiver city |
receiver_country | string | true | Receiver country (e.g. DK) |
receiver_email | string | false | Receiver email |
receiver_mobile | string | false | Receiver mobile |
sender_name | string | true | Sender name |
sender_address1 | string | true | Sender address 1 |
sender_address2 | string | false | Sender address 2 |
sender_zipcode | string | true | Sender zipcode |
sender_city | string | true | Sender city |
sender_country | string | true | Sender country |
sender_email | string | false | Sender email |
shipping_agent | string | false | Shipping agent |
service_point_id | string | false | Allows you to specify a service point / pick-up point where the shipment is being delivered through. The value must match with the value coming from “number” field when using pickip_points call. |
order_id | string | false | Allows you to specify a custom order id to a shipment. This id has no functional impact, but is only for your own convenience |
shipping_product_id | integer | false | Shipping product ID. You can get the value from freight_rates call. |
shipping_product_services | string | false | IDs for shipping product services that you would like to use, e.g. “11,12”. You can get the values from freight_rates call. |
Add to print queue
<?php
$label->add_to_print_queue([42, 1337]);
?>
curl --data "token=McYR8DzKS1OfGd1q1avjCi0vv3kZL5f0itgF_QGW&ids=42,1337" https://app.pakkelabels.dk/api/public/v2/shipments/add_to_print_queue
The above command returns JSON structured like this:
{
"message": "2 labels added to the printqueue"
}
Add the labels to the print queue, such that they will be printed by the print client.
POST https://app.pakkelabels.dk/api/public/v2/shipments/add_to_print_queue
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
ids | string | true | Comma separated list of shipments IDs |
List shipments
<?php
$labels = $label->shipments(array('shipping_agent' => 'pdk', 'receiver_country' => 'DK'));
print_r($labels);
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/shipments?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&shipping_agent=pdk&receiver_country=DK
The above command returns JSON structured like below. For some shipping agents, there can be an additional element called additional_data, which includes hipping agent specific data.
{
"shipment_count": 25,
"total_pages": 2,
"shipments": [
{
"id": 42,
"receiver_name": "John Doe",
"receiver_attention": "",
"receiver_address1": "Test Street 1",
"receiver_address2": "",
"receiver_country": "DK",
"receiver_zipcode": "5000",
"receiver_email": "test@test.dk",
"receiver_telephone": null,
"sender_name": "Sender Doe",
"sender_attention": "",
"sender_address1": "Sender Street 1",
"sender_address2": "",
"sender_country": "DK",
"sender_zipcode": "5230",
"sender_email": null,
"sms_notification": null,
"email_notification": null,
"delivery": null,
"display_name": "1kg til 5kg",
"shipping_agent": "pdk",
"created_at": "2014-11-13T13:37:42.195+01:00",
"pkg_no": "00370720682192051391",
"order_id": "100"
},
{
"id": 43,
"receiver_name": "John Doe",
"receiver_attention": "",
"receiver_address1": "Test Street 2",
"receiver_address2": "",
"receiver_country": "DK",
"receiver_zipcode": "5000",
"receiver_email": "test@test.dk",
"receiver_telephone": null,
"sender_name": "Sender Doe",
"sender_attention": "",
"sender_address1": "Sender Street 2",
"sender_address2": "",
"sender_country": "DK",
"sender_zipcode": "5230",
"sender_email": null,
"sms_notification": null,
"email_notification": null,
"delivery": null,
"display_name": "0kg til 1kg",
"shipping_agent": "pdk",
"created_at": "2014-11-13T13:37:42.195+01:00",
"pkg_no": "00370720682192051392",
"order_id": "100",
"additiondal_data": {
"airway_bill_number": "4458467871"
}
},
{...}
]
}
This method supports pagination. 20 shipments are returned on each page. The total number of shipments which matches the conditions is returned in shipment_count, and the total number of pages in total_pages.
GET https://app.pakkelabels.dk/api/public/v2/shipments/shipments
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
page | integer | false | The page to return. Defaults to 1 if not set |
shipping_agent | string | false | Filter by shipping agent |
receiver_country | string | false | Filter by receiver country |
pkg_no | string | false | Filter by package/tracking number |
order_id | string | false | ilter by any custom order id set |
created_at_min | string | false | Filter by creation time |
created_at_max | string | false | Filter by creation time |
List imported shipments
<?php
$labels = $label->imported_shipments(array('shipping_agent' => 'pdk', 'receiver_country' => 'DK'));
print_r($labels);
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/imported_shipments?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&shipping_agent=pdk&receiver_country=DK
The above command returns JSON structured like this:
{
"shipment_count": 25,
"total_pages": 2,
"shipments": [
{
"id": 42,
"receiver_name": "John Doe",
"receiver_attention": "",
"receiver_address1": "Test Street 1",
"receiver_address2": "",
"receiver_country": "DK",
"receiver_zipcode": "5000",
"receiver_email": "test@test.dk",
"receiver_telephone": null,
"sender_name": "Sender Doe",
"sender_attention": "",
"sender_address1": "Sender Street 1",
"sender_address2": "",
"sender_country": "DK",
"sender_zipcode": "5230",
"sender_email": null,
"order_id": "100"
},
{
"id": 43,
"receiver_name": "John Doe",
"receiver_attention": "",
"receiver_address1": "Test Street 2",
"receiver_address2": "",
"receiver_country": "DK",
"receiver_zipcode": "5000",
"receiver_email": "test@test.dk",
"receiver_telephone": null,
"sender_name": "Sender Doe",
"sender_attention": "",
"sender_address1": "Sender Street 2",
"sender_address2": "",
"sender_country": "DK",
"sender_zipcode": "5230",
"sender_email": null,
"order_id": "100"
},
{...}
]
}
Note that once a imported shipment has been used to create a shipment, it is moved from imported_shipments to shipments. This method supports pagination. 20 shipments are returned on each page. The total number of shipments which matches the conditions is returned in shipment_count, and the total number of pages in total_pages.
GET https://app.pakkelabels.dk/api/public/v2/shipments/imported_shipments
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
page | integer | false | The page to return. Defaults to 1 if not set |
shipping_agent | string | false | Filter by shipping agent |
receiver_country | string | false | Filter by receiver country |
created_at_min | string | false | Filter by creation time |
created_at_max | string | false | Filter by creation time |
<?php
$base64 = $label->pdf(42);
$pdf = base64_decode($base64);
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/pdf?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&id=42
The above command returns JSON structured like this:
{
"base64": "..."
}
Returns the base64 encoding of a label created earlier in PDF format
GET https://app.pakkelabels.dk/api/public/v2/shipments/pdf
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
id | integer | true | Shipment ID |
label_format | string | false | Label format (a5 or 10x19) |
PDF Multiple
<?php
$base64 = $label->pdf_multiple([42, 1337]);
$pdf = base64_decode($base64);
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/pdf_multiple?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&ids=42,1337
The above command returns JSON structured like this:
{
"base64": "..."
}
Returns the base64 encoding of the labels specified in PDF format. The labels will be concatenated to a single PDF. This can be used for bulk printing.
GET https://app.pakkelabels.dk/api/public/v2/shipments/pdf_multiple
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
ids | string | true | Comma separated list of shipments IDs |
label_format | string | false | Label format (a5 or 10x19) |
ZPL
<?php
$base64 = $label->zpl(42);
$zpl = base64_decode($base64);
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/zpl?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&id=42
The above command returns JSON structured like this:
{
"base64": "..."
}
Returns the base64 encoding of a label created earlier in ZPL format
GET https://app.pakkelabels.dk/api/public/v2/shipments/zpl
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
id | integer | true | Shipment ID |
Freigt Rates
<?php
$data = array(
'country' => 'DK',
);
print_r($label->freight_rates($data));
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/freight_rates?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&country=DK
The above command returns JSON structured like this:
{
"DK":{
"pdk":{
"name":"Post Danmark",
"code":"pdk",
"rates":[
{
"from_weight": 0,
"to_weight": 1000,
"price": 58,
"price_including_vat": false,
"specific_shipping_product": 50
},
{
"from_weight": 1000,
"to_weight": 5000,
"price": 68,
"price_including_vat": false,
"specific_shipping_product": 50
},
{
"from_weight": 0,
"to_weight": 1000,
"price": 39,
"price_including_vat": false,
"specific_shipping_product": 51
}
],
"products":[
{
"id":51,
"name":"Privatpakke u. omdeling",
"price":0.0,
"delivery":false,
"services":[
{
"id":11,
"name":"Email advisering",
"price":0.0
},
{
"id":12,
"name":"SMS advisering",
"price":0.0
}
]
},
{
"id":50,
"name":"Privatpakke m. omdeling",
"price":19.0,
"delivery":true,
"services":[
{
"id":11,
"name":"Email advisering",
"price":0.0
},
{
"id":12,
"name":"SMS advisering",
"price":0.0
}
]
}
]
},
"gls":{
"name":"GLS",
"code":"gls",
"rates":[
{}
],
"products":[
{}
]
}
},
"SE": {
}
}
Returns the countries, shipping agents, products and services which are available for your user. The list also includes the price for the different products and services. The IDs of the products should be used in shipping_product_id, and the IDs of the services in services, when creating a shipment. If the value for specific_shipping_product under a rate is set, then that rate only applies for the specific product.
GET https://app.pakkelabels.dk/api/public/v2/shipments/freight_rates
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
country | string | true | Filter by country (defaults to DK) |
PostNord Drop points
<?php
print_r($label->pdk_droppoints(array('zipcode' => '5240', 'street' => 'Strandvejen')));
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/pdk_droppoints?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&zipcode=5240&street=Strandvejen
The above command returns JSON structured like this:
[
{
"number": "3870",
"company_name": "Pakkeboks 3870",
"address": "Skibhusvej 53",
"zipcode": "5000",
"city": "ODENSE C"
},
{
"number": "5003",
"company_name": "POSTHUS",
"address": "Dannebrogsgade 2",
"zipcode": "5000",
"city": "ODENSE C"
},
{
"number": "655",
"company_name": "Pakkeboks 655",
"address": "Dannebrogsgade 2",
"zipcode": "5000",
"city": "ODENSE C"
}
]
Find the nearest droppoint (“Service Point”) based on zipcode and address.
It is possible to use the the universal pickup_points end-point that support more than one shipping agent
GET https://app.pakkelabels.dk/api/public/v2/shipments/pdk_droppoints
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
zipcode | string | true | Zipcode |
street | string | false | Street |
number | string | false | The number of droppoints to return (defaults to 3) |
country | string | false | Country (defaults to DK) |
GLS Drop points
<?php
print_r($label->gls_droppoints(array('zipcode' => '5240', 'street' => 'Strandvejen')));
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/gls_droppoints?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&zipcode=5240&street=Strandvejen
The above command returns JSON structured like this:
[
{
"number": "97229",
"company_name": "OK Plus Havnegade",
"address": "Havnegade 1",
"address2": "Pakkeshop: 97229",
"zipcode": "5000",
"city": "Odense C"
},
{
"number": "95210",
"company_name": "Statoil",
"address": "Kochsgade 94",
"address2": "Pakkeshop: 95210",
"zipcode": "5000",
"city": "Odense C"
},
{
"number": "97871",
"company_name": "Shell 7-Eleven Næsbyvej",
"address": "Næsbyvej 51",
"address2": "Pakkeshop: 97871",
"zipcode": "5000",
"city": "Odense C"
}
]
Find the nearest droppoint (“Service Point”) based on zipcode and address.
It is possible to use the the universal pickup_points end-point that support more than one shipping agent
GET https://app.pakkelabels.dk/api/public/v2/shipments/gls_droppoints
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
zipcode | string | true | Zipcode |
street | string | false | Street |
number | string | false | The number of droppoints to return (defaults to 3) |
DAO Drop points
<?php
print_r($label->dao_droppoints(array('zipcode' => '5240', 'street' => 'Strandvejen')));
?>
curl https://app.pakkelabels.dk/api/public/v2/shipments/dao_droppoints?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&zipcode=5240&street=Strandvejen
The above command returns JSON structured like this:
[
{
"number": "58318",
"company_name": "Center Kiosken",
"address": "Vollsmose Alle 10",
"address2": "",
"zipcode": "5240",
"city": "Odense Nø",
"country": "DK",
"distance": 1915,
"longitude": 10.4413,
"latitude": 55.4068,
"agent": "dao"
},
{
"number": "59033",
"company_name": "Påskeløkkens Købmand",
"address": "Paaskeløkkevej 11",
"address2": "",
"zipcode": "5000",
"city": "Odense C",
"country": "DK",
"distance": 2385,
"longitude": 10.4159,
"latitude": 55.4086,
"agent": "dao"
},
{
"number": "58093",
"company_name": "Ok Plus Sandhusvej",
"address": "Sandhusvej 19",
"address2": "",
"zipcode": "5000",
"city": "Odense C",
"country": "DK",
"distance": 2466,
"longitude": 10.4047,
"latitude": 55.4177,
"agent": "dao"
}
]
Find the nearest droppoint (“Service Point”) based on zipcode and address.
It is possible to use the the universal pickup_points end-point that support more than one shipping agent
GET https://app.pakkelabels.dk/api/public/v2/shipments/dao_droppoints
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
zipcode | string | true | Zipcode |
street | string | false | Street |
number | string | false | The number of droppoints to return (defaults to 3) |
country | string | false | Country (defaults to DK) |
Service Points
Pickup Points
<?php
print_r($label->pickup_points(array('agent' => 'dao', 'zipcode' => '5240', 'address' => 'Strandvejen 6')));
?>
curl https://app.pakkelabels.dk/api/public/v2/pickup_points?token=8oH1hMoITVHdcPYiKAkgagVNEJ_UWFknVtfcTWB9&agent=dao&zipcode=5240&address=Strandvejen%206
The above command returns JSON structured like this:
[
{
"number": "58318",
"company_name": "Center Kiosken",
"address": "Vollsmose Alle 10",
"address2": "",
"zipcode": "5240",
"city": "Odense Nø",
"country": "DK",
"distance": 1915,
"longitude": 10.4413,
"latitude": 55.4068,
"agent": "dao"
},
{
"number": "59033",
"company_name": "Påskeløkkens Købmand",
"address": "Paaskeløkkevej 11",
"address2": "",
"zipcode": "5000",
"city": "Odense C",
"country": "DK",
"distance": 2385,
"longitude": 10.4159,
"latitude": 55.4086,
"agent": "dao"
},
{
"number": "58093",
"company_name": "Ok Plus Sandhusvej",
"address": "Sandhusvej 19",
"address2": "",
"zipcode": "5000",
"city": "Odense C",
"country": "DK",
"distance": 2466,
"longitude": 10.4047,
"latitude": 55.4177,
"agent": "dao"
},
...
]
Find the nearest pickup points (“Service Point” or “Drop Point”) based on shipping agent / carrier, country, zipcode and address.
GET https://app.pakkelabels.dk/api/public/v2/pickup_points
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | true | Authentication token |
agent | string | true | Shipping Agent / Carrier code. Available values: bring, dao, db_schenker_se, gls or pdk |
country | string | true | Country code. Available values: DK, NO, SE, FI, NL, DE, BE, LU. Default: DK |
zipcode | string | true | Zipcode |
address | string | false | Street address (contains street name and house number) |
number | integer | false | The number of droppoints to return (defaults to 10) |
id | string | false | The ID of the droppoint at shipping agent. Once this field is used, zipcode is no longer mandatory |