e-Courier API Reference

Reference Information for Developing Custom Integrations with the e-Courier System

e-Courier JSON Endpoints

The endpoints listed here are specified with an example base URL. Each e-Courier customer has a designated base URL that will be provided when the system is initially enabled for API processing.

Post URL:

http://post.example.e-courier.com/example/software/xml/ecJsonPost.asmx/Login

This endpoint generates a UserGUID access token from a username and password. This can be used to generate a new UserGUID if a previous token has expired. UserGUID access tokens are refreshed each time they are used, but if they are not used for over 20 days, then they may expire. In some cases a UserGUID may be provided directly to trading partners. If this is the case, then use of the Login endpoint may not be required. Instead, the RefreshGUID endpoint may be used to ensure an access token does not expire.

Example Post:

{

      "website": "example",

      "username": "user1",

      "password": "pass1"

}

Example Response:

{

      "status": "0",

      "UserGUID": "{011114A4-5391-46E0-B576-9835485F5731}"

}

Post URL:

http://post.example.e-courier.com/example/software/xml/ecJsonPost.asmx/SaveOrder

This endpoint allows trading partners to create orders or update orders in the e-Courier system. Please review the Order object model below to determine which fields are required and which fields are available. Once an order has been created, it can then be retrieved via the GetOrder endpoint, or updated by calling the SaveOrder endpoint again.  

Example Post:

{

"Order": {

"CustomerCode": "Alpha",

"Service": "Route",

"Auth": "1234779",

"Pieces": {

"Piece": {

"Sequence": "1",

"Reference": "test1234barcode",

"Pieces": "1"

}

},

"Stops": {

"Stop": [{

"Sequence": "1",

"StopType": "P",

"ScheduledDateTime": "11/13/2019 6:00:00 AM",

"Name": "James Madison",

"Address": "2251 Orange Blossom Trail",

"City": "Orlando",

"State": "FL",

"Zip": "32804",

"Country": "USA",

"Phone": "3015551212",

"ScheduledDateTimeTZ": "EST",

"OrderStopPieces": {

"OrderStopPiece": {

"PieceAction": "P",

"Sequence": "1"

}

}

},

{

"Sequence": "2",

"StopType": "D",

"ScheduledDateTime": "11/13/2019 5:00:00 PM",

"Name": "Bryan Moore",

"Address": "2253 Orange Blossom Trail",

"City": "Orlando",

"State": "FL",

"Zip": "32804",

"Country": "USA",

"Phone": "3015551212",

"ScheduledDateTimeTZ": "EST",

"OrderStopPieces": {

"OrderStopPiece": {

"PieceAction": "D",

"Sequence": "1"

}

}

}

]

}

}

}

Example Response:

{

      "status": "0",

      "UserGUID": "JSON Post Recieved"

}

http://post.example.e-courier.com/example/software/xml/ecJsonPost.asmx/GetOrder

The GetOrder endpoint allows a trading party to get an entire order JSON object. This object will include all of the data pertaining to that order as described below in the Order object description. This data can be parsed to evaluated events and milestones on the order and determine the status of each stop and piece. Additionally, signature information will be returned as base64 encoded objects.

Example Post:

{

      "OrderNumber": "5648172"

}

Example Response:

{

    {
"Order": {
"UserGUID": "{00000000-0000-0000-0000-000000000000}",
"OrderID": "5648172",
"SiteID": "1",
"SiteCode": "SiteCodeOne",
"OrderNumber": "5648172",
"OrderStatus": "N",
"CustomerID": "689",
"CreateDate": "12/1/2017 3:48:00 PM",

}…

The order response is truncated for readability.

http://post.example.e-courier.com/example/software/xml/ecJsonPost.asmx/RefreshGUID

This endpoint refreshes a UserGUID access token. A UserGUID will expire after 20 days if it is not used. If you are calling e-Courier endpoints more frequently than once every 20 days, then the UserGUID will never need to be refeshed. Once refreshed, a UserGUID will remain active again for another 20 days. Alternatively, a new UserGUID can be generated using the Login endpoint with the assigned username and password. The UserGUID to refresh is read from the HTTP host header "UserGUID" and the actual post body is ignored.

Example Post:

{

      "UserGUID": "011114A4-5391-46E0-B576-9835485F5731"

}

Example Response:

{

      "status": "0",

      "UserGUID": "{011114A4-5391-46E0-B576-9835485F5731}"

}

http://post.example.e-courier.com/example/software/xml/ecJsonPost.asmx/QuoteOrder

This endpoint allows trading partners to query an e-Courier system for pricing an availability. The body of this post is identical to the SaveOrder submission, but instead of actually creating the order, a quote is returned.

Example Post:

{
  "Order": {
    "CustomerCode": "Alpha",
    "Service": "Route",
    "Auth": "1234779",
    "Pieces": {
      "Piece": {
        "Sequence": "1",
        "Reference": "test1234barcode",
        "Pieces": "1"
      }
    },
    "Stops": {
      "Stop": {
        "Sequence": "1",
        "StopType": "P",
        "ScheduledDateTime": "11/13/2019 6:00:00 AM",
        "Name": "James Madison",
        "Address": "2251 Orange Blossom Trail",
        "City": "Orlando",
        "State": "FL",
        "Zip": "32804",
        "Country": "USA",
        "Phone": "3015551212",
        "ScheduledDateTimeTZ": "EST",
        "OrderStopPieces": {
          "OrderStopPiece": {
            "PieceAction": "P",
            "Sequence": "1"
          }
        }
      },
      "Stop": {
        "Sequence": "2",
        "StopType": "D",
        "ScheduledDateTime": "11/13/2019 5:00:00 PM",
        "Name": "Bryan Moore",
        "Address": "2253 Orange Blossom Trail",
        "City": "Orlando",
        "State": "FL",
        "Zip": "32804",
        "Country": "USA",
        "Phone": "3015551212",
        "ScheduledDateTimeTZ": "EST",
        "OrderStopPieces": {
          "OrderStopPiece": {
            "PieceAction": "D",
            "Sequence": "1"
           }
         }
       }
     }
   }
}

Example Response:

{

  "Order": {
    "CustomerID": "1900",
    "Service": "Route",
    "Caller": "ECAPI",
    "CallerPhone": "7708802337",
    "Notes": "Test Order Notes.",
    "CallerEmail": "[email protected]",
    "TaskID": "1",
    "CompleteOrder": "1",
    "Description": "Order Description",
    "ReadyDateTime": "12/05/2020 09:00",
    "DueDateTime": "12/05/20 11:00",
    "AmountCharged": "$40.00",
    "DriverCode": "",
    "Pieces": {

      "Piece": {        

        "Sequence": "1",
        "Reference": "test1234barcode",
        "Pieces": "1"
      }

Object Descriptions

Field Definitions

Response Status Codes

SOAP/XML API Documentation

SOAP XML API documentation is available here. This documentation is provided to for reference to those implementing a SOAP/XML integration. This documentation also includes samples and example code and testing tools for interacting with e-Courier XML endpoints.