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

Get carrier orders

Request

Security
M2X_auth_application
Query
createdFromstring(date-time)required

Range creation date from

createdTostring(date-time)required

Range creation date to

curl -i -X GET \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/orders?createdFrom=2019-08-24T14%3A15%3A22Z&createdTo=2019-08-24T14%3A15%3A22Z' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/jsonArray [
orderIdstring
deletedboolean
canceledboolean
cancellationNotesstring or null
Default null
cancellationReasonstring or null
Default null
agentAgent Details (object) or null
One of:
attachmentsArray of objects(CarrierAttachment)
bookingIdstring or null
Default null
customerBookingIdstring or null
Default null
bookingEntityIdstring
carrierIdstring
consignmentIdstring or null
customerIdstring

Internal ID of the customer associated with this order

customerExternalIdstring or null

External ID of the customer associated with this order

customerIntegrationIdstring or null

Integration ID of the customer associated with this order

customerNamestring or null

Name of the customer associated with this order

createdstring(date-time)
createdBystring or null

The name of the user who created the order

updatedstring(date-time)
externalIdstring or null
externalNotestring or null
largeContractIdstring or null
productCodestring or null

M2X internal tracking id for the product code used

Default null
productCodeNamestring or null

M2X name for the product code used

Default null
productCodeExternalIdstring or null

External Id for product tracking

Default null
propertiesobject or null

A key value store containing custom properties

Default null
productComponentsArray of ProductComponent (objects) or null

The sub components of the product if present

One of:

The sub components of the product if present

quantitynumber

The product quantity

Default 0
legsArray of objects(CarrierOrderLeg)
fromLocationTask Location (object) or null
One of:
toLocationTask Location (object) or null
One of:
defaultLegBranchesArray of objects(Branch)

The branches that will be applied to the legs of the order by default. When a leg is created, all of the defaultLegBranches will be applied to the branches field of the leg. Updating the defaultLegBranches will not update the branches field of existing legs.

billingEntityIdstringDeprecated

Legacy field for customerId

]
Response
application/json
[ { "orderId": "string", "deleted": true, "canceled": true, "cancellationNotes": null, "cancellationReason": null, "agent": { … }, "attachments": [ … ], "bookingId": null, "customerBookingId": null, "billingEntityId": "string", "bookingEntityId": "string", "carrierId": "string", "consignmentId": "string", "customerId": "string", "customerExternalId": "string", "customerIntegrationId": "string", "customerName": "string", "created": "2019-08-24T14:15:22Z", "createdBy": "string", "updated": "2019-08-24T14:15:22Z", "externalId": "string", "externalNote": "string", "largeContractId": "string", "productCode": null, "productCodeName": null, "productCodeExternalId": null, "properties": null, "productComponents": [ … ], "quantity": 0, "legs": [ … ], "fromLocation": { … }, "toLocation": { … }, "defaultLegBranches": [ … ] } ]

Get a carrier order by id

Request

Security
M2X_auth_application
Path
orderIdstringrequired

Internal M2X order id

