Shipment Create

Allows customers to create a new shipment. Required fields are in bold text.

Access

To get access to this API, please fill in the Developer Registration form

Resource URI

Make an HTTP POST request to:

EnvironmentURL 
LIVE https://api.mainfreight.com/transport/1.0/customer/shipment?region={region}
UAT https://apitest.mainfreight.com/transport/1.0/customer/shipment?region={region}

Resource Information

TypeValue 
Authentication API Key  
Response Formats JSON / XML  
HTTP Methods POST  
API Version 1.0  

HTTP Headers

You must add the following HTTP Headers to your request:

HeaderDescriptionTypeRequired
Content-Type Request content type. Supported types are "application/json" or "application/xml" string Yes
Authorization

The word " Secret" followed by a space, then your unique API key

e.g: Secret wdnOId93-VXZECxvVRPQEJZNxPB5XZ...

string Yes
Accept

Result content type. Supported types are "application/json" or "application/xml"

string No

Parameters

You must provide the parameters marked as required:

 

HTTP Request Parameters

HeaderDescriptionTypeRequired
region

Region code, a list of available regions can be found here

string Yes

Request Body

FieldDescriptionTypeLengthRequired
account Account involved in the shipment object   Yes
code Shorthand code to identify the account string 50 Yes
housebillNumber A reference that identifies the shipment string 50  Yes
serviceLevel An entity used to express the duration of transportation (available codes can be found  here) object   Yes
code Shortland code to identify the service level string 50 Yes
transportMode A term used to distinguish between different ways of transportation of goods (available codes can be found  here) string 50 Yes
freightTerms An entity used to express how the shipment starts and ends (available codes can be found  here) string 50 Yes
routingType An entity used to express the optimal carrier and mode to ship a shipment (available codes can be found  here) string 50 Yes
systemOfMeasurement What measurement type the units are specified on the shipment (available codes can be found  here) string 50  
origin Defines the specifics of the starting point of the shipment object   Yes
sender The owner of the goods that need to be shipped object   Yes
code Shortland code of the sender string 50  
name Full name of the sender string 200  
address Physical address object   Yes
premises Indicates a named location, usually a building or collection of buildings with a common name string 200  
streetNumber Indicates a street number string 20  
address1 Indicates a street name string 200  
address2 Indicates other address identifiers string 200  
residential Indicates whether a residential address boolean    
suburb Indicates the suburb string 500 Yes
postCode Indicates the postcode string 10 Yes (AU) 
town Indicates the town string 50  
city Indicates the city/place string 50 Yes
stateCode Shorthand code to identify the state string 50 Yes (AU)  
countryCode Shorthand code to identify the country (available codes can be found  here) string 50  
geometry Contains GPS location information object    
location Contains the geocoded latitude, longitude value object    
latitude Latitude value decimal    
longitude Longitude value decimal    
contact Contact point for sender object    
name Full name of the contact string 200  
phone Phone number of the contact string 150  
phoneExtension Phone number extension of the contact string 20  
emailAddress Email address of the contact string 200  
pickupTime Indicates pickup time information for sender object   Yes
fromDateTime

The from date time of the pickup

Required format: yyyy-MM-ddThh:mm:ss

dateTime    
toDateTime

The end date time of the pickup

Required format: yyyy-MM-ddThh:mm:ss

dateTime   Yes
referenceNumber Indicates reference corresponding to the sender string 50  
instructions Indicates an instruction note corresponding to the sender string 200  
destination Defines the specifics of the ending point of the shipment object   Yes
receiver The party who physically receives the goods object   Yes
name Full name of the receiver string 200  
address Physical address object   Yes
premises Indicates a named location, usually a building or collection of buildings with a common name string 200  
streetNumber Indicates a street number string 20  
address1 Indicates a street name string 200  
address2 Indicates other address identifiers string 200  
residential Indicates whether a residential address boolean    
suburb Indicates the suburb string 50 Yes
town Indicates the postcode string 10  
postCode Indicates the town string

50

Yes (AU)
city Indicates the city/place string 50 Yes
stateCode Shorthand code to identify the state string 50 Yes (AU) 
countryCode Shorthand code to identify the country (available codes can be found  here) string 50  
geometry Contains GPS location information object    
location Contains the geocoded latitude, longitude value object    
latitude Latitude value decimal    
longitude Longitude value decimal    
contact Contact point for receiver object    
name Full name of the contact string 200  
phone Phone number of the contact string 150  
phoneExtension Phone number extension of the contact string 20  
emailAddress Email address of the contact string 200  
deliveryTime Indicates delivery time information for receiver object    
toDateTime

The end date time of the delivery time

Required format: yyyy-MM-ddThh:mm:ss

