The following article covers how to create a consignment via the API when you are delegating your own carrier consignment numbers and/or item references/barcodes.
Carrier Consignment ID - is the consignment reference that is passed to the carrier as the identifier for the shipment
Also known as: connote, carrier consignment number.
Item Reference - is the barcode that appears on the label that will be used by the carrier to identify a specific package
Also known as: item barcode, SSCC
This is an advanced topic, and requires the generation of fully compliant carrier consignment ids and item references - something which Machship typically generates for a consignment.
{primary} This article will not cover the basics of creating consignments. An article covering consignment creation in depth can be found here: A guide to creating Consignments via the API
When you are looking to generate your own consignment numbers and item references/barcodes and pass them into Machship you must use the following endpoint to create consignments:
POST https://live.machship.com/apiv2/consignments/createConsignmentwithComplexItems HTTP/1.1
Host: live.machship.com
token: <api_token>
The full schema of this endpoint is available in our swagger documentation here.
When using this endpoint, we have two undocumented fields you will need to add to your payload:
An example of how these would be set is:
{
"carrierConsignmentId": "2657628002",
"carrierId": "446",
//all other consignment data as per schema
"items": [
{
"name": "Pallet",
"quantity": 2,
"itemType": "Pallet",
"standardItem": {
"weight": 270,
"length": "117",
"height": "110",
"width": "117"
},
"consignmentItemReferences": [
{
"carrierItemReference": "(00)393168610029113320"
},
{
"carrierItemReference": "(00)393168610029113321"
}
]
},
{
"name": "Pallet",
"quantity": 1,
"itemType": "Pallet",
"standardItem": {
"weight": 170,
"length": "110",
"height": "110",
"width": "110"
},
"consignmentItemReferences": [
{
"carrierItemReference": "(00)393168610029113322"
}
]
}
]
}
After you POST this data to the specified endpoint, check the response.
If your carrierConsignmentId and carrierItemReference match what you sent in, you've successfully delegated the references.
That's it - you're done!