Objective-C / DHL Express APIs (MyDHL API) / Create a DHL Express pickup booking request
Back to Collection Items
#import <CkoHttp.h>
#import <CkoJsonObject.h>
#import <CkoHttpResponse.h>
#import <CkoStringBuilder.h>
#import <NSString.h>
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkoHttp *http = [[CkoHttp alloc] init];
BOOL success;
http.BasicAuth = YES;
http.Login = @"<Basic Auth Username>";
http.Password = @"<Basic Auth Password>";
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "plannedPickupDateAndTime": "2019-08-04T14:00:31GMT+01:00",
// "accounts": [
// {
// "typeCode": "shipper",
// "number": "123456789"
// }
// ],
// "customerDetails": {
// "shipperDetails": {
// "postalAddress": {
// "postalCode": "14800",
// "cityName": "Prague",
// "countryCode": "CZ",
// "addressLine1": "V Parku 2308/10",
// "provinceCode": "CZ",
// "addressLine2": "addres2",
// "addressLine3": "addres3",
// "countyName": "Central Bohemia"
// },
// "contactInformation": {
// "phone": "+1123456789",
// "companyName": "Company Name",
// "fullName": "John Brew",
// "email": "that@before.de",
// "mobilePhone": "+60112345678"
// }
// },
// "receiverDetails": {
// "postalAddress": {
// "postalCode": "14800",
// "cityName": "Prague",
// "countryCode": "CZ",
// "addressLine1": "V Parku 2308/10",
// "provinceCode": "CZ",
// "addressLine2": "addres2",
// "addressLine3": "addres3",
// "countyName": "Central Bohemia"
// },
// "contactInformation": {
// "phone": "+1123456789",
// "companyName": "Company Name",
// "fullName": "John Brew",
// "email": "that@before.de",
// "mobilePhone": "+60112345678"
// }
// },
// "bookingRequestorDetails": {
// "contactInformation": {
// "phone": "+1123456789",
// "companyName": "Company Name",
// "fullName": "John Brew",
// "email": "that@before.de",
// "mobilePhone": "+60112345678"
// },
// "postalAddress": {
// "postalCode": "14800",
// "cityName": "Prague",
// "countryCode": "CZ",
// "addressLine1": "V Parku 2308/10",
// "provinceCode": "CZ",
// "addressLine2": "addres2",
// "addressLine3": "addres3",
// "countyName": "Central Bohemia"
// }
// },
// "pickupDetails": {
// "postalAddress": {
// "postalCode": "14800",
// "cityName": "Prague",
// "countryCode": "CZ",
// "addressLine1": "V Parku 2308/10",
// "provinceCode": "CZ",
// "addressLine2": "addres2",
// "addressLine3": "addres3",
// "countyName": "Central Bohemia"
// },
// "contactInformation": {
// "phone": "+1123456789",
// "companyName": "Company Name",
// "fullName": "John Brew",
// "email": "that@before.de",
// "mobilePhone": "+60112345678"
// }
// }
// },
// "shipmentDetails": [
// {
// "productCode": "amet",
// "isCustomsDeclarable": false,
// "unitOfMeasurement": "metric",
// "packages": [
// {
// "weight": 10.5,
// "dimensions": {
// "length": 25,
// "width": 35,
// "height": 15
// },
// "typeCode": "3BX"
// }
// ],
// "localProductCode": "sed",
// "accounts": [
// {
// "typeCode": "shipper",
// "number": "123456789"
// },
// {
// "typeCode": "shipper",
// "number": "123456789"
// }
// ],
// "valueAddedServices": [
// {
// "serviceCode": "II",
// "localServiceCode": "II",
// "value": 100,
// "currency": "GBP",
// "method": "cash"
// },
// {
// "serviceCode": "II",
// "localServiceCode": "II",
// "value": 100,
// "currency": "GBP",
// "method": "cash"
// }
// ],
// "declaredValue": 150,
// "declaredValueCurrency": "CZK",
// "shipmentTrackingNumber": "123456790"
// }
// ],
// "closeTime": "18:00",
// "location": "reception",
// "locationType": "residence",
// "specialInstructions": [
// {
// "value": "please ring door bell",
// "typeCode": "TBD"
// }
// ],
// "remark": "velit reprehenderit anim esse"
// }
CkoJsonObject *json = [[CkoJsonObject alloc] init];
[json UpdateString: @"plannedPickupDateAndTime" value: @"2019-08-04T14:00:31GMT+01:00"];
[json UpdateString: @"accounts[0].typeCode" value: @"shipper"];
[json UpdateString: @"accounts[0].number" value: @"123456789"];
[json UpdateString: @"customerDetails.shipperDetails.postalAddress.postalCode" value: @"14800"];
[json UpdateString: @"customerDetails.shipperDetails.postalAddress.cityName" value: @"Prague"];
[json UpdateString: @"customerDetails.shipperDetails.postalAddress.countryCode" value: @"CZ"];
[json UpdateString: @"customerDetails.shipperDetails.postalAddress.addressLine1" value: @"V Parku 2308/10"];
[json UpdateString: @"customerDetails.shipperDetails.postalAddress.provinceCode" value: @"CZ"];
[json UpdateString: @"customerDetails.shipperDetails.postalAddress.addressLine2" value: @"addres2"];
[json UpdateString: @"customerDetails.shipperDetails.postalAddress.addressLine3" value: @"addres3"];
[json UpdateString: @"customerDetails.shipperDetails.postalAddress.countyName" value: @"Central Bohemia"];
[json UpdateString: @"customerDetails.shipperDetails.contactInformation.phone" value: @"+1123456789"];
[json UpdateString: @"customerDetails.shipperDetails.contactInformation.companyName" value: @"Company Name"];
[json UpdateString: @"customerDetails.shipperDetails.contactInformation.fullName" value: @"John Brew"];
[json UpdateString: @"customerDetails.shipperDetails.contactInformation.email" value: @"that@before.de"];
[json UpdateString: @"customerDetails.shipperDetails.contactInformation.mobilePhone" value: @"+60112345678"];
[json UpdateString: @"customerDetails.receiverDetails.postalAddress.postalCode" value: @"14800"];
[json UpdateString: @"customerDetails.receiverDetails.postalAddress.cityName" value: @"Prague"];
[json UpdateString: @"customerDetails.receiverDetails.postalAddress.countryCode" value: @"CZ"];
[json UpdateString: @"customerDetails.receiverDetails.postalAddress.addressLine1" value: @"V Parku 2308/10"];
[json UpdateString: @"customerDetails.receiverDetails.postalAddress.provinceCode" value: @"CZ"];
[json UpdateString: @"customerDetails.receiverDetails.postalAddress.addressLine2" value: @"addres2"];
[json UpdateString: @"customerDetails.receiverDetails.postalAddress.addressLine3" value: @"addres3"];
[json UpdateString: @"customerDetails.receiverDetails.postalAddress.countyName" value: @"Central Bohemia"];
[json UpdateString: @"customerDetails.receiverDetails.contactInformation.phone" value: @"+1123456789"];
[json UpdateString: @"customerDetails.receiverDetails.contactInformation.companyName" value: @"Company Name"];
[json UpdateString: @"customerDetails.receiverDetails.contactInformation.fullName" value: @"John Brew"];
[json UpdateString: @"customerDetails.receiverDetails.contactInformation.email" value: @"that@before.de"];
[json UpdateString: @"customerDetails.receiverDetails.contactInformation.mobilePhone" value: @"+60112345678"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.contactInformation.phone" value: @"+1123456789"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.contactInformation.companyName" value: @"Company Name"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.contactInformation.fullName" value: @"John Brew"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.contactInformation.email" value: @"that@before.de"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.contactInformation.mobilePhone" value: @"+60112345678"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.postalAddress.postalCode" value: @"14800"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.postalAddress.cityName" value: @"Prague"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.postalAddress.countryCode" value: @"CZ"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.postalAddress.addressLine1" value: @"V Parku 2308/10"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.postalAddress.provinceCode" value: @"CZ"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.postalAddress.addressLine2" value: @"addres2"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.postalAddress.addressLine3" value: @"addres3"];
[json UpdateString: @"customerDetails.bookingRequestorDetails.postalAddress.countyName" value: @"Central Bohemia"];
[json UpdateString: @"customerDetails.pickupDetails.postalAddress.postalCode" value: @"14800"];
[json UpdateString: @"customerDetails.pickupDetails.postalAddress.cityName" value: @"Prague"];
[json UpdateString: @"customerDetails.pickupDetails.postalAddress.countryCode" value: @"CZ"];
[json UpdateString: @"customerDetails.pickupDetails.postalAddress.addressLine1" value: @"V Parku 2308/10"];
[json UpdateString: @"customerDetails.pickupDetails.postalAddress.provinceCode" value: @"CZ"];
[json UpdateString: @"customerDetails.pickupDetails.postalAddress.addressLine2" value: @"addres2"];
[json UpdateString: @"customerDetails.pickupDetails.postalAddress.addressLine3" value: @"addres3"];
[json UpdateString: @"customerDetails.pickupDetails.postalAddress.countyName" value: @"Central Bohemia"];
[json UpdateString: @"customerDetails.pickupDetails.contactInformation.phone" value: @"+1123456789"];
[json UpdateString: @"customerDetails.pickupDetails.contactInformation.companyName" value: @"Company Name"];
[json UpdateString: @"customerDetails.pickupDetails.contactInformation.fullName" value: @"John Brew"];
[json UpdateString: @"customerDetails.pickupDetails.contactInformation.email" value: @"that@before.de"];
[json UpdateString: @"customerDetails.pickupDetails.contactInformation.mobilePhone" value: @"+60112345678"];
[json UpdateString: @"shipmentDetails[0].productCode" value: @"amet"];
[json UpdateBool: @"shipmentDetails[0].isCustomsDeclarable" value: NO];
[json UpdateString: @"shipmentDetails[0].unitOfMeasurement" value: @"metric"];
[json UpdateNumber: @"shipmentDetails[0].packages[0].weight" numericStr: @"10.5"];
[json UpdateInt: @"shipmentDetails[0].packages[0].dimensions.length" value: [NSNumber numberWithInt: 25]];
[json UpdateInt: @"shipmentDetails[0].packages[0].dimensions.width" value: [NSNumber numberWithInt: 35]];
[json UpdateInt: @"shipmentDetails[0].packages[0].dimensions.height" value: [NSNumber numberWithInt: 15]];
[json UpdateString: @"shipmentDetails[0].packages[0].typeCode" value: @"3BX"];
[json UpdateString: @"shipmentDetails[0].localProductCode" value: @"sed"];
[json UpdateString: @"shipmentDetails[0].accounts[0].typeCode" value: @"shipper"];
[json UpdateString: @"shipmentDetails[0].accounts[0].number" value: @"123456789"];
[json UpdateString: @"shipmentDetails[0].accounts[1].typeCode" value: @"shipper"];
[json UpdateString: @"shipmentDetails[0].accounts[1].number" value: @"123456789"];
[json UpdateString: @"shipmentDetails[0].valueAddedServices[0].serviceCode" value: @"II"];
[json UpdateString: @"shipmentDetails[0].valueAddedServices[0].localServiceCode" value: @"II"];
[json UpdateInt: @"shipmentDetails[0].valueAddedServices[0].value" value: [NSNumber numberWithInt: 100]];
[json UpdateString: @"shipmentDetails[0].valueAddedServices[0].currency" value: @"GBP"];
[json UpdateString: @"shipmentDetails[0].valueAddedServices[0].method" value: @"cash"];
[json UpdateString: @"shipmentDetails[0].valueAddedServices[1].serviceCode" value: @"II"];
[json UpdateString: @"shipmentDetails[0].valueAddedServices[1].localServiceCode" value: @"II"];
[json UpdateInt: @"shipmentDetails[0].valueAddedServices[1].value" value: [NSNumber numberWithInt: 100]];
[json UpdateString: @"shipmentDetails[0].valueAddedServices[1].currency" value: @"GBP"];
[json UpdateString: @"shipmentDetails[0].valueAddedServices[1].method" value: @"cash"];
[json UpdateInt: @"shipmentDetails[0].declaredValue" value: [NSNumber numberWithInt: 150]];
[json UpdateString: @"shipmentDetails[0].declaredValueCurrency" value: @"CZK"];
[json UpdateString: @"shipmentDetails[0].shipmentTrackingNumber" value: @"123456790"];
[json UpdateString: @"closeTime" value: @"18:00"];
[json UpdateString: @"location" value: @"reception"];
[json UpdateString: @"locationType" value: @"residence"];
[json UpdateString: @"specialInstructions[0].value" value: @"please ring door bell"];
[json UpdateString: @"specialInstructions[0].typeCode" value: @"TBD"];
[json UpdateString: @"remark" value: @"velit reprehenderit anim esse"];
[http SetRequestHeader: @"Webstore-Platform-Name" value: @""];
[http SetRequestHeader: @"Shipping-System-Platform-Name" value: @""];
[http SetRequestHeader: @"Message-Reference" value: @"d0e7832e-5c98-11ea-bc55-0242ac13"];
[http SetRequestHeader: @"Plugin-Version" value: @""];
[http SetRequestHeader: @"Content-Type" value: @"application/json"];
[http SetRequestHeader: @"Plugin-Name" value: @""];
[http SetRequestHeader: @"Shipping-System-Platform-Version" value: @""];
[http SetRequestHeader: @"Accept" value: @"application/json"];
[http SetRequestHeader: @"Message-Reference-Date" value: @"Wed, 21 Oct 2015 07:28:00 GMT"];
[http SetRequestHeader: @"Webstore-Platform-Version" value: @""];
CkoHttpResponse *resp = [http PostJson3: @"https://api-mock.dhl.com/mydhlapi/pickups" contentType: @"application/json" json: json];
if (http.LastMethodSuccess == NO) {
NSLog(@"%@",http.LastErrorText);
return;
}
CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
[resp GetBodySb: sbResponseBody];
CkoJsonObject *jResp = [[CkoJsonObject alloc] init];
[jResp LoadSb: sbResponseBody];
jResp.EmitCompact = NO;
NSLog(@"%@",@"Response Body:");
NSLog(@"%@",[jResp Emit]);
int respStatusCode = [resp.StatusCode intValue];
NSLog(@"%@%d",@"Response Status Code = ",respStatusCode);
if (respStatusCode >= 400) {
NSLog(@"%@",@"Response Header:");
NSLog(@"%@",resp.Header);
NSLog(@"%@",@"Failed.");
return;
}
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "dispatchConfirmationNumbers": [
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456",
// "PRG201220123456"
// ],
// "readyByTime": "12:00",
// "nextPickupDate": "2020-06-01",
// "warnings": [
// "Pickup created bu somthing went wrong",
// "Pickup created bu somthing went wrong"
// ]
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
NSString *strVal = 0;
NSString *readyByTime = [jResp StringOf: @"readyByTime"];
NSString *nextPickupDate = [jResp StringOf: @"nextPickupDate"];
int i = 0;
int count_i = [[jResp SizeOfArray: @"dispatchConfirmationNumbers"] intValue];
while (i < count_i) {
jResp.I = [NSNumber numberWithInt: i];
strVal = [jResp StringOf: @"dispatchConfirmationNumbers[i]"];
i = i + 1;
}
i = 0;
count_i = [[jResp SizeOfArray: @"warnings"] intValue];
while (i < count_i) {
jResp.I = [NSNumber numberWithInt: i];
strVal = [jResp StringOf: @"warnings[i]"];
i = i + 1;
}
Curl Command
curl -X POST
-u '<Basic Auth Username>:<Basic Auth Password>'
-H "Message-Reference: d0e7832e-5c98-11ea-bc55-0242ac13"
-H "Message-Reference-Date: Wed, 21 Oct 2015 07:28:00 GMT"
-H "Plugin-Name: "
-H "Plugin-Version: "
-H "Shipping-System-Platform-Name: "
-H "Shipping-System-Platform-Version: "
-H "Webstore-Platform-Name: "
-H "Webstore-Platform-Version: "
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '{
"plannedPickupDateAndTime": "2019-08-04T14:00:31GMT+01:00",
"accounts": [
{
"typeCode": "shipper",
"number": "123456789"
}
],
"customerDetails": {
"shipperDetails": {
"postalAddress": {
"postalCode": "14800",
"cityName": "Prague",
"countryCode": "CZ",
"addressLine1": "V Parku 2308/10",
"provinceCode": "CZ",
"addressLine2": "addres2",
"addressLine3": "addres3",
"countyName": "Central Bohemia"
},
"contactInformation": {
"phone": "+1123456789",
"companyName": "Company Name",
"fullName": "John Brew",
"email": "that@before.de",
"mobilePhone": "+60112345678"
}
},
"receiverDetails": {
"postalAddress": {
"postalCode": "14800",
"cityName": "Prague",
"countryCode": "CZ",
"addressLine1": "V Parku 2308/10",
"provinceCode": "CZ",
"addressLine2": "addres2",
"addressLine3": "addres3",
"countyName": "Central Bohemia"
},
"contactInformation": {
"phone": "+1123456789",
"companyName": "Company Name",
"fullName": "John Brew",
"email": "that@before.de",
"mobilePhone": "+60112345678"
}
},
"bookingRequestorDetails": {
"contactInformation": {
"phone": "+1123456789",
"companyName": "Company Name",
"fullName": "John Brew",
"email": "that@before.de",
"mobilePhone": "+60112345678"
},
"postalAddress": {
"postalCode": "14800",
"cityName": "Prague",
"countryCode": "CZ",
"addressLine1": "V Parku 2308/10",
"provinceCode": "CZ",
"addressLine2": "addres2",
"addressLine3": "addres3",
"countyName": "Central Bohemia"
}
},
"pickupDetails": {
"postalAddress": {
"postalCode": "14800",
"cityName": "Prague",
"countryCode": "CZ",
"addressLine1": "V Parku 2308/10",
"provinceCode": "CZ",
"addressLine2": "addres2",
"addressLine3": "addres3",
"countyName": "Central Bohemia"
},
"contactInformation": {
"phone": "+1123456789",
"companyName": "Company Name",
"fullName": "John Brew",
"email": "that@before.de",
"mobilePhone": "+60112345678"
}
}
},
"shipmentDetails": [
{
"productCode": "amet",
"isCustomsDeclarable": false,
"unitOfMeasurement": "metric",
"packages": [
{
"weight": 10.5,
"dimensions": {
"length": 25,
"width": 35,
"height": 15
},
"typeCode": "3BX"
}
],
"localProductCode": "sed",
"accounts": [
{
"typeCode": "shipper",
"number": "123456789"
},
{
"typeCode": "shipper",
"number": "123456789"
}
],
"valueAddedServices": [
{
"serviceCode": "II",
"localServiceCode": "II",
"value": 100,
"currency": "GBP",
"method": "cash"
},
{
"serviceCode": "II",
"localServiceCode": "II",
"value": 100,
"currency": "GBP",
"method": "cash"
}
],
"declaredValue": 150,
"declaredValueCurrency": "CZK",
"shipmentTrackingNumber": "123456790"
}
],
"closeTime": "18:00",
"location": "reception",
"locationType": "residence",
"specialInstructions": [
{
"value": "please ring door bell",
"typeCode": "TBD"
}
],
"remark": "velit reprehenderit anim esse"
}'
https://api-mock.dhl.com/mydhlapi/pickups
Postman Collection Item JSON
{
"name": "Create a DHL Express pickup booking request",
"request": {
"method": "POST",
"header": [
{
"description": "Please provide message reference\n",
"key": "Message-Reference",
"value": "d0e7832e-5c98-11ea-bc55-0242ac13"
},
{
"description": "Optional reference date in the HTTP-date format https://tools.ietf.org/html/rfc7231#section-7.1.1.2",
"key": "Message-Reference-Date",
"value": "Wed, 21 Oct 2015 07:28:00 GMT"
},
{
"description": "Please provide name of the plugin (applicable to 3PV only)\n",
"key": "Plugin-Name",
"value": " "
},
{
"description": "Please provide version of the plugin (applicable to 3PV only)\n",
"key": "Plugin-Version",
"value": " "
},
{
"description": "Please provide name of the shipping platform(applicable to 3PV only)\n",
"key": "Shipping-System-Platform-Name",
"value": " "
},
{
"description": "Please provide version of the shipping platform (applicable to 3PV only)\n",
"key": "Shipping-System-Platform-Version",
"value": " "
},
{
"description": "Please provide name of the webstore platform (applicable to 3PV only)\n",
"key": "Webstore-Platform-Name",
"value": " "
},
{
"description": "Please provide version of the webstore platform (applicable to 3PV only)\n",
"key": "Webstore-Platform-Version",
"value": " "
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"plannedPickupDateAndTime\": \"2019-08-04T14:00:31GMT+01:00\",\n \"accounts\": [\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n }\n ],\n \"customerDetails\": {\n \"shipperDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n },\n \"receiverDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n },\n \"bookingRequestorDetails\": {\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n },\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n }\n },\n \"pickupDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n }\n },\n \"shipmentDetails\": [\n {\n \"productCode\": \"amet\",\n \"isCustomsDeclarable\": false,\n \"unitOfMeasurement\": \"metric\",\n \"packages\": [\n {\n \"weight\": 10.5,\n \"dimensions\": {\n \"length\": 25,\n \"width\": 35,\n \"height\": 15\n },\n \"typeCode\": \"3BX\"\n }\n ],\n \"localProductCode\": \"sed\",\n \"accounts\": [\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n },\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n }\n ],\n \"valueAddedServices\": [\n {\n \"serviceCode\": \"II\",\n \"localServiceCode\": \"II\",\n \"value\": 100,\n \"currency\": \"GBP\",\n \"method\": \"cash\"\n },\n {\n \"serviceCode\": \"II\",\n \"localServiceCode\": \"II\",\n \"value\": 100,\n \"currency\": \"GBP\",\n \"method\": \"cash\"\n }\n ],\n \"declaredValue\": 150,\n \"declaredValueCurrency\": \"CZK\",\n \"shipmentTrackingNumber\": \"123456790\"\n }\n ],\n \"closeTime\": \"18:00\",\n \"location\": \"reception\",\n \"locationType\": \"residence\",\n \"specialInstructions\": [\n {\n \"value\": \"please ring door bell\",\n \"typeCode\": \"TBD\"\n }\n ],\n \"remark\": \"velit reprehenderit anim esse\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/pickups",
"host": [
"{{baseUrl}}"
],
"path": [
"pickups"
]
},
"description": "The Pickup service creates a DHL Express pickup booking request\n"
},
"response": [
{
"name": "Pickup created",
"originalRequest": {
"method": "POST",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
},
{
"description": "Please provide message reference\n",
"key": "Message-Reference",
"value": "d0e7832e-5c98-11ea-bc55-0242ac13"
},
{
"description": "Optional reference date in the HTTP-date format https://tools.ietf.org/html/rfc7231#section-7.1.1.2",
"key": "Message-Reference-Date",
"value": "Wed, 21 Oct 2015 07:28:00 GMT"
},
{
"description": "Please provide name of the plugin (applicable to 3PV only)\n",
"key": "Plugin-Name",
"value": " "
},
{
"description": "Please provide version of the plugin (applicable to 3PV only)\n",
"key": "Plugin-Version",
"value": " "
},
{
"description": "Please provide name of the shipping platform(applicable to 3PV only)\n",
"key": "Shipping-System-Platform-Name",
"value": " "
},
{
"description": "Please provide version of the shipping platform (applicable to 3PV only)\n",
"key": "Shipping-System-Platform-Version",
"value": " "
},
{
"description": "Please provide name of the webstore platform (applicable to 3PV only)\n",
"key": "Webstore-Platform-Name",
"value": " "
},
{
"description": "Please provide version of the webstore platform (applicable to 3PV only)\n",
"key": "Webstore-Platform-Version",
"value": " "
}
],
"body": {
"mode": "raw",
"raw": "{\n \"plannedPickupDateAndTime\": \"2019-08-04T14:00:31GMT+01:00\",\n \"accounts\": [\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n }\n ],\n \"customerDetails\": {\n \"shipperDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n },\n \"receiverDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n },\n \"bookingRequestorDetails\": {\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n },\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n }\n },\n \"pickupDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n }\n },\n \"shipmentDetails\": [\n {\n \"productCode\": \"amet\",\n \"isCustomsDeclarable\": false,\n \"unitOfMeasurement\": \"metric\",\n \"packages\": [\n {\n \"weight\": 10.5,\n \"dimensions\": {\n \"length\": 25,\n \"width\": 35,\n \"height\": 15\n },\n \"typeCode\": \"3BX\"\n }\n ],\n \"localProductCode\": \"sed\",\n \"accounts\": [\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n },\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n }\n ],\n \"valueAddedServices\": [\n {\n \"serviceCode\": \"II\",\n \"localServiceCode\": \"II\",\n \"value\": 100,\n \"currency\": \"GBP\",\n \"method\": \"cash\"\n },\n {\n \"serviceCode\": \"II\",\n \"localServiceCode\": \"II\",\n \"value\": 100,\n \"currency\": \"GBP\",\n \"method\": \"cash\"\n }\n ],\n \"declaredValue\": 150,\n \"declaredValueCurrency\": \"CZK\",\n \"shipmentTrackingNumber\": \"123456790\"\n }\n ],\n \"closeTime\": \"18:00\",\n \"location\": \"reception\",\n \"locationType\": \"residence\",\n \"specialInstructions\": [\n {\n \"value\": \"please ring door bell\",\n \"typeCode\": \"TBD\"\n }\n ],\n \"remark\": \"velit reprehenderit anim esse\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/pickups",
"host": [
"{{baseUrl}}"
],
"path": [
"pickups"
]
}
},
"status": "Created",
"code": 201,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"dispatchConfirmationNumbers\": [\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\",\n \"PRG201220123456\"\n ],\n \"readyByTime\": \"12:00\",\n \"nextPickupDate\": \"2020-06-01\",\n \"warnings\": [\n \"Pickup created bu somthing went wrong\",\n \"Pickup created bu somthing went wrong\"\n ]\n}"
},
{
"name": "Wrong input parameters",
"originalRequest": {
"method": "POST",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
},
{
"description": "Please provide message reference\n",
"key": "Message-Reference",
"value": "d0e7832e-5c98-11ea-bc55-0242ac13"
},
{
"description": "Optional reference date in the HTTP-date format https://tools.ietf.org/html/rfc7231#section-7.1.1.2",
"key": "Message-Reference-Date",
"value": "Wed, 21 Oct 2015 07:28:00 GMT"
},
{
"description": "Please provide name of the plugin (applicable to 3PV only)\n",
"key": "Plugin-Name",
"value": " "
},
{
"description": "Please provide version of the plugin (applicable to 3PV only)\n",
"key": "Plugin-Version",
"value": " "
},
{
"description": "Please provide name of the shipping platform(applicable to 3PV only)\n",
"key": "Shipping-System-Platform-Name",
"value": " "
},
{
"description": "Please provide version of the shipping platform (applicable to 3PV only)\n",
"key": "Shipping-System-Platform-Version",
"value": " "
},
{
"description": "Please provide name of the webstore platform (applicable to 3PV only)\n",
"key": "Webstore-Platform-Name",
"value": " "
},
{
"description": "Please provide version of the webstore platform (applicable to 3PV only)\n",
"key": "Webstore-Platform-Version",
"value": " "
}
],
"body": {
"mode": "raw",
"raw": "{\n \"plannedPickupDateAndTime\": \"2019-08-04T14:00:31GMT+01:00\",\n \"accounts\": [\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n }\n ],\n \"customerDetails\": {\n \"shipperDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n },\n \"receiverDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n },\n \"bookingRequestorDetails\": {\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n },\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n }\n },\n \"pickupDetails\": {\n \"postalAddress\": {\n \"postalCode\": \"14800\",\n \"cityName\": \"Prague\",\n \"countryCode\": \"CZ\",\n \"addressLine1\": \"V Parku 2308/10\",\n \"provinceCode\": \"CZ\",\n \"addressLine2\": \"addres2\",\n \"addressLine3\": \"addres3\",\n \"countyName\": \"Central Bohemia\"\n },\n \"contactInformation\": {\n \"phone\": \"+1123456789\",\n \"companyName\": \"Company Name\",\n \"fullName\": \"John Brew\",\n \"email\": \"that@before.de\",\n \"mobilePhone\": \"+60112345678\"\n }\n }\n },\n \"shipmentDetails\": [\n {\n \"productCode\": \"amet\",\n \"isCustomsDeclarable\": false,\n \"unitOfMeasurement\": \"metric\",\n \"packages\": [\n {\n \"weight\": 10.5,\n \"dimensions\": {\n \"length\": 25,\n \"width\": 35,\n \"height\": 15\n },\n \"typeCode\": \"3BX\"\n }\n ],\n \"localProductCode\": \"sed\",\n \"accounts\": [\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n },\n {\n \"typeCode\": \"shipper\",\n \"number\": \"123456789\"\n }\n ],\n \"valueAddedServices\": [\n {\n \"serviceCode\": \"II\",\n \"localServiceCode\": \"II\",\n \"value\": 100,\n \"currency\": \"GBP\",\n \"method\": \"cash\"\n },\n {\n \"serviceCode\": \"II\",\n \"localServiceCode\": \"II\",\n \"value\": 100,\n \"currency\": \"GBP\",\n \"method\": \"cash\"\n }\n ],\n \"declaredValue\": 150,\n \"declaredValueCurrency\": \"CZK\",\n \"shipmentTrackingNumber\": \"123456790\"\n }\n ],\n \"closeTime\": \"18:00\",\n \"location\": \"reception\",\n \"locationType\": \"residence\",\n \"specialInstructions\": [\n {\n \"value\": \"please ring door bell\",\n \"typeCode\": \"TBD\"\n }\n ],\n \"remark\": \"velit reprehenderit anim esse\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/pickups",
"host": [
"{{baseUrl}}"
],
"path": [
"pickups"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"instance\": \"/expressapi/pickups\",\n \"detail\": \"8003: Account not allowed for this service. Please contact your DHL Express representative.\",\n \"title\": \"Bad request\",\n \"message\": \"Bad request\",\n \"status\": \"400\"\n}"
}
]
}