Skip to content

M2X APIS (1.0.0)

M2X APIs

Download OpenAPI description
Overview
License
All Rights Reserved
Languages
Servers
Mock server
https://developer.m2x.app/_mock/apis/publicapi/openapi/
https://developer.m2x.app/apis/v0/
NZ Production server (uses live data)
https://m2x.app/apis/v0/
US Production server (uses live data)
https://us.m2x.app/apis/v0/
AUS Production server (uses live data)
https://au.m2x.app/apis/v0/
Sandbox server
https://staging.m2x.app/apis/v0/

Analytics

Analytics data

Operations

Billing Groups

Invoiceable unit used by the system

Operations

Bookings

Bookings information

Operations

Carrier Bookings

Corporate bookings received by carriers

Operations

Carrier Large Contracts

Carrier large contracts

Operations

Carrier Orders

Carrier orders

Operations

Corporate Planning

Corporate Planning supplies and demands

Operations

Customer Bookings

Customer bookings on carriers

Operations

Customers

Customers used for invoices

Operations

Drivers

Drivers information

Operations

Fuel

Fuel deliveries management

Operations

Fulfilment Requests

Fulfilment request on carriers

OperationsWebhooks

General Consignments

General consignments

Operations

ISO containers

ISO containers information

Operations

Jobs

Vehicle units of work

OperationsWebhooks

Locations

Locations information

Operations

Master Bookings

Master bookings

OperationsWebhooks

Offers

Corporate monetary offers to carriers

OperationsWebhooks

Products

Products used by the system

Operations

Runs

Runs management

Operations

Query runs activities

Request

Security
M2X_auth_application
Query
startstring(date)required

Start of the queried interval (YYYY-MM-DD)

endstring(date)required

End of the queried interval (YYYY-MM-DD)

curl -i -X GET \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/runs/activities?start=2019-08-24&end=2019-08-24' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/jsonArray [
idstring
Example: "D001"
departureTimestring or null(date-time)
arrivalTimestring or null(date-time)
deletedboolean
typestring
Enum"pickup""delivery""start""end"
constraintIdstring or null
Example: "D001"
dispatchGroupIdstring or null
Example: "ABC1123-asdasdasd-123213"
vehicleIdstring
Example: "D001"
locationobject(JobLocation)
productnull or DynamicFulfilmentProduct (object)
Any of:
null
productComponentsArray of objects or null(ProductComponent)

The sub components of the product if present

productSpatialRequirementnumber or null
totalProductSpatialRequirementnumber or null
shiftMetadataobject(ShiftMetadata)
actualobject or null
timeConstraintActivityTimeConstraint (object) or null
Any of:
firstPublishedStateDynamicFulfilmentActivityPublishedState (object) or null

Details about the activity as it was when it was published for the first time

Any of:

Details about the activity as it was when it was published for the first time

]
Response
application/json
[ { "id": "D001", "departureTime": "2019-08-24T14:15:22Z", "arrivalTime": "2019-08-24T14:15:22Z", "deleted": true, "type": "pickup", "constraintId": "D001", "dispatchGroupId": "ABC1123-asdasdasd-123213", "vehicleId": "D001", "location": { … }, "product": {}, "productComponents": [ … ], "productSpatialRequirement": 0, "totalProductSpatialRequirement": 0, "shiftMetadata": { … }, "actual": { … }, "timeConstraint": { … }, "firstPublishedState": { … } } ]

Upsert Pickup

Request

Security
M2X_auth_application
Path
pickupIdstringrequired

The unique pickup Id

Bodyapplication/json
customerobject(CarrierCustomerMappingRequest)required

Parameters to try to map a customer with M2X

customer.​customerNamestring
Example: "Fruit World"
customer.​customerIdstring
Example: "Yc7cXUulBhMM58iuOQce"
customer.​externalIdstring
Example: "FTW"
customer.​integrationIdstring
Example: "C99"
locationobject(CarrierLocationMappingRequest)required