dateTime    
referenceNumber Indicates reference corresponding to the receiver string 50  
instructions Indicates an instruction note corresponding to the receiver string 500  
freightDetails Defines information about types and dimensions of goods shipped on this shipment array of objects   Yes
freightDetail Defines a single goods line of all goods on the shipment object   Yes
ssccNumber Serial Shipping Container Code can be used to identify a logistic unit string 18  
customerItemNumber Customer Unique Item Number string 50  
packTypeCode Shorthand code identifying the type of goods on the freight line (available codes can be found  here) string 50 Yes
description Description of the goods on the freight line string 200  
weight Physical weight of the goods on the freight line integer    
volume Physical volume of the goods on the freight line decimal    
length Length of goods on the freight line decimal    
width Width of goods on the freight line decimal    
height Height of goods on the freight line decimal    
stackable Whether the goods on the freight line can be stacked boolean    
freightClass Freight classification code string 50  
foodGrade Whether the freight line satisfy the classification of highest standard of internal cleanliness boolean    
itemLines Further breakdown of freight line (Said to Contain) array of objects    
itemLine One single Item line object    
units Units integer    
packTypeCode Shorthand code identifying the type of goods on the item line (available codes can be found  here) string 50  
description Description of the goods on the item line string 500  
dangerousGoodsLines Identification of materials or items with hazardous properties array of objects    
dangerousGoodsLine Identifies one line of dangerous goods (DG) object    
class Classification of DG Class string 50  
unNumber A four-digit code used to identify hazardous materials and articles string 50  
variant Identify variant of DG string 50  
properName Identification of proper name of DG string 255  
technicalName Identification of technical name of DG string 255  
commonName Identification of common name of DG string 50  
subRisk Identification of hazards referred to as Subsidiary Risks string 50  
tertiarySubRisk Another breakdown of sub risk string 50  
hazChem hazardous chemicals string 50  
packingGroup Packing group indicates the degree of danger string 50  
flashPoint In Centigrade string 50  
additionalInfo Additional notes associated with DG string 255  
packageType How DG is contained string 50  
packageInstruction Instructions regarding package string 50  
marinePollutant Whether DG is a Marine Pollutant boolean    
acid Whether DG is acidic boolean 50  
alkali Whether DG is alkali boolean 50  
grossWeight Physical weight of the goods on the DG line integer    
volume Physical volume of the goods on the DG line decimal    
units Units of DG line integer    
description Description of the goods on the DG line string    
hireLines Define information about Hire on the shipment array of objects    
hireLine Identifies one line of hire object    
supplier Supplier of hire (available codes can be found  here) string 50  
palletType Type of pallet (available codes can be found  here) string 50  
toAccount To account of hire string 50  
fromAccount From account of hire string 50  
transactionType Transaction type of hire (available codes can be found  here) string 50  
quantity Quantity of pallets of hire integer    
references Reference types that goes against the shipment array of objects    
reference Single reference type line object    
type Shorthand code of reference type string 50  
value Reference value string 50  
notes Note type that goes against the shipment array of objects    
note Single note type line object    
type Shorthand code of note type string 50  
value Note value string 255  
dangerousGoodsSignatory Identifier party responsible for signing for DG object    
name Name of person string 200  
title Title of person string 10  
location Location of person string 50  
signature Name on signature string 200  
emergencyPhone Phone number of person string 150  
cover Identifies Cover related information object    
insuredType Type of Insurance (available codes can be found  here) string 50  
insuredValue Value of Insurance decimal    
declaredValue The amount stated to be the value of cover decimal    
notifications Identifies a list of notifications to be subscribed array of objects    
transport Identifies the notification transport object    
code Shorthand code identifying the transport code (available codes can be found  here) string 50  
destination Delivery destination of transport string 255  
events List of events array of objects    
event Identifies the event object    
code Shorthand code that identifies the notification event (available codes can be found  here) string 50  

Response Body

FieldDescriptionTypeLength 
id Identifier that can be used to update and delete this shipment string    
account Account involved in the shipment object   Yes
code Shorthand code to identify the account string 50 Yes
housebillNumber A reference that identifies the shipment string 50  Yes
serviceLevel An entity used to express the duration of transportation (available codes can be found  here) object   Yes
code Shortland code to identify the service level string 50 Yes
transportMode A term used to distinguish between different ways of transportation of goods (available codes can be found  here) string 50 Yes
freightTerms An entity used to express how the shipment starts and ends (available codes can be found  here) string 50 Yes
routingType An entity used to express the optimal carrier and mode to ship a shipment (available codes can be found  here) string 50 Yes
systemOfMeasurement What measurement type the units are specified on the shipment (available codes can be found  here) string 50  
origin Defines the specifics of the starting point of the shipment object   Yes
sender The owner of the goods that need to be shipped object   Yes
code Shortland code of the sender string 50  
name Full name of the sender string 200  
address Physical address object   Yes
premises Indicates a named location, usually a building or collection of buildings with a common name string 200  
streetNumber Indicates a street number string 20  
address1 Indicates a street name string 200  
address2 Indicates other address identifiers string 200  
residential Indicates whether a residential address boolean    
suburb Indicates the suburb string 50 Yes
postCode Indicates the postcode string 10  Yes (AU)
town Indicates the town string 50  
city Indicates the city/place string 50 Yes
stateCode Shorthand code to identify the state string 50 Yes (AU) 
countryCode Shorthand code to identify the country (available codes can be found  here) string 50  
contact Contact point for sender object    
name Full name of the contact string 200  
phone Phone number of the contact string 150  
phoneExtension Phone number extension of the contact string 20  
emailAddress Email address of the contact string 200  
pickupTime Indicates pickup time information for sender object   Yes
toDateTime The end date time of the pickup time dateTime   Yes
destination Defines the specifics of the ending point of the shipment object   Yes
receiver The party who physically receives the goods object   Yes
name Full name of the receiver string 200  
address Physical address object   Yes
premises Indicates a named location, usually a building or collection of buildings with a common name string 200  
streetNumber Indicates a street number string 20  
address1 Indicates a street name string 200  
address2 Indicates other address identifiers string 200  
residential Indicates whether a residential address boolean    
suburb Indicates the suburb string 50 Yes
town Indicates the postcode string 10  
postCode Indicates the town string 50  Yes (AU)
city Indicates the city/place string 50 Yes
stateCode Shorthand code to identify the state string 50 Yes (AU) 
countryCode Shorthand code to identify the country (available codes can be found  here) string 50  
contact Contact point for receiver object    
name Full name of the contact string 200  
phone Phone number of the contact string 150  
phoneExtension Phone number extension of the contact string 20  
emailAddress Email address of the contact string 200  
deliveryTime Indicates delivery time information for receiver object   Yes
toDateTime The end date time of the delivery time dateTime   Yes

