NAV Navbar
shell
  • Introduction
  • Authentication
  • Lookups
  • Errors
  • Orders
  • Introduction

    Welcome to the XPO Logistics Connect API documenation.

    Authentication

    To authorize, use this code:

    # With shell, you can just pass the correct header with each request
    curl "https://login.authxpo.com/connect/token"
      -d "grant_type=client_credentials&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&scope=connect-orders"
    

    JSON Response:

    {
      "access_token":"ACCESS_TOKEN",
      "expires_in":3600,
      "token_type":"Bearer"
    }
    

    The XPO API is JSON based. In order to make an authenticated call to the API, you must include your access token with the call.

    Registering Appliction

    In order to use the XPO API, you must be a current XPO partner. To request access to the API please contact your XPO represenative.

    Your XPO representative, will provide you with two keys:

    Lookups

    Business Units

    The following are the valid values for business unit

    Value Description
    BR Brokerage
    IM Intermodal
    LM Last Mile
    LTL Less Than Truckload

    Errors

    The Connect API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is not formatted correctly.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The API you are trying to access is not available with the current API key.
    404 Not Found -- The specified entity could not be found.
    422 Validation Error -- One or more values in the request are not valid.
    406 Not Acceptable -- You requested a format that isn't json.
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

    Orders

    Create Authenticated Tracking Uri

    curl "https://api.connectxpo.com/orders/<ID>/authenticted-tracking-uri?bu=<BU>"
      -X POST
      -H "Authorization: Bearer ACCESS_TOKEN"
    

    JSON Response:

    {
      "orderId": 'ORDER_ID',
      "uri" : "https://track.xpo.com/?orderid=..."
    }
    

    This endpoint can be used to generate an authentucated URI for the XPO Logistics tracking page

    HTTP Request

    POST https://api.connectxpo.com/orders/<ID>/authenticated-tracking-uri?bu=<BU>

    URL Parameters

    Parameter Description Valid Values
    ID The id of the order -
    BU The business unit the order belongs to Business Units