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

Create/update a measurement for a storage

Request

Security
M2X_auth_application
Path
locationIdstringrequired

locationId to use

storageIdstringrequired

StorageId to use

measurementIdstringrequired

Unique identifier of the measurement

Bodyapplication/json
typestring
Default "STANDARD_DIP"
Enum"STANDARD_DIP""PRE_DIP""POST_DIP"
timestampstring(date-time)

RFC3339 date time of the measurement

quantityLitresnumber
curl -i -X PUT \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/fuel/locations/{locationId}/storages/{storageId}/measurement/{measurementId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "STANDARD_DIP",
    "timestamp": "2019-08-24T14:15:22Z",
    "quantityLitres": 0
  }'

Responses

Successful Operation

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

Create/update measurements for storages in bulk

Request

Submits up to 10000 measurements in one request, each naming its own location and storage. Any invalid record rejects the whole batch and stores nothing. Accepted records are applied to the storages by a daily process, so they are not immediately queryable — which is why a successful submission is 202 rather than 200.

Security
M2X_auth_application
Bodyapplication/jsonrequiredArray [
idstringrequired

Your identifier for the measurement

Example: "D001"
locationIdstringrequired

The M2X id of the location holding the storage

Example: "L001"
storageIdstringrequired

The M2X id of the storage the measurement was taken from

Example: "S001"
typestringrequired
Enum"STANDARD_DIP""PRE_DIP""POST_DIP"
timestampstring(date-time)required

RFC3339 date time of the measurement

quantityLitresnumber>= 0required
]
curl -i -X POST \
  https://developer.m2x.app/_mock/apis/publicapi/openapi/fuel/measurements/bulk \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "id": "D001",
      "locationId": "L001",
      "storageId": "S001",
      "type": "STANDARD_DIP",
      "timestamp": "2019-08-24T14:15:22Z",
      "quantityLitres": 0
    }
  ]'

Responses

Batch accepted for deferred application

Bodyapplication/json
successboolean
acceptedinteger

Number of measurements accepted for deferred application

resultsArray of objects(FuelStorageMeasurementBulkResult)
Response
application/json
{ "success": true, "accepted": 0, "results": [ { … } ] }

Upsert Delivery RequestDeprecated

Request

Please use /fuel/bulkTankDeliveryRequests/{deliveryRequestId} instead

Security
M2X_auth_application
Path
deliveryRequestIdstringrequired

The unique delivery requests 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
tanksArray of objects(CarrierTankMappingRequest)required
One of:

Mapping for a delivery to a standard (non sold-as) tank

tanks[].​tankNamestring
tanks[].​tankIdstring

M2X internal tank id

tanks[].​integrationIdstring
tanks[].​quantitynumber

The product quantity. For a pump-from-drum product this is a count of drums and must be a whole number.

Default 0
tanks[].​forecastboolean

When true, the quantity provided is ignored and M2X forecasted volume is applied to the tank

tanks[].​fixedboolean

When true, the delivery quantity is fixed and cannot be changed

tanks[].​productobject(CarrierProductMappingRequest)required

Parameters to try to map a product with M2X

tanks[].​product.​productCodeNamestring
tanks[].​product.​productCodeIdstring
tanks[].​product.​integrationIdstring
externalIdstring
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

targetDatestring(date)(DynamicFulfilmentTargetDate)

The target date for the delivery

shortNotestring(DynamicFulfilmentShortNote)

a short note for the delivery, going to the driver

officeNotesstring(DynamicFulfilmentOfficeNotes)

an office note for the delivery, not going to the driver

propertiesobject or null(CustomProperties)

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

metadataobject or null(Metadata)

Opaque passenger data

readonlyFieldsobject or null

Specifies which field should not be touched by the user

associationConstraintsArray of objects(AssociationConstraint)
curl -i -X PUT \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/fuel/deliveryRequests/{deliveryRequestId}' \
  -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
    },
    "tanks": [
      {
        "tankName": "string",
        "tankId": "string",
        "integrationId": "string",
        "quantity": 0,
        "forecast": true,
        "fixed": true,
        "product": {
          "productCodeName": "string",
          "productCodeId": "string",
          "integrationId": "string"
        }
      }
    ],
    "externalId": "string",
    "priority": "LOW",
    "orderDay": "2019-08-24",
    "targetDate": "2019-08-24",
    "shortNote": "string",
    "officeNotes": "string",
    "properties": null,
    "metadata": null,
    "readonlyFields": {
      "deleted": false,
      "customer": false,
      "location": false,
      "priority": false,
      "properties": false,
      "externalId": false
    },
    "associationConstraints": [
      {
        "operation": "LOADING",
        "entities": [
          "VEHICLE"
        ],
        "conditionType": "REQUIRE",
        "constraintLabelId": "string"
      }
    ]
  }'

Responses

Successful Operation

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

Fulfilment Requests

Fulfilment request on carriers

OperationsWebhooks

General Consignments

General consignments

Operations

ISO containers

ISO containers information

Operations

Jobs

Vehicle units of work

Operations

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

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