Code samples

JSON Example

To Generate a Shipment in JSON format you will need to POST a JSON object:

  • URL
< > grab code
https://api.mainfreight.com/transport/1.0/customer/shipment?region=NZ

You are going to send a JSON object similar to this:

  • REQUEST JSON
< > grab code
{
    "account": {
        "code": "{YOUR_ACCOUNT_CODE}"
    },
    "housebillNumber": "{YOUR_HOUSEBILLNUMBER}",
    "serviceLevel": {
        "code": "LCL"
    },
    "transportMode": "ROAD",
    "freightTerms": "D2D",
    "routingType": "LCL",
    "systemOfMeasurement": "Metric",
    "origin": {
        "sender": {
            "code": null,
            "name": "TEST SENDER"
        },
        "address": {
            "premises": null,
            "streetNumber": "42",
            "address1": "O'Rorke Road",
            "address2": null,
            "residential": false,
            "suburb": "Penrose",
            "postCode": "1061",
            "town": null,
            "city": "Auckland",
            "stateCode": null,
            "countryCode":"NZ",
            "geometry": {
                "location": {
                    "latitude": null,
                    "longitude": null
                }
            }
        },
        "contact": {
            "name": "John Doe",
            "phone": "+64 000 000000",
            "phoneExtension": "856",
            "emailAddress": "example@email.com"
        },
        "pickupTime": {
            "fromDateTime": "2023-06-18T09:00:00"
            "toDateTime": "2023-06-18T09:00:00"
        },
        "referenceNumber": "OriginReferenceNumber",
        "instructions": "Origin Instructions"
    },
    "destination": {
        "receiver": {
            "name": "TEST RECEIVER"
        },
        "address": {
            "premises": null,
            "streetNumber": "21",
            "address1": "Hayton Road",
            "address2": null,
            "residential": false,
            "suburb": "Wigram",
            "postCode": "8042",
            "town": null,
            "city": "Christchurch",
            "stateCode": null,
            "countryCode": "NZ",
            "geometry": {
                "location": {
                    "latitude": -43.542202,
                    "longitude": 172.558036
                }
            }
        },
        "contact": {
            "name": "Jim Doe",
			"phone": "+64 000 000000",
            "phoneExtension": "856",
            "emailAddress": "example@email.com"
        },
        "referenceNumber": "DestinationReferenceNumber",
        "instructions": "Destination Instructions"
    },
    "freightDetails": [{
            "ssccNumber": "123456789012345678",
            "customerItemNumber": "TEST1111",
            "packTypeCode": "Bag",
            "description": "These are the goods",
            "weight": 50,
            "volume": 0.5,
            "length": 0.2,
            "width": 0.25,
            "height": 0.15,
            "stackable": true,
            "freightClass": "100",
            "foodGrade": false,
            "itemLines": [{
                    "units": 100,
                    "packTypeCode": "CTN",
                    "description": "These are the detailed descriptions of the goods",
                    "dangerousGoodsLines": [{
                            "class": "3",
                            "unNumber": "1123",
                            "variant": "1",
                            "properName": "Butyl",
                            "technicalName": "Desmoph",
                            "commonName": "Desmoph",
                            "subRisk": "1",
                            "tertiarySubRisk": "2",
                            "hazChem": "3[Y]",
                            "packingGroup": "III",
                            "flashPoint": "52",
                            "additionalInfo": "Do not store in dir",
                            "packageType": "Metal Drum",
                            "packageInstruction": "DangerousGoodsLine PackageInstruction",
                            "marinePollutant": false,
                            "acid": false,
                            "alkali": false,
                            "grossWeight": 10,
                            "volume": 0.2,
                            "units": 2,
                            "description": "DangerousGoodsLine Description"
                        }
                    ]
                }
            ],
            "hireLines": [{
                    "supplier": "C",
                    "palletType": "B",
                    "toAccount": "0000000000",
                    "fromAccount": "111111111",
                    "transactionType": "T",
                    "quantity": 10
                }
            ]
        }
    ],
    "references": [{
            "type": "ReceiverReference",
            "value": "ReceiverReference"
        }, {
            "type": "SenderReference",
            "value": "SenderReference"
        }
    ],
    "dangerousGoodsSignatory": {
        "name": "Example DG",
        "title": "Dispatch",
        "location": "160 Plank Ave",
        "signature": "Example DG",
        "emergencyPhone": "6400000000"
    },
    "cover": {
        "insuredType": "DV",
        "insuredValue": 1000.00,
        "declaredValue": 1000.00
    },
	"notifications": [{
			"eventTypeCode": "StatusUpdate",
			"transport": {
				"code": "Email",
				"destination": "noemail@mainfreight.com"
			},
			"events": [{
					"code": "StatusUpdateShipmentPODReceived"
				}
			]
		}
	]
}


You are going get another JSON object similar to this:

  • RESPONSE JSON