Parameters to try to map a location with M2X

location.​locationIdstring or null

M2X internal tracking id for the location code used

Default null
Example: "C6mruxd3AVUTW14vEZ0v"
location.​addressTextstring or null

Address, if present and no locationId or external Id is matching, will try to geocode

Default null
Example: "123 Example Road, Auckland 1010"
location.​externalIdstring or null

External Id

Default null
Example: "WHC6"
location.​locationNamestring or null

Helps user creating the missing mapping upon mapping failure, or used to save location if new

Default null
Example: "Auckland Storage 1"
location.​latitudenumber
Default 0
Example: -36.983882
location.​longitudenumber
Default 0
Example: 174.709879
location.​locationNameResolutionEnabledboolean

Try to resolve location by name, quick weak method, disabled by default

Default false
location.​saveIfUnknownboolean

If no existing location is found, locationId provided and lat/lng provided or geocode successful, will create location

Default false
contentobject or null(CarrierContentMappingRequest)

Specific information about the content carted

productobject(CarrierProductMappingRequest)required

Parameters to try to map a product with M2X

product.​productCodeNamestring
product.​productCodeIdstring
product.​integrationIdstring
quantitynumberrequired
externalIdnumber
prioritystring(DynamicFulfilmentActivityPriority)
Enum"LOW""MEDIUM""HIGH"
orderDaystring(date)(DynamicFulfilmentOrderDay)

The date from where the deliver will be available for dispatch, if not provided, assume today

readonlyFieldsobject

Specifies which field should not be touched by the user

propertiesobject or null(CustomProperties)

A key value store containing bespoke properties usable for pricing and optimisation

metadataobject or null(Metadata)

Opaque passenger data

curl -i -X PUT \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/runs/pickups/{pickupId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customer": {
      "customerName": "Fruit World",
      "customerId": "Yc7cXUulBhMM58iuOQce",
      "externalId": "FTW",
      "integrationId": "C99"
    },
    "location": {
      "locationId": "C6mruxd3AVUTW14vEZ0v",
      "addressText": "123 Example Road, Auckland 1010",
      "externalId": "WHC6",
      "locationName": "Auckland Storage 1",
      "latitude": -36.983882,
      "longitude": 174.709879,
      "locationNameResolutionEnabled": false,
      "saveIfUnknown": false
    },
    "content": null,
    "product": {
      "productCodeName": "string",
      "productCodeId": "string",
      "integrationId": "string"
    },
    "quantity": 0,
    "externalId": 0,
    "priority": "LOW",
    "orderDay": "2019-08-24",
    "readonlyFields": {
      "deleted": false,
      "customer": false,
      "location": false,
      "content": false,
      "product": false,
      "quantity": false,
      "priority": false,
      "properties": false
    },
    "properties": null,
    "metadata": null
  }'

Responses

Successful Operation

Bodyapplication/json
successboolean
Example: true
Response
application/json
{ "success": true }

Delete Pickup

Request

Security
M2X_auth_application
Path
pickupIdstringrequired

The unique pickup Id

