When routing or creating consignments, MachShip requires the details of the items that are being sent. MachShip offers multiple ways to specify the items for the consignment/route request. To return prices, at least 1 item must be supplied. Multiple items can be specified. MachShip offers the following ways for you to specify items
MachShip allows you to save items in MachShip and refer to these items via the API. These saved items can be used or you can specify the item details per request.
Specifying Item Details
Items can be provided per request by specifying the following properties:
{
...
"items": [
{
"itemType": "Carton",
"name": "test",
"sku": "test",
"quantity": 1,
"height": 10,
"weight": 10,
"length": 10,
"width": 10
}
]
...
}
Saved Items
MachShip allows you to save commonly used items which can then be used when routing and creating consignments. A saved item can be referred to by either its ID, SKU or Name. Please refer to our /apiv2/companyItems documentation for retrieving saved items from MachShip.
//accessing a saved item by id
"items": [
{
"companyItemId":999
}
]
//accessing a saved item by SKU
"items": [
{
"sku":"test"
}
]
//accessing a saved item by Name
"items": [
{
"name":"test"
}
]
When using saved items, you can also override any of the properties of the item by specifying them along with the ID, SKU or Name. The below example will set the quantity to 5 and the weight 15kg but all other properties will be taken from the saved item.
"items": [
{
"companyItemId":999,
"quantity":5,
"weight":15
}
]
Return Route Items Example 1: All item details provided.
{
"fromLocation": {
"suburb": "melbourne",
"postcode": "3000"
},
"toLocation": {
"suburb": "sydney",
"postcode": "2000"
},
"items": [
{
"itemType": "Carton",
"name": "test",
"quantity": 1,
"height": 10,
"weight": 10,
"length": 10,
"width": 10
}
]
}
Return Route Items Example 2: 3 separate saved items used being referenced via SKU, name, and CompanyItemId.
{
"fromLocation": {
"suburb": "melbourne",
"postcode": "3000"
},
"toLocation": {
"suburb": "sydney",
"postcode": "2000"
},
"items": [
{ "sku":"test" },
{ "name":"testName" },
{ "companyItemId":999 },
]
}