Skip to navigation

1. Get reference data

Look up the values an FTL needs before you create one

An FTL refers to values that already exist in your account: shipping lines, payment terms, container products, document types and ports. Look them up first. For each one you can send the name or its id.

FTL options

GET /api/v1/partners/shipments/options returns every list in one call.

curl "https://lastmile.milenow.com/index.php/api/v1/partners/shipments/options" \
-H "Authorization: Bearer $MILE_TOKEN"
{
"status": 200,
"msg": "Shipment options fetched successfully",
"msgs": [],
"data": {
"payment_terms": [{ "id": 32, "name": "Company Credit" }],
"shipping_lines": [{ "id": 10, "name": "MAERSK" }, { "id": 11, "name": "MSC" }],
"shipping_methods": [{ "id": 3, "name": "land" }],
"categories": [
{
"id": 702810,
"name": "Containers",
"products": [
{ "id": 875776, "name": "20ft GP Container - Full" },
{ "id": 875777, "name": "40ft GP Container - Full" },
{ "id": 875789, "name": "40ft Container - Empty" }
]
}
],
"container_sizes": ["20ft", "40ft", "40ft HC", "45ft HC"],
"document_types": [{ "id": 1, "name": "Bill of Landing" }],
"vendor_required": false,
"vendors": [],
"vendor_categories": [],
"countries": [{ "id": 194, "name": "Saudi Arabia", "short_name": "SA" }]
}
}
ListUse it for
shipping_linesshipping_line or shipping_line_id (required)
payment_termspayment_term or payment_term_id (required)
categories[].productsEach container’s category and product (required)
container_sizesEach container’s size (required)
document_typesEach document’s type (optional)
vendorsvendor. Required only when vendor_required is true
shipping_methods, countriesOptional fields

These values change rarely. Cache them and refresh them daily.

A wrong name returns 412 with the valid values in the message, for example payment_term "Cash" not found. Valid values: Company Credit.

Ports

You need a port only when the container is picked up at a port. Search with at least 2 characters of the name, code or UN/LOCODE using GET /api/v1/partners/shipments/ports. It returns up to 20 ports.

curl -G "https://lastmile.milenow.com/index.php/api/v1/partners/shipments/ports" \
-H "Authorization: Bearer $MILE_TOKEN" \
--data-urlencode "search=Jeddah"
{
"status": 200,
"msg": "Ports fetched successfully",
"msgs": [],
"data": [
{ "id": 61021, "name": "Jiddah", "alternate_names": "Jidda", "code": "48140", "unlocode": "SA JED", "country": "Saudi Arabia" }
]
}

In an FTL, send the port as its id (destination_port_id), its name, its code or its unlocode, for example "destination_port": "SA JED". No match returns 200 with an empty data list.

Drivers

To run trips with your own fleet, list your drivers with the existing drivers endpoint. Use id as driver_id.

curl "https://lastmile.milenow.com/index.php/api/v1/partners/drivers" \
-H "Authorization: Bearer $MILE_TOKEN"

This list can include drivers who belong to your transporters. You cannot put them on your trips through the API: it returns 412 driver_id ... belongs to the transporter .... Through the API, only the transporter can assign them, and only to trips outsourced to it.

Next: create FTLs.