curl -i -X DELETE \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/runs/pickups/{pickupId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful Operation

Bodyapplication/json
successboolean
Example: true
Response
application/json
{ "success": true }

Get collection by Id

Request

Security
M2X_auth_application
Path
collectionIdstringrequired

The unique Id of the collection

curl -i -X GET \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/runs/pickups/collections/truckDairyPump/{collectionId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/json
locationExternalIdstringrequired
locationNamestringrequired
toLocationExternalIdstring
toLocationNamestring
truckNamestringrequired
truckExternalIdstring
driverNamestring
driverExternalIdstring
customerNamestring
serviceDaystring(date)

The day the pickup belongs to in case of after midnight

startTimestring(date-time)required
endTimestring(date-time)required
productQuantitynumberrequired
customerRunNumberstring
internalRunNumberstring
propertiesobject
metadataobject
measurementsobject
updatedstring(date-time)
measurementIdstring
Response
application/json
{ "locationExternalId": "string", "locationName": "string", "toLocationExternalId": "string", "toLocationName": "string", "truckName": "string", "truckExternalId": "string", "driverName": "string", "driverExternalId": "string", "customerName": "string", "serviceDay": "2019-08-24", "startTime": "2019-08-24T14:15:22Z", "endTime": "2019-08-24T14:15:22Z", "productQuantity": 0, "customerRunNumber": "string", "internalRunNumber": "string", "properties": {}, "metadata": {}, "measurements": { "temperature": 0, "minTemperature": 0, "maxTemperature": 0 }, "updated": "2019-08-24T14:15:22Z", "measurementId": "string" }

Update/create collection by Id

Request

Security
M2X_auth_application
Path
collectionIdstringrequired

The unique Id of the collection to ensure idempotence

Bodyapplication/jsonrequired

Update for the collection

locationExternalIdstringrequired
locationNamestringrequired
toLocationExternalIdstring
toLocationNamestring
truckNamestringrequired
truckExternalIdstring
driverNamestring
driverExternalIdstring
customerNamestring
serviceDaystring(date)

The day the pickup belongs to in case of after midnight

startTimestring(date-time)required
endTimestring(date-time)required
productQuantitynumberrequired
customerRunNumberstring
internalRunNumberstring
propertiesobject
metadataobject
measurementsobject
curl -i -X PUT \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/runs/pickups/collections/truckDairyPump/{collectionId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "locationExternalId": "string",
    "locationName": "string",
    "toLocationExternalId": "string",
    "toLocationName": "string",
    "truckName": "string",
    "truckExternalId": "string",
    "driverName": "string",
    "driverExternalId": "string",
    "customerName": "string",
    "serviceDay": "2019-08-24",
    "startTime": "2019-08-24T14:15:22Z",
    "endTime": "2019-08-24T14:15:22Z",
    "productQuantity": 0,
    "customerRunNumber": "string",
    "internalRunNumber": "string",
    "properties": {},
    "metadata": {},
    "measurements": {
      "temperature": 0,
      "minTemperature": 0,
      "maxTemperature": 0
    }
  }'

Responses

Successful operation

Bodyapplication/json
locationExternalIdstringrequired
locationNamestringrequired
toLocationExternalIdstring
toLocationNamestring
truckNamestringrequired
truckExternalIdstring
driverNamestring
driverExternalIdstring
customerNamestring
serviceDaystring(date)

The day the pickup belongs to in case of after midnight

startTimestring(date-time)required
endTimestring(date-time)required
productQuantitynumberrequired
customerRunNumberstring
internalRunNumberstring
propertiesobject
metadataobject
measurementsobject
updatedstring(date-time)
measurementIdstring
Response
application/json
{ "locationExternalId": "string", "locationName": "string", "toLocationExternalId": "string", "toLocationName": "string", "truckName": "string", "truckExternalId": "string", "driverName": "string", "driverExternalId": "string", "customerName": "string", "serviceDay": "2019-08-24", "startTime": "2019-08-24T14:15:22Z", "endTime": "2019-08-24T14:15:22Z", "productQuantity": 0, "customerRunNumber": "string", "internalRunNumber": "string", "properties": {}, "metadata": {}, "measurements": { "temperature": 0, "minTemperature": 0, "maxTemperature": 0 }, "updated": "2019-08-24T14:15:22Z", "measurementId": "string" }

Subcontractors

Subcontractors information

Operations

Tractor Unit

Tractor units information

Operations

Trailer

Trailers information

Operations

Transaction

Transaction management

Operations

Vehicle

Vehicles information

Operations

Vehicle Execution Statements

Unit of execution for trucks

OperationsWebhooks

Consignments

Webhooks