Meta API Live shipment call and response

  1. General

    The shipment service is used to generate parcel labels. A request to the shipment service will only succeed after a call to the login service to get a unique token to access the shipment service. The token will be valid 24 hours. Please store it for that time.

    For other services and products, choose the corresponding topic in the navigation to the right.

    When a ShipmentService request is successful, the system will respond with a Base64 string that can be decoded into a PDF with a label as well as the corresponding 14 digit parcel number.
    Please take note that once a live label is created, it needs to be used and the corresponding parcel needs to be given to DPD within the next 48 hours

    The example below is a basic call, but you can find all possible parameters and fields in detail on the Swagger page.

    CALL

    Method:

    • POST

    URL:

    Parameters:

    • LabelPrintFormat PDF / ZPL
    • LabelPaperFormat A6 / A4
    • LabelPrinterStartPosition LOWER_LEFT / UPPER_LEFT / LOWER_RIGHT / UPPER_RIGHT
    • debug                                true

    Authorization:

    • X_DPD_TOKEN Bearer Token from login service (326-digits)
  2. B2B

    CALL

    Body:     

    • Object JSON (raw)
    [
    {
    "shipmentInfos": {
    "productCode": "101"
    },
    "numberOfParcels": "1",
    "sender": {
    "address": {
    "name1": "Sender name 1",
    "name2": " Sender name 2",
    "country": "BE",
    "zipCode": "2800",
    "city": "Mechelen",
    "street": "Egide Walschaertstraat 20"
    }
    },
    "receiver": {
    "address": {
    "name1": "DPD Hub",
    "country": "BE",
    "zipCode": "1800",
    "city": "Vilvoorde",
    "street": "Tyraslaan"
    },
    "contact": {
    "contactPerson": "Mrs Mdm",
    "email": "contact@dpd.be"
    },
    "comment": "TEST for META API"
    },
    "parcel": [
    {
    "parcelInfos": {
    "weight": "5000"
    }
    }
    ]
    }
    ]

    RESPONSE

    Body:

    • shipmentID MPSID
    • parcelId Labelnumbers
    • label – base64Data string converting to PDF or ZPL
  3. Return

    CALL

    Body:   

    • Object JSON (raw)
    [
    {
    "shipmentInfos": {
    "productCode": "332"
    },
    "numberOfParcels": "1",
    "sender": {
    "address": {
    "name1": "Sender name 1",
    "name2": " Sender name 2",
    "country": "BE",
    "zipCode": "2800",
    "city": "Mechelen",
    "street": "Egide Walschaertstraat 20"
    }
    },
    "receiver": {
    "address": {
    "name1": "DPD Hub",
    "country": "BE",
    "zipCode": "1800",
    "city": "Vilvoorde",
    "street": "Tyraslaan"
    },
    "contact": {
    "contactPerson": "Mrs Mdm",
    "email": "contact@dpd.be"
    },
    "comment": "TEST for META API"
    },
    "parcel": [
    {
    "parcelInfos": {
    "weight": "5000"
    }
    }
    ]
    }
    ]
    

     

    RESPONSE

    Body:

    • shipmentID MPSID
    • parcelId Labelnumbers
    • label – base64Data string converting to PDF or ZPL
  4. B2C Home

    B2C Home implies the use of a Predict message. This message will notify the receiver that a parcel is underway. You will have to add a messages segment to your call, as shown below.

    The messages segment has 3 possible fields:

    • messageType: can be either EMAIL if you want the Predict to be an email or SMS if you want it to be an text message. Mandatory field.
    • messageDestination: should be the receiver’s email address (if Type is EMAIL) or phone number (if Type is SMS). Please note using an email address here when the Type is SMS won’t work and vice versa. Mandatory field.
    • messageLanguage: The language in which the Predict message should be sent in ISO639-1 format: FR, NL, EN, etc. Keep in mind that while BE is a correct country code, BE as a language doesn’t exist. It should be one of the country languages or EN.

    CALL

    Body:   

    • Object JSON (raw)
    [
        {
            "shipmentInfos": {
                "productCode": "327"
            },
            "numberOfParcels": "1",
            "sender": {
                "address": {
                    "name1": "Sender name 1",
                    "name2": "Sender name 2",
                    "country": "BE",
                    "zipCode": "2800",
                    "city": "Mechelen",
                    "street": "Egide Walschaertstraat 20"
                }
            },
            "receiver": {
                "address": {
                    "name1": "DPD Hub",
                    "country": "BE",
                    "zipCode": "1800",
                    "city": "Vilvoorde",
                    "street": "Tyraslaan"
                },
                "contact": {
                    "contactPerson": "Mrs X",
                    "email": "test@dpdgroup.com"
                },
                "comment": "RMP TEST for META API"
            },
            "parcel": [
                {
                    "parcelInfos": {
                        "weight": "6000"
                    },
                    "messages": [
                        {
                            "messageType": "EMAIL",
                            "messageDestination": "test@dpdgroup.com"
                        }
                    ],
                    "senderParcelRefs": [
                        "P_2022-02-09_04"
                    ]
                }
            ]
        }
    ]
    

    RESPONSE

    Body:

    • shipmentID MPSID
    • parcelId Labelnumbers
    • label – base64Data string converting to PDF or ZPL
  5. B2C Shop

    Please note that B2C Shop also needs a messages segment.

    CALL

    Body:

    • Object JSON (raw)
    [
        {
            "customerReferenceNumbers": [
                "S_2022-02-09_09"
            ],
            "shipmentInfos": {
                "productCode": "337"
          },
            "sender": {
                "address": {
                    "name1": "DPD BE SENDER",
                    "street": "Egide Walschaertsstraat 20",
                    "country": "BE",
                    "zipCode": "2800",
                    "city": "Mechelen"
                }
            },
            "receiver": {
                "pudoId": "BE10002",
                "address": {
                    "name1": "DPD BE RECEIVER",
                    "street": "Rue de Liege 25",
                    "country": "BE",
                    "zipCode": "6180",
                    "city": "Courcelles"
                },              
                "contact": {
                    "phone1": "0123456789",
                    "email": "test@dpdgroup.com",
                    "contactPerson":"DPD Contact"
                }
            },
            "numberOfParcels": "1",
            "parcel": [
                {
                    "parcelInfos": {
                        "weight": "6000"
                    },
                    "messages": [{
                        "messageType": "SMS",
                        "messageDestination": "0123456789"
                    }],
                    "senderParcelRefs": [
                        "P_2022-02-09_09"
                    ]
                }
            ]
        }
    ]
    

    RESPONSE

    Body:

    • shipmentID MPSID
    • parcelId Labelnumbers
    • label – base64Data string converting to PDF or ZPL
  6. Express / B2B Predict

    By changing the product code and adding the mandatory fields to a standard B2B call, the request changes accordingly.

    Please note that for Express 10, 12 and 18, contact details (name and email) become mandatory for the recipient. You can find a full example below.

    • For Express 10, use productcode 179
    • For Express 12, use productcode 225
    • For Express 18, use productcode 155
    • For B2B Predict, use productcode 101 as if you were making a regular B2B shipment, but you will need to add a messages segment the same way as you’d do for a B2C Home shipment (see above)

    CALL (EXPRESS 10)

    Body:

    [
    {
    "customerReferenceNumbers": [
    "S_2022-04-29_01"
    ],
    "shipmentInfos": {
    "productCode": "179"
    },
    "sender": {
    "address": {
    "name1": "DPD BE SENDER",
    "street": "Egide Walschaertsstraat 20",
    "country": "BE",
    "zipCode": "2800",
    "city": "Mechelen"
    },
    "contact": {
    "phone1": "0123456789",
    "email": "test@dpdgroup.com",
    "contactPerson": "DPD Contact"
    }
    },
    "receiver": {
    "address": {
    "name1": "DPD BE RECEIVER",
    "street": "Rue de Liege 25",
    "country": "BE",
    "zipCode": "6180",
    "city": "Courcelles"
    },
    "contact": {
    "phone1": "0123456789",
    "email": "test@dpdgroup.com",
    "contactPerson": "DPD Contact"
    }
    },
    "numberOfParcels": "1",
    "parcel": [
    {
    "parcelInfos": {
    "weight": "2000"
    },
    "senderParcelRefs": [
    "P_2022-04-29_01"
    ]
    }
    ]
    }
    ]
Was this post helpful?(Required)