curl -i -X GET \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/orders/{orderId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/json
orderIdstring
deletedboolean
canceledboolean
cancellationNotesstring or null
Default null
cancellationReasonstring or null
Default null
agentAgent Details (object) or null
One of:
attachmentsArray of objects(CarrierAttachment)
bookingIdstring or null
Default null
customerBookingIdstring or null
Default null
bookingEntityIdstring
carrierIdstring
consignmentIdstring or null
customerIdstring

Internal ID of the customer associated with this order

customerExternalIdstring or null

External ID of the customer associated with this order

customerIntegrationIdstring or null

Integration ID of the customer associated with this order

customerNamestring or null

Name of the customer associated with this order

createdstring(date-time)
createdBystring or null

The name of the user who created the order

updatedstring(date-time)
externalIdstring or null
externalNotestring or null
largeContractIdstring or null
productCodestring or null

M2X internal tracking id for the product code used

Default null
productCodeNamestring or null

M2X name for the product code used

Default null
productCodeExternalIdstring or null

External Id for product tracking

Default null
propertiesobject or null

A key value store containing custom properties

Default null
productComponentsArray of ProductComponent (objects) or null

The sub components of the product if present

One of:

The sub components of the product if present

quantitynumber

The product quantity

Default 0
legsArray of objects(CarrierOrderLeg)
fromLocationTask Location (object) or null
One of:
toLocationTask Location (object) or null
One of:
defaultLegBranchesArray of objects(Branch)

The branches that will be applied to the legs of the order by default. When a leg is created, all of the defaultLegBranches will be applied to the branches field of the leg. Updating the defaultLegBranches will not update the branches field of existing legs.

billingEntityIdstringDeprecated

Legacy field for customerId

Response
application/json
{ "orderId": "string", "deleted": true, "canceled": true, "cancellationNotes": null, "cancellationReason": null, "agent": { "email": "string", "uid": "string", "phone": "string", "name": "string", "externalId": "string" }, "attachments": [ { … } ], "bookingId": null, "customerBookingId": null, "billingEntityId": "string", "bookingEntityId": "string", "carrierId": "string", "consignmentId": "string", "customerId": "string", "customerExternalId": "string", "customerIntegrationId": "string", "customerName": "string", "created": "2019-08-24T14:15:22Z", "createdBy": "string", "updated": "2019-08-24T14:15:22Z", "externalId": "string", "externalNote": "string", "largeContractId": "string", "productCode": null, "productCodeName": null, "productCodeExternalId": null, "properties": null, "productComponents": [ { … } ], "quantity": 0, "legs": [ { … } ], "fromLocation": { "addressText": "string", "latitude": 0, "longitude": 0, "locationName": "string", "locationId": "string", "externalId": "string", "timezone": "Pacific/Auckland", "properties": null }, "toLocation": { "addressText": "string", "latitude": 0, "longitude": 0, "locationName": "string", "locationId": "string", "externalId": "string", "timezone": "Pacific/Auckland", "properties": null }, "defaultLegBranches": [ { … } ] }

Update/create carrier order by ID

Request

Security
M2X_auth_application
Path
orderIdstringrequired

M2X order id

Bodyapplication/jsonrequired

Create or update an order

orderobject(CarrierOrderRequest)required
order.​orderIdstringrequired
order.​externalIdstring
order.​externalNotestring
order.​bookingIdstring
order.​customerBookingIdstring
order.​largeContractIdstring
order.​quantitynumberrequired

The product quantity

Default 0
order.​propertiesobject or null

A key value store containing custom properties

Default null
order.​metadataobject or null

A key value store containing metadata

Default null
order.​fromReferencestring
order.​fromDateAndTimeConstraintobject(DateAndTimeConstraint)
order.​toReferencestring
order.​toDateAndTimeConstraintobject(DateAndTimeConstraint)
order.​shortNotestring
order.​multidayboolean
mappingRequestsobject(CarrierOrderMappingRequests)required
mappingRequests.​customerobject(CarrierCustomerMappingRequest)required

Parameters to try to map a customer with M2X

mappingRequests.​customer.​customerNamestring
Example: "Fruit World"
mappingRequests.​customer.​customerIdstring
Example: "Yc7cXUulBhMM58iuOQce"
mappingRequests.​customer.​externalIdstring
Example: "FTW"
mappingRequests.​customer.​integrationIdstring
Example: "C99"
mappingRequests.​contentobject or null(CarrierContentMappingRequest)

Specific information about the content carted

mappingRequests.​productobject(CarrierProductMappingRequest)required

Parameters to try to map a product with M2X

mappingRequests.​product.​productCodeNamestring
mappingRequests.​product.​productCodeIdstring
mappingRequests.​product.​integrationIdstring
mappingRequests.​fromLocationobject(CarrierLocationMappingRequest)required

Parameters to try to map a location with M2X

mappingRequests.​fromLocation.​locationIdstring or null

M2X internal tracking id for the location code used

Default null
Example: "C6mruxd3AVUTW14vEZ0v"
mappingRequests.​fromLocation.​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"
mappingRequests.​fromLocation.​externalIdstring or null

External Id

Default null
Example: "WHC6"
mappingRequests.​fromLocation.​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"
mappingRequests.​fromLocation.​latitudenumber
Default 0
Example: -36.983882
mappingRequests.​fromLocation.​longitudenumber
Default 0
Example: 174.709879
mappingRequests.​fromLocation.​locationNameResolutionEnabledboolean

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

Default false
mappingRequests.​fromLocation.​saveIfUnknownboolean

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

Default false
mappingRequests.​toLocationobject(CarrierLocationMappingRequest)required

Parameters to try to map a location with M2X

mappingRequests.​toLocation.​locationIdstring or null

M2X internal tracking id for the location code used

Default null
Example: "C6mruxd3AVUTW14vEZ0v"
mappingRequests.​toLocation.​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"
mappingRequests.​toLocation.​externalIdstring or null

External Id

Default null
Example: "WHC6"
mappingRequests.​toLocation.​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"
mappingRequests.​toLocation.​latitudenumber
Default 0
Example: -36.983882
mappingRequests.​toLocation.​longitudenumber
Default 0
Example: 174.709879
mappingRequests.​toLocation.​locationNameResolutionEnabledboolean

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

Default false
mappingRequests.​toLocation.​saveIfUnknownboolean

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

Default false
mappingRequests.​defaultLegBranchesArray of objects(CarrierBranchMappingRequest)

The branches that will be applied to the legs of the order by default. When a leg is created, all of the defaultLegBranches will be applied to the branches field of the leg. Updating the defaultLegBranches will not update the branches field of existing legs.

curl -i -X PUT \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/orders/{orderId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "order": {
      "orderId": "string",
      "externalId": "string",
      "externalNote": "string",
      "bookingId": "string",
      "customerBookingId": "string",
      "largeContractId": "string",
      "quantity": 0,
      "properties": null,
      "metadata": null,
      "fromReference": "string",
      "fromDateAndTimeConstraint": {
        "date": "2019-08-24",
        "timezone": "Pacific/Auckland",
        "timeConstraint": {}
      },
      "toReference": "string",
      "toDateAndTimeConstraint": {
        "date": "2019-08-24",
        "timezone": "Pacific/Auckland",
        "timeConstraint": {}
      },
      "shortNote": "string",
      "multiday": true
    },
    "mappingRequests": {
      "customer": {
        "customerName": "Fruit World",
        "customerId": "Yc7cXUulBhMM58iuOQce",
        "externalId": "FTW",
        "integrationId": "C99"
      },
      "content": null,
      "product": {
        "productCodeName": "string",
        "productCodeId": "string",
        "integrationId": "string"
      },
      "fromLocation": {
        "locationId": "C6mruxd3AVUTW14vEZ0v",
        "addressText": "123 Example Road, Auckland 1010",
        "externalId": "WHC6",
        "locationName": "Auckland Storage 1",
        "latitude": -36.983882,
        "longitude": 174.709879,
        "locationNameResolutionEnabled": false,
        "saveIfUnknown": false
      },
      "toLocation": {
        "locationId": "C6mruxd3AVUTW14vEZ0v",
        "addressText": "123 Example Road, Auckland 1010",
        "externalId": "WHC6",
        "locationName": "Auckland Storage 1",
        "latitude": -36.983882,
        "longitude": 174.709879,
        "locationNameResolutionEnabled": false,
        "saveIfUnknown": false
      },
      "defaultLegBranches": [
        {
          "branchId": "string",
          "externalId": "string",
          "branchName": "string"
        }
      ]
    }
  }'

Responses

Successful operation

Bodyapplication/json
orderIdstring
Example: "ABC123-Ilon3tVMlqfCVLC8wZFy-1698357659017"
Response
application/json
{ "orderId": "ABC123-Ilon3tVMlqfCVLC8wZFy-1698357659017" }

Delete a carrier order by ID

Request

Security
M2X_auth_application
Path
orderIdstringrequired

M2X order id

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

Responses

Successful Operation

Bodyapplication/json
orderIdstring
Example: "ABC123-example-1737580145879"
Response
application/json
{ "orderId": "ABC123-example-1737580145879" }

get order attachment by Id

Request

Security
M2X_auth_application
Path
orderIdstringrequired

M2X order id

attachmentIdstringrequired

The Attachment Id

curl -i -X GET \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/orders/{orderId}/attachment/{attachmentId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/octet-stream
string(binary)
Response
No content

Upload order attachment

Request

Security
M2X_auth_application
Path
orderIdstringrequired

M2X order ID

attachmentIdstringrequired

The Attachment ID. Accepts A–Z a–z 0–9 - _ . ! ~ * ' ( )

Bodymultipart/form-datarequired

Attachment file

attachmentstring(binary)required

Supported content types: application/pdf, image/jpeg, image/png

curl -i -X PUT \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/orders/{orderId}/attachment/{attachmentId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F attachment=string

Responses

Attachment uploaded successfully

Response
No content

Delete order attachment

Request

Security
M2X_auth_application
Path
orderIdstringrequired

M2X order ID

attachmentIdstringrequired

The Attachment ID

curl -i -X DELETE \
  'https://developer.m2x.app/_mock/apis/publicapi/openapi/orders/{orderId}/attachment/{attachmentId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Attachment deleted successfully

Response
No content

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

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