### Get All Pickup Location Files (Example) Source: https://developers.api.dpd.co.uk/pickup/v1/get-pickup-location-file This example shows how to retrieve a consolidated dataset of all supported pickup locations by specifying 'ALL' as the country code. The response will contain a URL to download the complete file. ```HTTP GET /v1/customer/pickup/location/ALL/file ``` -------------------------------- ### Example Response Structure (JSON) Source: https://developers.api.dpd.co.uk/pickup/v1/get-pickup-location-file This is an example of the JSON response structure when requesting a pickup location file. The response contains a 'fileURL' which is a direct download link to the dataset. ```JSON { "data": { "fileURL": "https://storage.googleapis.com/examplefilenamehere" } } ``` -------------------------------- ### Get Pickup Location File by Country Code (Example) Source: https://developers.api.dpd.co.uk/pickup/v1/get-pickup-location-file This example demonstrates how to request a pickup location file for a specific country code. The API returns a file URL for downloading the dataset. ```HTTP GET /v1/customer/pickup/location/GB/file ``` -------------------------------- ### Get Safe Place Options - JSON Response Example Source: https://developers.api.dpd.co.uk/receiver-actions/v1/get-safe-place-options Example JSON response for the Get Safe Place Options endpoint, illustrating the structure of available safe place options. ```json { "data": { "options": { "frontPorch": "Front Porch", "garage": "Garage", "outBuilding": "Out Building", "other": "Other", "rearPorch": "Rear Porch" } } } ``` -------------------------------- ### Webhooks - Introduction and Configuration Source: https://developers.api.dpd.co.uk/webhooks/introduction Introduction to the DPD Webhook service, how to enable, disable, and configure webhook notifications through the Customer Admin Portal, including URL and Secret generation. ```APIDOC ## Webhooks - Introduction and Configuration ### Description The DPD Webhook service provides automatic event notifications as shipments progress through the DPD network. Real-time updates are sent to a specified URL, supplying shipment data that enables the sender to provide custom, branded communication directly to receivers. Enabling the webhook service prevents DPD from sending the specified event notifications to receivers, giving senders full control over communication. Webhooks can be enabled, disabled, and tested within the Customer Admin Portal. A valid URL must be provided to receive webhook notifications and to return an HTTP 200 OK status confirming successful receipt. A Secret must be generated for authentication purposes, as it is required to validate webhook notifications. The same Secret is used for both production and test webhook notifications. ### Configuring Webhooks 1. Access the Customer Admin Portal with administrator privileges. 2. Navigate to 'Webhooks' from the left-hand menu. 3. Use the main toggle switch to enable or disable all webhook notifications. 4. Configure individual notification types using their respective toggle switches. 5. Provide a valid URL to receive notifications. 6. Generate a Secret for authentication. ### Important Notes: - If a specific email or SMS notification type has been previously opted out of, the toggle switch for the corresponding webhook notification will appear greyed out. Contact your Account Manager or DPD commercial contact to re-enable it. - Two Secrets may exist simultaneously, but only one can be active. Select the active Secret using its checkbox and revoke old secrets using the REVOKE button. ``` -------------------------------- ### Get Country by Country Code (Example) Source: https://developers.api.dpd.co.uk/shipping/v1/get-country-by-country-code This example demonstrates how to call the 'Get country by country code' endpoint to retrieve information for a specific country. It shows a successful JSON response containing country details. ```json { "data": { "countryKey": "GB", "countryName": "United Kingdom", "euCountry": false, "flagPostCodeNo": false, "internalCode": "UK", "isoCode": "826", "liabilityFlag": true, "liabilityValue": 15000, "postcodePattern": [ "ANNAA", "A??NAA", "AAN?NAA" ], "zipLength": 5, "isPostcodeRequired": true } } ``` -------------------------------- ### Unauthorized Access Example Source: https://developers.api.dpd.co.uk/pickup/v1/get-pickup-categories-file This example demonstrates the response structure when API access is denied due to invalid or incorrect authorization credentials. It includes error details such as status code, error code, and a descriptive message. ```json { "error": [ { "code": 102, "links": { "self": "/v1/customer/pickup/categories/file?fileType=pdf" }, "errorCode": "auth/invalid-token", "status": 401, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707759438768, "type": "BusinessRule", "message": "The provided token is not a valid token.", "id": "2f062c94d157369b4b029b0d419f8b3b" } ] } ``` -------------------------------- ### Get Network by Geoservice Code (Unauthorized Error Example) Source: https://developers.api.dpd.co.uk/shipping/v1/get-network-by-geoservice-code This JSON example shows an 'Unauthorized' error response (HTTP 401) for the 'Get network by geoservice code' API. It typically occurs when the provided authentication token is invalid or missing. ```JSON { "error": [ { "code": 102, "links": { "self": "/v1/customer/shipping/reference/network/101" }, "errorCode": "auth/invalid-token", "status": 401, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707759438768, "type": "BusinessRule", "message": "The provided token is not a valid token.", "id": "28140bdccf01f669fba60f44fb3d15c7" } ] } ``` -------------------------------- ### Get Network by Geoservice Code (Forbidden Error Example) Source: https://developers.api.dpd.co.uk/shipping/v1/get-network-by-geoservice-code This JSON example demonstrates a 'Forbidden' error response (HTTP 403) for the 'Get network by geoservice code' API. This error usually indicates that IP restrictions are preventing the request from being processed. ```JSON { "error": [ { "code": 102, "links": { "self": "/v1/customer/shipping/reference/network/101" }, "errorCode": "auth/failed-ip-match", "status": 403, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707482860362, "type": "BusinessRule", "message": "Request from invalid IP address", "id": "52e54b37a611d5d771c0fc14cfb834d9" } ] } ``` -------------------------------- ### Auth - Introduction Source: https://developers.api.dpd.co.uk/auth/introduction Introduction to the authentication APIs, explaining their purpose and requirements for integration. ```APIDOC ## Auth - Introduction ### Description This section introduces the authentication APIs, which are the initial step for integrating with DPD services. These APIs allow you to obtain access tokens necessary for accessing other DPD services within your application. ### Integration Requirements To integrate with these APIs, you will need an active DPD/DPD Local account, along with an API key and secret pair. Refer to the Getting Started Registration page for more information on obtaining these credentials. ### Authentication Method Authentication is performed using Basic authentication. Your API key and secret must be concatenated with a colon (`:`), encoded using Base64, and then passed in the `Authorization` header of your HTTPS requests. **Example:** If your Key is `key1234567890123456789` and your Secret is `secret9876543210987654321`: 1. Concatenate: `key1234567890123456789:secret9876543210987654321` 2. Encode to Base64: `a2V5MTIzNDU2Nzg5MDEyMzQ1Njc4OTpzZWNyZXQ5ODc2NTQzMjEwOTg3NjU0MzIx` 3. Use in Header: `Authorization: Basic a2V5MTIzNDU2Nzg5MDEyMzQ1Njc4OTpzZWNyZXQ5ODc2NTQzMjEwOTg3NjU0MzIx` ``` -------------------------------- ### Get Network by Geoservice Code (Field Validation Error Example) Source: https://developers.api.dpd.co.uk/shipping/v1/get-network-by-geoservice-code This JSON example illustrates a 'FieldValidation' error response (HTTP 400 Bad Request) for the 'Get network by geoservice code' API. It indicates an issue with the provided 'geoServiceCode', such as incorrect length. ```JSON { "error": [ { "code": 103, "links": { "self": "/v1/customer/shipping/reference/network/1012" }, "status": 400, "fieldName": "geoServiceCode", "fieldPath": "geoServiceCode", "displayType": "", "rule": "", "timestamp": 1707239329794, "type": "FieldValidation", "message": "geoServiceCode length must be 3 characters long", "id": "b57e7b9dd0449ef09fc6759fc7390eb0" } ] } ``` -------------------------------- ### Get Pickup Categories File Source: https://developers.api.dpd.co.uk/pickup/introduction Retrieves a sample file of pickup categories from the sandbox environment for testing purposes. ```APIDOC ## GET /v1/customer/pickup/categories/file ### Description Retrieves a sample file of pickup categories from the sandbox environment. This is intended for testing purposes only. ### Method GET ### Endpoint /v1/customer/pickup/categories/file ### Parameters No specific parameters are documented for this endpoint in the provided text. ### Request Example ```json { "example": "GET /v1/customer/pickup/categories/file" } ``` ### Response #### Success Response (200) - **categories** (array) - An array of pickup category objects. - **categoryId** (string) - The ID of the category. - **categoryName** (string) - The name of the category. #### Response Example ```json { "example": "{\"categories\":[{\"categoryId\":\"1\",\"categoryName\":\"Standard\"}]}" } ``` ``` -------------------------------- ### Get Pickup Location File Source: https://developers.api.dpd.co.uk/pickup/introduction Retrieves a sample set of pickup location data from the sandbox environment for testing purposes. ```APIDOC ## GET /v1/customer/pickup/location/file ### Description Retrieves a sample file of pickup location data from the sandbox environment. This is intended for testing purposes only. ### Method GET ### Endpoint /v1/customer/pickup/location/file ### Parameters #### Query Parameters - **latitude** (number) - Required - The latitude for searching pickup locations. - **longitude** (number) - Required - The longitude for searching pickup locations. - **pageNumber** (integer) - Optional - The page number for pagination. - **pageSize** (integer) - Optional - The number of results per page. - **distance** (integer) - Optional - The search radius in kilometers. - **restrictedCategories** (string) - Optional - A comma-separated list of restricted category IDs. ### Request Example ```json { "example": "GET /v1/customer/pickup/location/latlong?latitude=52.505521&longitude=-2.004096&pageNumber=1&pageSize=10&distance=10&restrictedCategories=test" } ``` ### Response #### Success Response (200) - **pickupLocations** (array) - An array of pickup location objects. - **locationId** (string) - The ID of the pickup location. - **locationName** (string) - The name of the pickup location. - **address** (object) - The address details of the pickup location. - **street** (string) - The street name. - **city** (string) - The city. - **postcode** (string) - The postcode. - **country** (string) - The country. #### Response Example ```json { "example": "{\"pickupLocations\":[{\"locationId\":\"12345\",\"locationName\":\"Example Location\",\"address\":{\"street\":\"123 Main St\",\"city\":\"Anytown\",\"postcode\":\"AB1 2CD\",\"country\":\"UK\"}}] }" } ``` ``` -------------------------------- ### Get Network by Geoservice Code (JSON Response Example) Source: https://developers.api.dpd.co.uk/shipping/v1/get-network-by-geoservice-code An example of a successful JSON response from the 'Get network by geoservice code' API. It includes country codes, names, liability status, and ISO codes for the network associated with the provided geo service code. ```JSON [ { "countryCode": "BA", "countryName": "Bosnia", "isLiabilityAllowed": true, "isoCode": "070" }, { "countryCode": "BG", "countryName": "Bulgaria", "isLiabilityAllowed": true, "isoCode": "100" }, { "countryCode": "HR", "countryName": "Croatia", "isLiabilityAllowed": true, "isoCode": "191" }, { "countryCode": "CZ", "countryName": "Czech Republic", "isLiabilityAllowed": true, "isoCode": "203" }, { "countryCode": "DK", "countryName": "Denmark", "isLiabilityAllowed": true, "isoCode": "208" }, { "countryCode": "EE", "countryName": "Estonia", "isLiabilityAllowed": true, "isoCode": "233" }, { "countryCode": "FI", "countryName": "Finland", "isLiabilityAllowed": true, "isoCode": "246" }, { "countryCode": "FR", "countryName": "France", "isLiabilityAllowed": true, "isoCode": "250" }, { "countryCode": "DE", "countryName": "Germany", "isLiabilityAllowed": true, "isoCode": "276" }, { "countryCode": "GR", "countryName": "Greece", "isLiabilityAllowed": true, "isoCode": "300" }, { "countryCode": "HU", "countryName": "Hungary", "isLiabilityAllowed": true, "isoCode": "348" }, { "countryCode": "IS", "countryName": "Iceland", "isLiabilityAllowed": true } ``` -------------------------------- ### Example cURL Request for DPD UK API Sandbox Source: https://developers.api.dpd.co.uk/getting-started/select-api-sandbox This example demonstrates how to make a request to the DPD UK API sandbox using cURL. It includes common headers and a placeholder for the request body. The 'networkCode' may need adjustment for DPD Local accounts. ```bash curl -X POST \ 'https://api.dpd.co.uk/sandbox/some/endpoint' \ -H 'Authorization: Bearer ' \ -H 'Client-Id: ' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{ "networkCode": "YOUR_NETWORK_CODE", "some_field": "some_value" }' ``` -------------------------------- ### Get Safe Place Options - Forbidden Error Example Source: https://developers.api.dpd.co.uk/receiver-actions/v1/get-safe-place-options Example JSON response for a 'Forbidden' error when calling the Get Safe Place Options endpoint. This usually relates to IP address restrictions. ```json { "error": [ { "code": 102, "links": { "self": "/v1/customer/public/parcel/reference/safeplace/options" }, "errorCode": "auth/failed-ip-match", "status": 403, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707482860362, "type": "BusinessRule", "message": "Request from invalid IP address", "id": "52e54b37a611d5d771c0fc14cfb834d9" } ] } ``` -------------------------------- ### Webhooks - Testing Source: https://developers.api.dpd.co.uk/webhooks/introduction Information on how to test webhook notifications using the Customer Admin Portal's testing functionality, including required fields and expected behavior. ```APIDOC ## Testing Webhooks ### Description The Customer Admin Portal includes functionality to send test webhook notifications to a specified URL. This allows for validation of the webhook setup and processing logic without affecting live shipments. ### Process 1. Ensure a Secret has been generated in the Customer Admin Portal. 2. Navigate to the 'Details for Testing' section within the Webhooks configuration. 3. Configure the following fields: * **Notification Type**: Select the type of test notification from the drop-down menu. * **Email**: Enter an email address to be populated in the test notification. * **URL**: Specify the destination URL where the test notification will be sent. * **Telephone Number**: Enter a telephone number to be populated in the test notification. 4. Click the 'SEND TEST' button to initiate the test webhook notification. ### Important Notes: - Test webhook notifications are for validation purposes only. - They do not affect live shipments or the notifications sent to receivers by DPD. - The receiving URL must be publicly accessible and configured to return an HTTP 200 OK status. ``` -------------------------------- ### Get Safe Place Options - Unauthorized Error Example Source: https://developers.api.dpd.co.uk/receiver-actions/v1/get-safe-place-options Example JSON response for an 'Unauthorized' error when calling the Get Safe Place Options endpoint. This indicates issues with the provided authorization token. ```json { "error": [ { "code": 102, "links": { "self": "/v1/customer/public/parcel/reference/safeplace/options" }, "errorCode": "auth/invalid-token", "status": 401, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707759438768, "type": "BusinessRule", "message": "The provided token is not a valid token.", "id": "28140bdccf01f669fba60f44fb3d15c7" } ] } ``` -------------------------------- ### Get Pickup Categories Source: https://developers.api.dpd.co.uk/pickup/introduction Retrieves a sample set of pickup categories from the sandbox environment for testing purposes. ```APIDOC ## GET /v1/customer/pickup/categories ### Description Retrieves a sample set of pickup categories from the sandbox environment. This is intended for testing purposes only. ### Method GET ### Endpoint /v1/customer/pickup/categories ### Parameters No specific parameters are documented for this endpoint in the provided text. ### Request Example ```json { "example": "GET /v1/customer/pickup/categories" } ``` ### Response #### Success Response (200) - **categories** (array) - An array of pickup category objects. - **categoryId** (string) - The ID of the category. - **categoryName** (string) - The name of the category. #### Response Example ```json { "example": "{\"categories\":[{\"categoryId\":\"1\",\"categoryName\":\"Standard\"}]}" } ``` ``` -------------------------------- ### Successful Response Example (JSON) Source: https://developers.api.dpd.co.uk/collections/v1/get-collection-dates Example of a successful JSON response from the 'Get Collection Dates' API. It returns an array of available collection dates, each with 'firstInArea', 'lastInArea', 'collectionCutOff', and 'date' fields. ```json { "data": [ { "firstInArea": "12:00", "lastInArea": "15:00", "collectionCutOff": "11:00", "date": "2024-09-13" }, { "firstInArea": "12:00", "lastInArea": "15:00", "collectionCutOff": "13:00", "date": "2024-09-16" } ] } ``` -------------------------------- ### Create Collection Request (JSON Example) Source: https://developers.api.dpd.co.uk/collections/introduction This JSON payload demonstrates a successful request to create a new collection. It is used in the sandbox environment to validate the request structure. Amendments to this example payload may result in errors in the sandbox. ```json { "error": [ { "code": 101, "links": { "self": "/v1/customer/collection" }, "status": 400, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1730718676008, "type": "Application", "message": "This is a sample error, please use the parameter examples provided on the portal to get a valid response", "id": "3d6b419454dd406e9688a025807039d8" } ] } ``` -------------------------------- ### Generate Access Token using API Key and Secret (Bash) Source: https://developers.api.dpd.co.uk/auth This snippet demonstrates how to generate an access token by encoding your API key and secret using Base64 and sending it in the Authorization header. It requires an active DPD/DPD Local account with an API key and secret pair. ```Bash KEY="key1234567890123456789" SECRET="secret9876543210987654321" # Concatenate key and secret with a colon CREDENTIALS="$KEY:$SECRET" # Encode credentials using Base64 ENCODED_CREDENTIALS=$(echo -n "$CREDENTIALS" | base64) # Make the API request curl -X POST https://api.dpd.co.uk/auth/token \ -H "Authorization: Basic $ENCODED_CREDENTIALS" \ -H "Content-Type: application/json" ``` -------------------------------- ### Retrieve Delivery Image with Format Parameter (API Example) Source: https://developers.api.dpd.co.uk/sender-actions/introduction Demonstrates how to request delivery images in either PNG or JPEG format by specifying the 'format' URL parameter. This allows testing the API's ability to return images in different encodings. ```HTTP https://developers.api.customers.dpd.co.uk/v1/customer/parcel/15501999987654*18635/image?imageKey=0069*12345*214*1234*71*001*0*1&imageType=S5&format=png https://developers.api.customers.dpd.co.uk/v1/customer/parcel/15501999987654*18635/image?imageKey=0069*12345*214*1234*71*001*0*1&imageType=S5&format=jpeg ``` -------------------------------- ### Unauthorized Error Response Example (JSON) Source: https://developers.api.dpd.co.uk/collections/v1/get-collection-dates Example of an 'Unauthorized' (401) error response. This typically occurs when authorization credentials are incorrect or invalid, providing an 'errorCode' and 'message'. ```json { "error": [ { "code": 102, "links": { "self": "/v1/customer/collection/collection-dates" }, "errorCode": "auth/invalid-token", "status": 401, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707759438768, "type": "BusinessRule", "message": "The provided token is not a valid token.", "id": "28140bdccf01f669fba60f44fb3d15c7" } ] } ``` -------------------------------- ### Forbidden Access Example (IP Restriction) Source: https://developers.api.dpd.co.uk/pickup/v1/get-pickup-categories-file Illustrates the response when a request is forbidden due to IP address restrictions. The response provides details about the business rule violation, indicating that the request originates from an unauthorized IP. ```json { "error": [ { "code": 102, "links": { "self": "/v1/customer/pickup/categories/file?fileType=pdf" }, "errorCode": "auth/failed-ip-match", "status": 403, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707482860362, "type": "BusinessRule", "message": "Request from invalid IP address", "id": "52e54b37a611d5d771c0fc14cfb834d9" } ] } ``` -------------------------------- ### Get Available Dates for Action - JSON Response Example Source: https://developers.api.dpd.co.uk/receiver-actions/v1/get-available-dates-for-action This code snippet demonstrates a successful JSON response from the 'Get Available Dates for Action' endpoint. It includes a 'data' object containing an array of available dates in 'YYYY-MM-DD' format. ```json { "data": { "dates": [ "2025-10-01", "2025-10-02", "2025-10-03", "2025-10-06", "2025-10-07" ] } } ``` -------------------------------- ### Forbidden Error Response Example (JSON) Source: https://developers.api.dpd.co.uk/collections/v1/get-collection-dates Example of a 'Forbidden' (403) error response. This indicates that IP restrictions are preventing the request from being processed, often due to an invalid IP address. ```json { "error": [ { "code": 102, "links": { "self": "/v1/customer/collection/collection-dates" }, "errorCode": "auth/failed-ip-match", "status": 403, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707482860362, "type": "BusinessRule", "message": "Request from invalid IP address", "id": "52e54b37a611d5d771c0fc14cfb834d9" } ] } ``` -------------------------------- ### Forbidden Error Response Example (JSON) Source: https://developers.api.dpd.co.uk/pickup/v1/get-pickup-location-by-address This JSON example illustrates a 'Forbidden' error response (403), typically occurring due to IP restrictions preventing the request from being processed. It contains similar fields to other errors, including an `errorCode` (e.g., 'auth/failed-ip-match'), status, timestamp, and a message indicating an invalid IP address. ```json { "error": [ { "code": 102, "links": { "self": "/v1/customer/pickup/location/address?postcode=B661BY&type=depot" }, "errorCode": "auth/failed-ip-match", "status": 403, "fieldName": "", "fieldPath": "", "displayType": "", "rule": "", "timestamp": 1707482860362, "type": "BusinessRule", "message": "Request from invalid IP address", "id": "52e54b37a611d5d771c0fc14cfb834d9" } ] } ```