Your browser does not support Java Script or javascript is disabled. Please ensure that your browser supports it for full compatibility with our services.

Create Shipment


Create Shipment

The "Create Shipment" service allows the user to create one shipment, that later can be part of an order nade up of multiple shipments. For now this functionality only applies to the DHL service called "Global Mail", that is available for shipments from Australia to anywhere. The functionality needs two requests - the first one creates shipments, the second one creates an order for shipments already created. 

Please be sure to  check collection data in the request. For "Global Mail" it needs to be specific data. Please use this service to obtain it: "Fetch Service Data".
For domestic orders please use "Create Order" functionality with Toll as a carrier.

Request

Orders
URI /shipments/
Method POST
Authorization
required

Parameters

Name
Required
Type
Description
shipment.transient_id
optional string Id returned with response, it allows distinguishing shipments
sihipment.service.code
required string Chosen service. Service codes can be obtained using this functionality: "Get Quote".
shipment.collection_type
required string Collection type.
shipment.collection
required/
optional
collection object Collection address data, required for "pickup" collection type.
shipment.collection.first_name
required string First name.
shipment.collection.last_name
required string Last name.
shipment.collection.company
optional string Company.
shipment.collection.email
required string Email address.
shipment.collection.phone
required string Phone number.
shipment.collection.country
required string - two letter country code Country code.
shipment.collection.postcode
required  string Post code.
shipment.collection.city
required string City.
shipmentcollection.address_lines
required  list of strings List containing collection address lines, first line is required and should be always present.
shipment.collection.pickup
required  pickup object Pick up information
shipment.collection.pickup.date
required  string - date in iso8601 format Pick up date
shipment.collection.pickup.time_earliest
required  string - time in iso8601 format Pick up earliest time
shipment.collection.pickup.time_latest
required  string - time in iso8601 format Pick up latest time
shipment.delivery
required delivery object Delivery address data
shipment.delivery.first_name
required string First name 
shipment.delivery.last_name
required string Last name 
shipment.delivery.company
optional string Company
shipment.delivery.email
required string Email address
shipment.delivery.phone
required string Phone number
shipment.delivery.country
required string - two letter country code Country code.
shipment.delivery.postcode
required  string Post code 
shipment.delivery.city
required string City 
shipment.delivery.address_lines
required  list of strings List containing delivery address lines, first line is required and should always be present. 
shipment.packages
required list of packages

List containing information concerning each package.

shipment.packages[].height
required decimal number Package height
shipment.packages[].width
required decimal number Package width
shipment.packages[].length
required decimal number Package length
shipment.packages[].weight
required decimal number Package weight
shipment.packages[].unit
required string - 'cm' or 'in' Measure/Weight unit, either 'cm' for centimetres and kilograms or 'in' for inches and pounds.
shipment.customs_information
required customs information object

Customs information.

shipment.customs_information.description
optional string Additional comments about shipment.
shipment.customs_information.reason
required string Reason for shipping. Possible values: Gift, Purchase, Sale, Sample, Return, Repair or Personal Effects.
shipment.customs_information.tax_status
required string Tax status: Private or Company.
shipment.customs_information.items
required list of items

List containing descriptions of items inside package.

shipment..customs_information.items[].description
required string Item Description
shipment..customs_information.items[].quantity
required integer number Quantity of particular item type.
shipment.customs_information.items[].value
required decimal number

Value of a single item. Values of all items can not exceed 7500 AUD.

shipment.customs_information.items[].currency
required string - three letter currency code Currency for value. For now we support only AUD.
shipment.customs_information.items[].madein
required string Country of manufacture
shipment.description
required string

Brief description of goods.

shipment.options.digital_signature
optional .png or .jpg in BASE64 code

Encoded image of digital signature, used during generation of documents.

 

Request body

 

{
    "request": {
            "shipment": {
                {
                    "transient_id""123",
                    "service": {
                        "code""7002"
                    },
                    "collection_type""pickup",
                    "collection": {
                        "first_name""Receiving",
                        "last_name""na",
                        "company""DHL Global Mail",
                        "email""contact@ship2anywhere.com",
                        "phone""61393282237",
                        "country""AU",
                        "postcode""2018",
                        "city""Rosebery",
                        "address_lines": [
                            "Unit 6, 809-821 Botany Road"
                        ],
                        "pickup": {
                            "date""2014-04-20",
                            "time_earliest""09:00",
                            "time_latest""14:00"
                        }
                    },
                    "delivery": {
                        "first_name""Foo",
                        "last_name""Bar",
                        "company""baz",
                        "email""foo.bar@baz.com",
                        "phone""123123123",
                        "country""US",
                        "postcode""20001",
                        "city""Washington",
                        "address_lines": [
                            "address line 1",
                            "address line 2",
                            "address line 3"
                        ]
                    },
                    "packages": [
                        {
                            "height"10,
                            "width"15,
                            "length"20,
                            "weight"3,
                            "unit""cm"
                        }
                    ],
                    "customs_information": {
                        "description""Additional comments.",
                        "reason""purchase",
                        "tax_status""company",
                        "items": [
                            {
                                "description""shoes",
                                "quantity"1,
                                "value"20,
                                "currency""AUD",
                                "madein""US"
                            }
                        ]
                    },
                    "description""Brief desciption"
                }
            
        
    }
}

 

Note

You can use the same JSON carrier service object as the one returned in the API response form quote service. However, there are two things the order service will take into account: service code and options.

Response

 

{
    "message": "OK",
    "code": 200,
    "result": {
        "shipment": {
            "status": "NEW",
            "delivery": {
                "phone": "123123123",
                "first_name": "Foo",
                "last_name": "Bar",
                "postcode": "20001",
                "city": "Washington",
                "country": "US",
                "company": "baz",
                "address_lines": [
                    "address line 1",
                    "address line 2",
                    "address line 3"
                ],
                "email": "foo.bar@baz.com"
            },
            "collection_type": "pickup",
            "description": "Brief description",
            "service": {
                "price": {
                    "currency": "AUD",
                    "amount": 51.7,
                    "total": 51.7,
                    "insurance": 0,
                    "gst": 0
                },
                "code": "7002",
                "name": "GlobalMail"
            },
            "transient_id": "123",
            "customs_information": {
                "tax_status": "Company",
                "reason": "Purchase",
                "description": "Additional comments.",
                "items": [
                    {
                        "currency": "AUD",
                        "madein": "AU",
                        "description": "shoes",
                        "value": 20,
                        "quantity": 1
                    }
                ]
            },
            "packages": [
                {
                    "width": 15,
                    "length": 20,
                    "unit_weight": "CM",
                    "weight": 3,
                    "height": 10
                }
            ],
            "id": "S2AS001639",
            "collection": {
                "phone": "61393282237",
                "first_name": "Receiving",
                "last_name": "na",
                "postcode": "2018",
                "city": "Rosebery",
                "country": "AU",
                "company": "DHL Global Mail",
                "address_lines": [
                    "Unit 6, 809-821 Botany Road",
                    "",
                    ""
                ],
                "pickup": {
                    "date": "2014-04-20T00:00:00",
                    "time_latest": "14:00",
                    "time_earliest": "09:00"
                },
                "email": "contact@ship2anywhere.com"
            }
        }
    }
}

 

Response from a 'Create Shipment' contains the shipment id. For GM Australia to anywhere in response there is also exact price for shipment.

After you've created all the shipments that you wish to send, you have to create order using this method: Combine Shipments.