< > grab code
{
    "id": "4438CF5B-DD3D-441B-B76D-24AABCA73A71",
    "account": {
        "code": "{YOUR_ACCOUNT_CODE}"
    },
    "housebillNumber": "{YOUR_HOUSEBILLNUMBER}",
    "shipmentNumber": "01031111182",
    "serviceLevel": {
        "code": "LCL"
    },
    "transportMode": "ROAD",
    "freightTerms": "D2D",
    "routingType": "LCL",
    "systemOfMeasurement": "metric",
    "origin": {
        "sender": {
            "name": "TEST SENDER"
        },
        "address": {
            "streetNumber": "42",
            "address1": "O'Rorke Road",
            "residential": false,
            "suburb": "PENROSE",
            "city": "AUCKLAND",
            "stateCode": "NI",
            "countryCode": "NZ"
        },
        "contact": {
            "name": "John Doe",
            "phone": "+64 000 000000",
            "phoneExtension": "856",
            "emailAddress": "example@email.com"
        },
        "appointment": {},
        "pickupTime": {
            "timeslot": false,
            "fromDateTime": "2023-06-18T09:00:00"
            "toDateTime": "2023-06-18T09:00:00"
        },
        "extras": [],
        "accessorials": []
    },
    "destination": {
        "receiver": {
            "name": "TEST RECEIVER"
        },
        "address": {
            "streetNumber": "21",
            "address1": "Hayton Road",
            "residential": false,
            "suburb": "WIGRAM",
            "city": "CHRISTCHURCH",
            "stateCode": "SI",
            "countryCode": "NZ"
        },
        "contact": {
            "name": "Jim Doe",
            "phone": "+64 000 000000",
            "phoneExtension": "856",
            "emailAddress": "example@email.com"
        },
        "appointment": {},
        "deliveryTime": {
            "timeslot": false,
            "toDateTime": "2023-06-26T17:00:00"
        },
        "extras": [],
        "accessorials": []
    }
}

XML Example

To Generate a Shipment in XML format, you will need to POST XML object.

  • URL
< > grab code
https://api.mainfreight.com/transport/1.0/customer/shipment?region=NZ

You are going to send an XML document similar to this:

  • XML REQUEST
< > grab code
<shipment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <account>
        <code>{YOUR_ACCOUNT_CODE}</code>
    </account>
    <housebillNumber>{YOUR_HOUSEBILLNUMBER}</housebillNumber>
    <serviceLevel>
        <code>LCL</code>
    </serviceLevel>
    <transportMode>ROAD</transportMode>
    <freightTerms>D2DP</freightTerms>
    <routingType>LCL</routingType>
    <systemOfMeasurement>Metric</systemOfMeasurement>
    <origin>
        <sender>
            <code>TESTSENDER</code>
            <name>Test Sender</name>
        </sender>
        <address>
            <premises xsi:nil="true"/>
            <streetNumber>42</streetNumber>
            <address1>O'Rorke Road</address1>
            <address2 xsi:nil="true"/>
            <residential>false</residential>
            <suburb>Penrose</suburb>
            <postCode>1061</postCode>
            <town xsi:nil="true"/>
            <city>Auckland</city>
            <stateCode xsi:nil="true"/>
            <countryCode>NZ</countryCode>
            <geometry>
                <location>
                    <latitude>-36.914914</latitude>
                    <longitude>174.817803</longitude>
                </location>
            </geometry>
        </address>
        <contact>
            <name>John Doe</name>
            <phone>+64 000 000000</phone>
            <phoneExtension>856</phoneExtension>
            <emailAddress>example@email.com</emailAddress>
        </contact>
        <pickupTime>
            <fromDateTime>2023-05-18T09:00:00</fromDateTime>
            <toDateTime>2023-05-18T09:00:00</toDateTime>
        </pickupTime>
        <referenceNumber>OriginReferenceNumber</referenceNumber>
        <instructions>Origin Instructions</instructions>
    </origin>
    <destination>
        <receiver>
            <name>Test Receiver</name>
        </receiver>
        <address>
            <premises xsi:nil="true"/>
            <streetNumber>21</streetNumber>
            <address1>Hayton Road</address1>
            <address2 xsi:nil="true"/>
            <residential>false</residential>
            <suburb>Wigram</suburb>
            <postCode>8042</postCode>
            <town xsi:nil="true"/>
            <city>Christchurch</city>
            <stateCode xsi:nil="true"/>
            <countryCode>NZ</countryCode>
            <geometry>
                <location>
                    <latitude>-43.542202</latitude>
                    <longitude>172.558036</longitude>
                </location>
            </geometry>
        </address>
        <contact>
            <name>John Doe</name>
            <phone>+64 000 000000</phone>
            <phoneExtension>856</phoneExtension>
            <emailAddress>example@email.com</emailAddress>
        </contact>
        <referenceNumber>Destination Reference Number</referenceNumber>
        <instructions>Destination Instructions</instructions>
    </destination>
    <freightDetails>
        <freightDetail>
            <ssccNumber>1111</ssccNumber>
            <customerItemNumber>TEST1111</customerItemNumber>
            <packTypeCode>Bag</packTypeCode>
            <description>These are the goods</description>
            <weight>50</weight>
            <volume>0.5</volume>
            <length>0.2</length>
            <width>0.25</width>
            <height>0.15</height>
            <stackable>true</stackable>
            <nationalMotorFreightClassification>123456-78</nationalMotorFreightClassification>
            <freightClass>100</freightClass>
            <foodGrade>false</foodGrade>
            <itemLines>
                <itemLine>
                    <units>100</units>
                    <packTypeCode>CTN</packTypeCode>
                    <description>These are the detailed descriptions of the goods</description>
                    <dangerousGoodsLines>
                        <dangerousGoodsLine>
                            <class>3</class>
                            <unNumber>1123</unNumber>
                            <variant>1</variant>
                            <properName>Butyl</properName>
                            <technicalName>Desmoph</technicalName>
                            <commonName>Desmoph</commonName>
                            <subRisk>1</subRisk>
                            <tertiarySubRisk>2</tertiarySubRisk>
                            <hazChem>3[Y]</hazChem>
                            <packingGroup>III</packingGroup>
                            <flashPoint>52</flashPoint>
                            <additionalInfo>Do not store in dir</additionalInfo>
                            <packageType>Metal Drum</packageType>
                            <packageInstruction>DangerousGoodsLine PackageInstruction</packageInstruction>
                            <marinePollutant>false</marinePollutant>
                            <acid>false</acid>
                            <alkali>false</alkali>
                            <grossWeight>10</grossWeight>
                            <volume>0.2</volume>
                            <units>2</units>
                            <description>DangerousGoodsLine Description</description>
                        </dangerousGoodsLine>
                    </dangerousGoodsLines>
                </itemLine>
            </itemLines>
            <hireLines>
                <hireLine>
                    <supplier>C</supplier>
                    <palletType>B</palletType>
                    <toAccount>0000000000</toAccount>
                    <fromAccount>111111111</fromAccount>
                    <transactionType>T</transactionType>
                    <quantity>10</quantity>
                </hireLine>
            </hireLines>
        </freightDetail>
    </freightDetails>
    <references>
        <reference>
            <type>ReceiverReference</type>
            <value>ReceiverReference</value>
        </reference>
        <reference>
            <type>SenderReference</type>
            <value>SenderReference</value>
        </reference>
    </references>
    <dangerousGoodsSignatory>
        <name>Example DG</name>
        <title>Dispatch</title>
        <location>160 Plank Ave</location>
        <signature>Example DG</signature>
        <emergencyPhone>6402112345</emergencyPhone>
    </dangerousGoodsSignatory>
    <notifications>
        <notification>
            <transport>
                <code>Email</code>
                <destination>example@email.com</destination>
            </transport>
            <events>
                <event>
                    <code>StatusUpdateShipmentPODReceived</code>
                </event>
            </events>
        </notification>
    </notifications>
