Shipment Create (Europe)
Allows customers to create a shipment in the EU region. 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:
| Environment | URL | |||||
|---|---|---|---|---|---|---|
| LIVE | https://api.mainfreight.com/transport/1.0/shipments/europe/shipment?region={region} | |||||
| UAT | https://apitest.mainfreight.com/transport/1.0/shipments/europe/shipment?region={region} | |||||
Resource Information
| Type | Value | ||
|---|---|---|---|
| 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:
| Header | Description | Type | Required |
|---|---|---|---|
| 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
| Header | Description | Type | Required |
|---|---|---|---|
| region |
Region code, this endpoint supports only "EU" |
string | Yes |
Request Body
| Field | Description | Type | Length | Required |
|---|---|---|---|---|
| account | Account involved in the shipment | object | yes | |
| code | Customer Number provided by Mainfreight | integer | 7 | yes |
| bookingConfirmation | boolean | |||
| string | 50 | |||
| housebillNumber |
A principal reference number that identifies the shipment |
string | 30 | yes |
| serviceLevel | object | yes | ||
| code |
Indicates the service level Supported Service Level Codes can be found here |
string | 2 | yes |
| containerService | boolean | |||
| branch |
Indicates the branch. If unsure which one to use, please contact Mainfreight Supported Branch Codes can be found here |
string | 2 | yes |
| shipmentIncoTerm | object | |||
| code |
Indicates the IncoTerm code Supported Shipment Incoterms can be found here |
string | 3 | yes |
| location |
Named place where the seller's obligations for cost and risk end, and the buyer's begin |
string | 15 | |
| origin | Defines the specifics of the starting point of the shipment | object | yes | |
| sender | The party who is sending the goods | object | ||
| name | Full name of the sender | string | 35 | yes |
| premises | Indicates a named location, usually a building or collection of buildings with a common name | string | 35 | |
| address1 | Indicates a street name | string | 35 | yes |
| address2 | Indicates other address identifiers | string | 35 | |
| postCode | Indicates the postcode | string | 9 | yes |
| city | Indicates the city/place | string | 35 | yes |
| countryCode | ISO alpha-2 code to identify the country | string | 2 | yes |
| bookingConfirmation | Is booking confirmation requested for this party | boolean | ||
| contact | object | |||
| name | Full name of the contact | string | 35 | |
| phone | Phone number of the contact | string | 20 | |
| Email address of the contact | string | 50 | ||
| pickup | The party where the goods will be picked up | object | yes | |
| name | Full name of the pickup party | string | 35 | yes |
| premises | Indicates a named location, usually a building or collection of buildings with a common name | string | 35 | |
| address1 | Indicates a street name | string | 35 | yes |
| address2 | Indicates other address identifiers | string | 35 | |
| postCode | Indicates the postcode | string | 9 | yes |
| city | Indicates the city/place | string | 35 | yes |
| countryCode | ISO alpha-2 code to identify the country | string | 2 | yes |
| bookingConfirmation | Is booking confirmation requested for this party | boolean | ||
| contact |
|
object | ||
| name |
Full name of the contact |
string | 35 | |
| phone | Phone number of the contact | string | 20 | |
| Email address of the contact | string | 50 | ||
| pickupTime | object | yes | ||
| fromDateTime | The start date of the pickup time | dateTime | yes | |
| toDateTime | The end date of the pickup time | dateTime | yes | |
| accessorials | array of objects | |||
| accessorial | object | |||
| code |
Accessorial code Supported Accessorial Codes can be found here |
string | 3 | yes |
| additionalInformation | Extra information about the accessorial | string | 35 | |
| fromDateTime | The from date and time | dateTime | ||
| toDateTime | The to date and time | dateTime | ||
| instructions | Indicates an instruction note corresponding to the pickup | string | 70 | |
| destination | object | yes | ||
| receiver | object | |||
| name | Full name of the receiver | string |
35 |
yes |
| premises | Indicates a named location, usually a building or collection of buildings with a common name | string | 35 | |
| address1 | Indicates a street name | string | 35 | yes |
| address2 | Indicates other address identifiers | string | 35 | |
| postCode | Indicates the postcode | string | 9 | yes |
| city | Indicates the city/place | string | 35 | yes |
| countryCode | ISO alpha-2 code to identify the country | string | 2 | yes |
| bookingConfirmation | Is booking confirmation requested for this party | boolean | ||
| contact | object | |||
| name | Full name of the contact | string | 35 | |
| phone | Phone number of the contact | string | 20 | |
| Email address of the contact | string | 50 | ||
| delivery | object | yes | ||
| name | Full name of the delivery party | string | 35 | yes |
| premises |
Indicates a named location, usually a building or collection of buildings with a common name |
string | 35 | |
| address1 | Indicates a street name | string | 35 | yes |
| address2 | Indicates other address identifiers | string | 35 | |
| postCode | Indicates the postcode | string | 9 | yes |
| city | Indicates the city/place | string | 35 | yes |
| countryCode | ISO alpha-2 code to identify the country | string | 2 | yes |
| bookingConfirmation | Is booking confirmation requested for this party | boolean | ||
| contact | object | |||
| name | Full name of the contact | string | 35 | |
| phone | Phone number of the contact | string | 20 | |
| Email address of the contact | string | 50 | ||
| deliveryTime | object | |||
| fromDateTime | The from date and time of the delivery | dateTime | yes | |
| toDateTime | The to date and time of the delivery | dateTime | yes | |
| accessorials | array of objects | |||
| accessorial | object | |||
| code | Accessorial code | string | 3 | yes |
| additionalInformation | Extra information about the accessorial | string | 35 | |
| fromDateTime | The from date and time | dateTime | ||
| toDateTime | The to date and time | dateTime | ||
| instructions | Indicates an instruction note corresponding to the delivery | string | 70 | |
| freightDetails | array of objects | yes | ||
| freightDetail | Defines information about types and dimensions of goods shipped on this shipment | array of objects | ||
| ssccNumbers | array of objects | yes | ||
| ssccNumber | object | |||
| code | The unique identifier | string | 20 | yes |
| customerItemNumber | Customer Item Number (Marks & Numbers) can be used to identify a freight line | string | 50 | |
| units | Indicates the units | integer | 999 | yes |
| packTypeCode |
Shorthand code identifying the type of goods on the freight line Supported Pack Type Codes can be found here |
string | yes | |
| description | Description of the goods on the freight line | string | 35 | yes |
| commodityType |
Category of goods Supported Commodity Type Codes can be found here |
string | ||
| weight |
Physical weight of the goods on the freight line minimum: 0.001 maximum: 9999999.999 |
double | yes | |
| length |
Length of goods on the freight line minimum: 0.01 maximum: 13.6 |
double | yes | |
| width | Width of goods on the freight line | double | yes | |
| height |
Height of goods on the freight line minimum: 0.01 maximum: 2.4 |
double | yes | |
| loadingMeters | Footprint of the truck loading area in square meters | string | ||
| itemLines | object | |||
| units |
Indicates the units maximum: 999999 |
integer | yes | |
| packTypeCode |
Shorthand code identifying the type of goods on the item line Supported Item Line Pack Type Codes can be found here |
string | ||
| dangerousGoodsLines | Identification of materials or items with hazardous properties | array of objects | ||
| dangerousGoodsLine | Identifies one line of dangerous goods (DG) | array of objects | ||
| class | DG Class | string | 4 | yes |
| unNumber |
A four-digit number used to identify hazardous materials and articles maximum: 9999 |
integer | 4 | yes |
| technicalName | Identification of technical name of DG | string | 70 | |
| subRisk | Identification of hazards referred to as Subsidiary Risks | string | 10 | |
| packingGroup | Packing group indicates the degree of danger | string | 3 | |
| packageType |
How DG is contained Supported Dangerous Goods Pack Type Codes can be found here |
string | Yes | |
| marinePollutant | Whether DG is a Marine Pollutant | boolean | ||
| netWeight |
Net weight of the goods on the DG line minimum: 0.001 maximum: 99999.999 |
double | yes | |
| units |
Units of DG line minimum: 1 maximum: 9999 |
integer | yes | |
| classificationCode | Classification code | string | 6 | |
| technicalName2 | Identification of technical name of DG in an alternate language | string | 70 | |
| technicalName2LanguageCode | Shorthand code to identify the alternate language | string | 2 | |
| limitedQuantityIndicator | Limited quantity indicator | boolean | ||
| emptyIndicator | Empty indicator | boolean | ||
| wasteIndicator | Waste indicator | boolean | ||
| references | array of objects | |||
| type |
Type of reference Supported types: PickUp, Delivery, Sender, Receiver, ExtraInvoiceReference |
string | yes | |
| value | Reference value | string | 30 | yes |
Response Body
| Field | Description | Type | Length |
|---|---|---|---|
| id | Unique shipment identifier | string | |
| account | Account involved in the shipment | object | |
| code | Shorthand code to identify the account | integer | 7 |
| bookingConfirmation | boolean | ||
| string | 50 | ||
| housebillNumber |
A reference that identifies the shipment |
string | 30 |
| serviceLevel | object | ||
| code |
Indicates the service level |
string | 2 |
| containerService | boolean | ||
| branch |
Indicates the branch |
string | 2 |
| shipmentIncoTerm | object | ||
| code |
Indicates the IncoTerm code |
string | 3 |
| location |
Named place where the seller's obligations for cost and risk end, and the buyer's begin |
string | 15 |
| origin | Defines the specifics of the starting point of the shipment | object | |
| sender | The party who is sending the goods | object | |
| name | Full name of the sender | string | 35 |
| premises | Indicates a named location, usually a building or collection of buildings with a common name | string | 35 |
| address1 | Indicates a street name | string | 35 |
| address2 | Indicates other address identifiers | string | 35 |
| postCode | Indicates the postcode | string | 9 |
| city | Indicates the city/place | string | 35 |
| countryCode | ISO alpha-2 code to identify the country | string | 2 |
| bookingConfirmation | Is booking confirmation requested for this party | boolean | |
| contact | object | ||
| name | Full name of the contact | string | 35 |
| phone | Phone number of the contact | string | 20 |
| Email address of the contact | string | 50 | |
| pickup | The party where the goods will be picked up | object | |
| name | Full name of the pickup party | string | 35 |
| premises | Indicates a named location, usually a building or collection of buildings with a common name | string | 35 |
| address1 | Indicates a street name | string | 35 |
| address2 | Indicates other address identifiers | string | 35 |
| postCode | Indicates the postcode | string | 9 |
| city | Indicates the city/place | string | 35 |
| countryCode | ISO alpha-2 code to identify the country | string | 2 |
| bookingConfirmation | Is booking confirmation requested for this party | boolean | |
| contact |
|
object | |
| name |
Full name of the contact |
string | 35 |
| phone | Phone number of the contact | string | 20 |
| Email address of the contact | string | 50 | |
| pickupTime | object | ||
| fromDateTime | The start date of the pickup time | dateTime | |
| toDateTime | The end date of the pickup time | dateTime | |
| accessorials | array of objects | ||
| accessorial | object | ||
| code |
Accessorial code |
string | 3 |
| additionalInformation | Extra information about the accessorial | string | 35 |
| fromDateTime | The from date and time | dateTime | |
| toDateTime | The to date and time | dateTime | |
| instructions | Indicates an instruction note corresponding to the pickup | string | 70 |
| destination | object | ||
| receiver | object | ||
| name | Full name of the receiver | string |
35 |
| premises | Indicates a named location, usually a building or collection of buildings with a common name | string | 35 |
| address1 | Indicates a street name | string | 35 |
| address2 | Indicates other address identifiers | string | 35 |
| postCode | Indicates the postcode | string | 9 |
| city | Indicates the city/place | string | 35 |
| countryCode | ISO alpha-2 code to identify the country | string | 2 |
| bookingConfirmation | Is booking confirmation requested for this party | boolean | |
| contact | object | ||
| name | Full name of the contact | string | 35 |
| phone | Phone number of the contact | string | 20 |
| Email address of the contact | string | 50 | |
| delivery | object | ||
| name | Full name of the delivery party | string | 35 |
| premises |
Indicates a named location, usually a building or collection of buildings with a common name |
string | 35 |
| address1 | Indicates a street name | string | 35 |
| address2 | Indicates other address identifiers | string | 35 |
| postCode | Indicates the postcode | string | 9 |
| city | Indicates the city/place | string | 35 |
| countryCode | ISO alpha-2 code to identify the country | string | 2 |
| bookingConfirmation | Is booking confirmation requested for this party | boolean | |
| contact | object | ||
| name | Full name of the contact | string | 35 |
| phone | Phone number of the contact | string | 20 |
| Email address of the contact | string | 50 | |
| deliveryTime | object | ||
| fromDateTime | The from date and time of the delivery | dateTime | |
| toDateTime | The to date and time of the delivery | dateTime | |
| accessorials | array of objects | ||
| accessorial | object | ||
| code | Accessorial code | string | 3 |
| additionalInformation | Extra information about the accessorial | string | 35 |
| fromDateTime | The from date and time | dateTime | |
| toDateTime | The to date and time | dateTime | |
| instructions | Indicates an instruction note corresponding to the delivery | string | 70 |
| freightDetails | array of objects | ||
| freightDetail | Defines information about types and dimensions of goods shipped on this shipment | array of objects | |
| ssccNumbers | array of objects | ||
| ssccNumber | object | ||
| code | The unique identifier | string | 20 |
| customerItemNumber | Customer Item Number can be used to identify a freight line | string | 50 |
| units | Indicates the units | integer | 999 |
| packTypeCode |
Shorthand code identifying the type of goods on the freight line
|
string | |
| description | Description of the goods on the freight line | string | 35 |
| commodityType |
Category of goods |
string | |
| weight |
Physical weight of the goods on the freight line minimum: 0.001 maximum: 9999999.999 |
double | |
| length |
Length of goods on the freight line minimum: 0.01 maximum: 13.6 |
double | |
| width | Width of goods on the freight line | double | |
| height |
Height of goods on the freight line minimum: 0.01 maximum: 2.4 |
double | |
| loadingMeters | Footprint of the truck loading area in square meters | string | |
| itemLines | object | ||
| units |
Indicates the units maximum: 999999 |
integer | |
| packTypeCode |
Shorthand code identifying the type of goods on the item line |
string | |
| dangerousGoodsLines | Identification of materials or items with hazardous properties | array of objects | |
| dangerousGoodsLine | Identifies one line of dangerous goods (DG) | array of objects | |
| class | DG Class | string | 4 |
| unNumber |
A four-digit number used to identify hazardous materials and articles maximum: 9999 |
integer | 4 |
| technicalName | Identification of technical name of DG | string | 70 |
| subRisk | Identification of hazards referred to as Subsidiary Risks | string | 10 |
| packingGroup | Packing group indicates the degree of danger | string | 3 |
| packageType |
How DG is contained |
string | |
| marinePollutant | Whether DG is a Marine Pollutant | boolean | |
| netWeight |
Net weight of the goods on the DG line minimum: 0.001 maximum: 99999.999 |
double | |
| units |
Units of DG line minimum: 1 maximum: 9999 |
integer | |
| classificationCode | Classification code | string | 6 |
| technicalName2 | Identification of technical name of DG in an alternate language | string | 70 |
| technicalName2LanguageCode | Shorthand code to identify the alternate language | string | 2 |
| limitedQuantityIndicator | Limited quantity indicator | boolean | |
| emptyIndicator | Empty indicator | boolean | |
| wasteIndicator | Waste indicator | boolean | |
| references | array of objects | ||
| type | Type of reference | string | |
| value | Reference value | string | 30 |
Code samples
To Generate a Shipment in JSON format you will need to POST a JSON object:
- URL
https://api.mainfreight.com/transport/1.0/shipments/europe/shipment?region=eu
You are going to send a JSON object similar to this:
- REQUEST JSON
{
"account": {
"code": 9999999,
"bookingConfirmation": true,
"email": "string"
},
"housebillNumber": "string",
"serviceLevel": {
"code": "st"
},
"containerService": true,
"branch": "st",
"shipmentIncoTerm": {
"code": "str",
"location": "string"
},
"origin": {
"sender": {
"name": "string",
"premises": "string",
"address1": "string",
"address2": "string",
"postCode": "string",
"city": "string",
"countryCode": "st",
"bookingConfirmation": true,
"contact": {
"name": "string",
"phone": "string",
"email": "string"
}
},
"pickup": {
"name": "string",
"premises": "string",
"address1": "string",
"address2": "string",
"postCode": "string",
"city": "string",
"countryCode": "st",
"bookingConfirmation": true,
"contact": {
"name": "string",
"phone": "string",
"email": "string"
},
"pickupTime": {
"fromDateTime": "2025-11-19T00:00:00Z",
"toDateTime": "2025-11-19T00:00:00Z"
},
"accessorials": [
{
"code": "str",
"additionalInformation": "string",
"fromDateTime": "2025-11-19T00:00:00Z",
"toDateTime": "2025-11-19T00:00:00Z"
}
],
"instructions": "string"
}
},
"destination": {
"receiver": {
"name": "string",
"premises": "string",
"address1": "string",
"address2": "string",
"postCode": "string",
"city": "string",
"countryCode": "st",
"bookingConfirmation": true,
"contact": {
"name": "string",
"phone": "string",
"email": "string"
}
},
"delivery": {
"name": "string",
"premises": "string",
"address1": "string",
"address2": "string",
"postCode": "string",
"city": "string",
"countryCode": "st",
"bookingConfirmation": true,
"contact": {
"name": "string",
"phone": "string",
"email": "string"
},
"deliveryTime": {
"fromDateTime": "2025-11-19T00:00:00Z",
"toDateTime": "2025-11-19T00:00:00Z"
},
"accessorials": [
{
"code": "str",
"additionalInformation": "string",
"fromDateTime": "2025-11-19T00:00:00Z",
"toDateTime": "2025-11-19T00:00:00Z"
}
],
"instructions": "string"
}
},
"freightDetails": [
{
"ssccNumbers": [
{
"code": "string"
}
],
"customerItemNumber": "string",
"units": 999,
"packTypeCode": "string",
"description": "string",
"commodityType": "string",
"weight": 9999999.999,
"length": 13.6,
"width": 3,
"height": 2.4,
"loadingMeters": 13.6,
"itemLines": {
"units": 999999,
"packTypeCode": "string"
},
"dangerousGoodsLines": [
{
"class": "stri",
"unNumber": "strin",
"technicalName": "string",
"subRisk": "string",
"packingGroup": "str",
"packageType": "string",
"marinePollutant": true,
"netWeight": 99999.999,
"units": 9999,
"classificationCode": "string",
"technicalName2": "string",
"technicalName2LanguageCode": "st",
"limitedQuantityIndicator": true,
"emptyIndicator": true,
"wasteIndicator": true
}
]
}
],
"references": [
{
"type": "string",
"value": "string"
}
]
}
You are going get another JSON object similar to this:
- RESPONSE JSON
{
"id": "string",
"account": {
"code": 0,
"bookingConfirmation": true,
"email": "string"
},
"housebillNumber": "string",
"serviceLevel": {
"code": "string"
},
"containerService": true,
"branch": "string",
"shipmentIncoTerm": {
"code": "string",
"location": "string"
},
"origin": {
"sender": {
"name": "string",
"premises": "string",
"address1": "string",
"address2": "string",
"postCode": "string",
"city": "string",
"countryCode": "string",
"bookingConfirmation": true,
"contact": {
"name": "string",
"phone": "string",
"email": "string"
}
},
"pickup": {
"name": "string",
"premises": "string",
"address1": "string",
"address2": "string",
"postCode": "string",
"city": "string",
"countryCode": "string",
"bookingConfirmation": true,
"contact": {
"name": "string",
"phone": "string",
"email": "string"
},
"pickupTime": {
"fromDateTime": "2025-11-19T00:00:00Z",
"toDateTime": "2025-11-19T00:00:00Z"
},
"accessorials": [
{
"code": "string",
"additionalInformation": "string",
"fromDateTime": "2025-11-19T00:00:00Z",
"toDateTime": "2025-11-19T00:00:00Z"
}
],
"instructions": "string"
}
},
"destination": {
"receiver": {
"name": "string",
"premises": "string",
"address1": "string",
"address2": "string",
"postCode": "string",
"city": "string",
"countryCode": "string",
"bookingConfirmation": true,
"contact": {
"name": "string",
"phone": "string",
"email": "string"
}
},
"delivery": {
"name": "string",
"premises": "string",
"address1": "string",
"address2": "string",
"postCode": "string",
"city": "string",
"countryCode": "string",
"bookingConfirmation": true,
"contact": {
"name": "string",
"phone": "string",
"email": "string"
},
"deliveryTime": {
"fromDateTime": "2025-11-19T00:00:00Z",
"toDateTime": "2025-11-19T00:00:00Z"
},
"accessorials": [
{
"code": "string",
"additionalInformation": "string",
"fromDateTime": "2025-11-19T00:00:00Z",
"toDateTime": "2025-11-19T00:00:00Z"
}
],
"instructions": "string"
}
},
"freightDetails": [
{
"ssccNumbers": [
{
"code": "string"
}
],
"customerItemNumber": "string",
"units": 0,
"packTypeCode": "string",
"description": "string",
"commodityType": "string",
"weight": 0,
"length": 0,
"width": 0,
"height": 0,
"loadingMeters": 0,
"itemLines": {
"units": 0,
"packTypeCode": "string"
},
"dangerousGoodsLines": [
{
"class": "string",
"unNumber": "string",
"technicalName": "string",
"subRisk": "string",
"packingGroup": "string",
"packageType": "string",
"marinePollutant": true,
"netWeight": 0,
"units": 0,
"classificationCode": "string",
"technicalName2": "string",
"technicalName2LanguageCode": "string",
"limitedQuantityIndicator": true,
"emptyIndicator": true,
"wasteIndicator": true
}
]
}
],
"references": [
{
"type": "string",
"value": "string"
}
]