</shipment>

 

You are going to get an XML document similar to this:

  • XML RESPONSE
< > grab code
 
 
<shipment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<id>2A77498C-05FA-4298-BB06-13BC3DD59156</id>
	<account>
		<code>{YOUR_ACCOUNT_CODE}</code>
	</account>
	<housebillNumber>01NZ0000000</housebillNumber>
	<serviceLevel>
		<code>LCL</code>
	</serviceLevel>
	<transportMode>ROAD</transportMode>
	<freightTerms>D2DP</freightTerms>
	<routingType>LCL</routingType>
	<systemOfMeasurement>metric</systemOfMeasurement>
	<origin>
		<sender>
			<name>DAILYFREIGHT DEPOT</name>
		</sender>
		<address>
			<streetNumber>42</streetNumber>
			<address1>O'Rorke Road</address1>
			<residential>false</residential>
			<suburb>PENROSE</suburb>
			<city>AUCKLAND</city>
			<stateCode>NI</stateCode>
			<countryCode>NZ</countryCode>
		</address>
		<contact>
			<name>John Doe</name>
			<phone>+64 220 012345</phone>
			<phoneExtension>856</phoneExtension>
			<emailAddress>example@email.com</emailAddress>
		</contact>
		<pickupTime>
			<fromDateTime>2023-05-18T09:00:00</fromDateTime>
			<toDateTime>2023-05-18T09:00:00</toDateTime>
		</pickupTime>
	</origin>
	<destination>
		<receiver>
			<name>MAINFREIGHT TRANSPORT</name>
		</receiver>
		<address>
			<streetNumber>21</streetNumber>
			<address1>Hayton Road</address1>
			<residential>false</residential>
			<suburb>WIGRAM</suburb>
			<city>CHRISTCHURCH</city>
			<stateCode>SI</stateCode>
			<countryCode>NZ</countryCode>
		</address>
		<contact>
			<name>John Doe</name>
			<phone>+64 221 012345</phone>
			<phoneExtension>856</phoneExtension>
			<emailAddress>example@email.com</emailAddress>
		</contact>
	</destination>
</shipment>
NOTE: Content in the panels below this point are not visible on the site unless used by other features e.g. gadgets, OB&E, etc.

API Sandbox

Create Shipment

POST
  • Authorization: Secret {apiKey}
  • Content-Type: application/json; charset=utf-8
{ "account": { "code": "{{accountCode}}" }, "housebillNumber": "{{housebillNumber}}", "serviceLevel": { "code": "{{serviceLevelCode}}" }, "transportMode": "{{transportMode}}", "freightTerms": "{{freightTerms}}", "routingType": "{{routingType}}", "systemOfMeasurement": "{{systemOfMeasurement}}", "origin": { "sender": { "code": "{{originOriginSenderCode}}", "name": "{{originOriginSenderName}}" }, "address": { "premises": "{{originAddressPremises}}", "streetNumber": "{{originAddressStreetNumber}}", "address1": "{{originAddressAddress1}}", "address2": "{{originAddressAddress2}}", "residential": false, "suburb": "{{originAddressSuburb}}", "postCode": "{{originAddressPostCode}}", "town": "{{originAddressTown}}", "city": "{{originAddressCity}}", "stateCode": "{{originAddressStateCode}}", "countryCode": "{{originAddressCountryCode}}", "geometry": { "location": { "latitude": -43.542161, "longitude": 172.558158 } } }, "contact": { "name": "{{originContactName}}", "phone": "{{originContactPhone}}", "phoneExtension": "{{originContactPhoneExtension}}", "emailAddress": "{{originContactEmailAddress}}" }, "appointment": { "fromDateTime": "{{originAppointmentFromDateTime}}", "toDateTime": "{{originAppointmentToDateTime}}", "note": "{{originAppointmentNote}}" }, "pickupTime": { "timeslot": false, "fromDateTime": "{{originPickupTimeFromDateTime}}", "toDateTime": "{{originPickupTimeToDateTime}}" }, "serviceProvider": { "code": "{{originServiceProviderCode}}" }, "customs": { "broker": "{{originCustomsBroker}}", "parsCleared": "{{originCustomsParsCleared}}", "inBond": false }, "extras": [{ "service": "{{originExtrasCustomsService}}", "units": 10.0, "note": "{{originExtrasCustomsNote}}" } ], "referenceNumber": "{{originReferenceNumber}}", "instructions": "{{originInstructions}}", "ratingNote": "{{originRatingNote}}" }, "destination": { "receiver": { "code": "{{destinationReceiverCode}}", "name": "{{destinationReceiverName}}" }, "address": { "premises": "{{destinationAddressPremises}}", "streetNumber": "{{destinationAddressStreetNumber}}", "address1": "{{destinationAddressAddress1}}", "address2": "{{destinationAddressAddress2}}", "residential": false, "suburb": "{{destinationAddressSuburb}}", "postCode": "{{destinationAddressPostCode}}", "town": "{{destinationAddressTown}}", "city": "{{destinationAddressCity}}", "stateCode": "{{destinationAddressStateCode}}", "countryCode": "{{destinationAddressCountryCode}}", "geometry": { "location": { "latitude": -43.542161, "longitude": 172.558158 } } }, "contact": { "name": "{{destinationContactName}}", "phone": "{{destinationContactPhone}}", "phoneExtension": "{{destinationContactPhoneExtension}}", "emailAddress": "{{destinationContactEmailAddress}}" }, "appointment": { "fromDateTime": "{{destinationAppointmentFromDateTime}}", "toDateTime": "{{destinationAppointmentToDateTime}}", "note": "{{destinationAppointmentNote}}" }, "deliveryTime": { "timeslot": false, "fromDateTime": "{{destinationDeliveryTimeFromDateTime}}", "toDateTime": "{{destinationDeliveryTimeToDateTime}}" }, "serviceProvider": { "code": "{{destinationServiceProviderCode}}" }, "customs": { "broker": "{{destinationCustomsBroker}}", "parsCleared": "{{destinationCustomsParsCleared}}", "inBond": false }, "extras": [{ "service": "{{destinationExtrasService}}", "units": 10.0, "note": "{{destinationExtrasNote}}" } ], "referenceNumber": "{{destinationReferenceNumber}}", "instructions": "{{destinationInstructions}}", "ratingNote": "{{destinationRatingNote}}" }, "freightDetails": [{ "ssccNumber": "{{freightDetailsSsccNumber}}", "freightDetailNumber": "{{freightDetailsfreightDetailNumber}}", "packTypeCode": "{{freightDetailsPackTypeCode}}", "description": "{{freightDetailsDescription}}", "weight": null, "volume": 4.851, "length": 2.1, "width": 2.1, "height": 1.1, "stackable": true, "nationalMotorFreightClassification": "{{freightDetailsNationalMotorFreightClassification}}", "freightClass": "{{freightDetailsFreightClass}}", "foodGrade": false, "itemLines": [{ "units": 10, "packTypeCode": "{{freightDetailsItemLinesPackTypeCode}}", "description": "{{freightDetailsItemLinesDescription}}", "dangerousGoodsLines": [{ "class": "{{freightDetailsItemLinesDangerousGoodsLinesClass}}", "unNumber": "{{freightDetailsItemLinesDangerousGoodsLinesUnNumber}}", "variant": "{{freightDetailsItemLinesDangerousGoodsLinesVariant}}", "properName": "{{freightDetailsItemLinesDangerousGoodsLinesProperName}}", "technicalName": "{{freightDetailsItemLinesDangerousGoodsLinesTechnicalName}}", "commonName": "{{freightDetailsItemLinesDangerousGoodsLinesCommonName}}", "subRisk": "{{freightDetailsItemLinesDangerousGoodsLinesSubRisk}}", "tertiarySubRisk": "{{freightDetailsItemLinesDangerousGoodsLinesTertiarySubRisk}}", "hazChem": "{{freightDetailsItemLinesDangerousGoodsLinesHazChem}}", "packingGroup": "{{freightDetailsItemLinesDangerousGoodsLinesPackingGroup}}", "flashPoint": "{{freightDetailsItemLinesDangerousGoodsLinesFlashPoint}}", "additionalInfo": "{{freightDetailsItemLinesDangerousGoodsLinesAdditionalInfo}}", "packageType": "{{freightDetailsItemLinesDangerousGoodsLinesPackageType}}", "packageInstruction": "{{freightDetailsItemLinesDangerousGoodsLinesPackageInstruction}}", "marinePollutant": false, "acid": false, "alkali": false, "grossWeight": 10, "volume": 0.2, "units": 2, "description": "{{freightDetailsItemLinesDangerousGoodsLinesDescription}}" } ] } ], "hireLines": [{ "supplier": "{{freightDetailsHireLinesSupplier}}", "palletType": "{{freightDetailsHireLinesPalletType}}", "toAccount": "{{freightDetailsHireLinesToAccount}}", "fromAccount": "{{freightDetailsHireLinesFromAccount}}", "transactionType": "{{freightDetailsHireLinesTransactionType}}", "quantity": 10 } ] } ], "references": [{ "type": "{{ReferenceType}}", "value": "{{ReferenceValue}}" } ], "notes": [{ "type": "{{NoteType}}", "value": "{{NoteValue}}" } ], "dangerousGoodsSignatory": { "name": "{{dangerousGoodsSignatoryName}}", "title": "{{dangerousGoodsSignatoryTitle}}", "location": "{{dangerousGoodsSignatoryLocation}}", "signature": "{{dangerousGoodsSignatorySignature}}", "emergencyPhone": "{{dangerousGoodsSignatoryEmergencyPhone}}" }, "payment": { "paymentTerms": "{{paymentPaymentTerms}}", "collectOnDelivery": { "amount": 1500.00, "certifiedFundsRequired": true } }, "salesRepresentative": "{{salesRepresentative}}", "cover": { "insuredType": "{{coverInsuredType}}", "insuredValue": 2500.00, "declaredValue": 2500.00 }, "notifications": [{ "eventTypeCode": "{{notificationsEventTypeCode}}", "transport": { "code": "{{notificationsTransportCode}}", "destination": "{{notificationsTransportDestination}}" }, "events": [{ "code": "{{notificationsEventsCode}}" } ] } ] }
<?xml version="1.0"?> <shipment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <account> <code>{{accountCode}}</code> </account> <housebillNumber>{{housebillNumber}}</housebillNumber> <serviceLevel> <code>{{serviceLevelCode}}</code> </serviceLevel> <transportMode>{{transportMode}}</transportMode> <freightTerms>{{freightTerms}}</freightTerms> <routingType>{{routingType}}</routingType> <systemOfMeasurement>{{systemOfMeasurement}}</systemOfMeasurement> <origin> <sender> <code>{{originOriginSenderCode}}</code> <name>{{originOriginSenderName}}</name> </sender> <address> <premises>{{originAddressPremises}}</premises> <streetNumber>{{originAddressStreetNumber}}</streetNumber> <address1>{{originAddressAddress1}}</address1> <address2>{{originAddressAddress2}}</address2> <residential>false</residential> <suburb>{{originAddressSuburb}}</suburb> <postCode>{{originAddressPostCode}}</postCode> <town>{{originAddressTown}}</town> <city>{{originAddressCity}}</city> <stateCode>{{originAddressStateCode}}</stateCode> <countryCode>{{originAddressCountryCode}}</countryCode> <geometry> <location> <latitude>-43.542161</latitude> <longitude>172.558158</longitude> </location> </geometry> </address> <contact> <name>{{originContactName}}</name> <phone>{{originContactPhone}}</phone> <phoneExtension>{{originContactPhoneExtension}}</phoneExtension> <emailAddress>{{originContactEmailAddress}}</emailAddress> </contact> <appointment> <fromDateTime>{{originAppointmentFromDateTime}}</fromDateTime> <toDateTime>{{originAppointmentToDateTime}}</toDateTime> <note>{{originAppointmentNote}}</note> </appointment> <pickupTime> <timeslot>false</timeslot> <fromDateTime>{{originPickupTimeFromDateTime}}</fromDateTime> <toDateTime>{{originPickupTimeToDateTime}}</toDateTime> </pickupTime> <serviceProvider> <code>{{originServiceProviderCode}}</code> </serviceProvider> <customs> <broker>{{originCustomsBroker}}</broker> <parsCleared>{{originCustomsParsCleared}}</parsCleared> <inBond>false</inBond> </customs> <extras> <extra> <service>{{originExtrasCustomsService}}</service> <units>10</units> <note>{{originExtrasCustomsNote}}</note> </extra> </extras> <referenceNumber>{{originReferenceNumber}}</referenceNumber> <instructions>{{originInstructions}}</instructions> <ratingNote>{{originRatingNote}}</ratingNote> </origin> <destination> <receiver> <code>{{destinationReceiverCode}}</code> <name>{{destinationReceiverName}}</name> </receiver> <address> <premises>{{destinationAddressPremises}}</premises> <streetNumber>{{destinationAddressStreetNumber}}</streetNumber> <address1>{{destinationAddressAddress1}}</address1> <address2>{{destinationAddressAddress2}}</address2> <residential>false</residential> <suburb>{{destinationAddressSuburb}}</suburb> <postCode>{{destinationAddressPostCode}}</postCode> <town>{{destinationAddressTown}}</town> <city>{{destinationAddressCity}}</city> <stateCode>{{destinationAddressStateCode}}</stateCode> <countryCode>{{destinationAddressCountryCode}}</countryCode> <geometry> <location> <latitude>-43.542161</latitude> <longitude>172.558158</longitude> </location> </geometry> </address> <contact> <name>{{destinationContactName}}</name> <phone>{{destinationContactPhone}}</phone> <phoneExtension>{{destinationContactPhoneExtension}}</phoneExtension> <emailAddress>{{destinationContactEmailAddress}}</emailAddress> </contact> <appointment> <fromDateTime>{{destinationAppointmentFromDateTime}}</fromDateTime> <toDateTime>{{destinationAppointmentToDateTime}}</toDateTime> <note>{{destinationAppointmentNote}}</note> </appointment> <deliveryTime> <timeslot>false</timeslot> <fromDateTime>{{destinationdDliveryTimeFromDateTime}}</fromDateTime> <toDateTime>{{destinationDeliveryTimeToDateTime}}</toDateTime> </deliveryTime> <serviceProvider> <code>{{destinationServiceProviderCode}}</code> </serviceProvider> <customs> <broker>{{destinationCustomsBroker}}</broker> <parsCleared>{{destinationCustomsParsCleared}}</parsCleared> <inBond>false</inBond> </customs> <extras> <extra> <service>{{destinationExtrasService}}</service> <units>10</units> <note>{{destinationExtrasNote}}</note> </extra> </extras> <referenceNumber>{{destinationReferenceNumber}}</referenceNumber> <instructions>{{destinationInstructions}}</instructions> <ratingNote>{{destinationRatingNote}}</ratingNote> </destination> <freightDetails> <freightDetail> <ssccNumber>{{freightDetailsSsccNumber}}</ssccNumber> <freightDetailNumber>{{freightDetailsfreightDetailNumber}}</freightDetailNumber> <packTypeCode>{{freightDetailsPackTypeCode}}</packTypeCode> <description>{{freightDetailsDescription}}</description> <weight xsi:nil="true" /> <volume>4.851</volume> <length>2.1</length> <width>2.1</width> <height>1.1</height> <stackable>true</stackable> <nationalMotorFreightClassification>{{freightDetailsNationalMotorFreightClassification}}</nationalMotorFreightClassification> <freightClass>{{freightDetailsFreightClass}}</freightClass> <foodGrade>false</foodGrade> <itemLines> <itemLine> <units>10</units> <packTypeCode>{{freightDetailsItemLinesPackTypeCode}}</packTypeCode> <description>{{freightDetailsItemLinesDescription}}</description> <dangerousGoodsLines> <dangerousGoodsLine> <class>{{freightDetailsItemLinesDangerousGoodsLinesClass}}</class> <unNumber>{{freightDetailsItemLinesDangerousGoodsLinesUnNumber}}</unNumber> <variant>{{freightDetailsItemLinesDangerousGoodsLinesVariant}}</variant> <properName>{{freightDetailsItemLinesDangerousGoodsLinesProperName}}</properName> <technicalName>{{freightDetailsItemLinesDangerousGoodsLinesTechnicalName}}</technicalName> <commonName>{{freightDetailsItemLinesDangerousGoodsLinesCommonName}}</commonName> <subRisk>{{freightDetailsItemLinesDangerousGoodsLinesSubRisk}}</subRisk> <tertiarySubRisk>{{freightDetailsItemLinesDangerousGoodsLinesTertiarySubRisk}}</tertiarySubRisk> <hazChem>{{freightDetailsItemLinesDangerousGoodsLinesHazChem}}</hazChem> <packingGroup>{{freightDetailsItemLinesDangerousGoodsLinesPackingGroup}}</packingGroup> <flashPoint>{{freightDetailsItemLinesDangerousGoodsLinesFlashPoint}}</flashPoint> <additionalInfo>{{freightDetailsItemLinesDangerousGoodsLinesAdditionalInfo}}</additionalInfo> <packageType>{{freightDetailsItemLinesDangerousGoodsLinesPackageType}}</packageType> <packageInstruction>{{freightDetailsItemLinesDangerousGoodsLinesPackageInstruction}}</packageInstruction> <marinePollutant>false</marinePollutant> <acid>false</acid> <alkali>false</alkali> <grossWeight>10</grossWeight> <volume>0.2</volume> <units>2</units> <description>{{freightDetailsItemLinesDangerousGoodsLinesDescription}}</description> </dangerousGoodsLine> </dangerousGoodsLines> </itemLine> </itemLines> <hireLines> <hireLine> <supplier>{{freightDetailsHireLinesSupplier}}</supplier> <palletType>{{freightDetailsHireLinesPalletType}}</palletType> <toAccount>{{freightDetailsHireLinesToAccount}}</toAccount> <fromAccount>{{freightDetailsHireLinesFromAccount}}</fromAccount> <transactionType>{{freightDetailsHireLinesTransactionType}}</transactionType> <quantity>10</quantity> </hireLine> </hireLines> </freightDetail> </freightDetails> <references> <reference> <type>{{ReferenceType}}</type> <value>{{ReferenceValue}}</value> </reference> </references> <notes> <note> <type>{{NoteType}}</type> <value>{{NoteValue}}</value> </note> </notes> <dangerousGoodsSignatory> <name>{{dangerousGoodsSignatoryName}}</name> <title>{{dangerousGoodsSignatoryTitle}}</title> <location>{{dangerousGoodsSignatoryLocation}}</location> <signature>{{dangerousGoodsSignatorySignature}}</signature> <emergencyPhone>{{dangerousGoodsSignatoryEmergencyPhone}}</emergencyPhone> </dangerousGoodsSignatory> <payment> <paymentTerms>{{paymentPaymentTerms}}</paymentTerms> <collectOnDelivery> <amount>1500.00</amount> <certifiedFundsRequired>true</certifiedFundsRequired> </collectOnDelivery> </payment> <salesRepresentative>{{salesRepresentative}}</salesRepresentative> <cover> <insuredType>{{coverInsuredType}}</insuredType> <insuredValue>2500.00</insuredValue> <declaredValue>2500.00</declaredValue> </cover> <notifications> <notification> <eventTypeCode>{{notificationsEventTypeCode}}</eventTypeCode> <transport> <code>{{notificationsTransportCode}}</code> <destination>{{notificationsTransportDestination}}</destination> </transport> <events> <event> <code>{{notificationsEventsCode}}</code> </event> </events> </notification> </notifications> </shipment>