NAV undefined
undefined
vb python java javascript cSharp

Introduction

Lyons Commercial Data web services are hosted in secure and fully redundant data centers to provide near real-time account ownership, account status verification and validation of important transaction processing information.

Applications accessing Lyons Commercial Data web services support both XML (SOAP) and Representational State Transfer (REST) to process information requests to and from the Lyons Commercial Data servers via https:// for SSL encryption.

*All testing should be performed in the DEMO environment. Any test transactions sent to production may incur transaction fees.

Error handling for Rest:

Here’s are list of code's returned:

200 Response is OK.

500 Internal server error. Usually we would return the payload from the service on error and it will describe the error results.

// Following payload is received for 500 level error codes for institution not found 

{
  "errorMessage": "No financial institutions found",
  "institutions": null
}

//  Following payload is received for bad parameters.

{
  "errorMessage": "Bad params!"
}

// For Session expire following response is returned

{
  "errorMessage": "Logon session expired!"
}

Authentication

Each web service requires authentication, providing a secure connection between the client and Lyons Commercial Data servers. A company ID, username and password are required to access Lyons Commercial Data web services.

To receive a company ID, username and password, please complete the trial request form or contact an account representative.

Base Service URL

Please use the base URL that you are subscribed to for Authentication. Example if subscribed to OFAC service

Logon


 Sub Main(args As String())
 '''''''''' Replace service url in below code with your service that you subscribed to in below bash command.
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest//Logon"
        Dim inputJson As String = "{""companyId"":""XXXXX"", ""userName"":""XXXXX"",""password"":""XXXXXXX""}"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
 // Replace service URL in below code with your service that you subscribed  in below Python code.
  serviceUrl = https://lyonsreg.com/webservices/aba/ABAServiceWCF.svc/rest/Logon
import requests
data = {
  "companyId":"0000",
  "userName":"loginName",
  "password":"pwd"
}
response = requests.post(
  serviceUrl,
  json=data)
public abstract class AbstractServiceCall {

    protected String login(RestTemplate rt, LogonProperties loginProps) throws StopProcesingException {
        LogonRequest req = new LogonRequest();
        req.setCompanyId(loginProps.getCompanyId());
        req.setUserName(loginProps.getUserName());
        req.setPassword(loginProps.getPassword());
        message("Logging in with companyId={} and userName={}", loginProps.getCompanyId(),
                loginProps.getUserName());
        String token = null;
        try {
            LogonResult res = rt.postForObject("/logon", req, LogonResult.class);
            message("Executed the Logon request, the result is {}null", res == null ? "" : "not ");
            Assert.notNull(res, "The response is null");
            token = res.getToken();
            Assert.notNull(token, "The returned token is null");
            message("The token is: {}", token);
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError logging on to the service", ex, true);
        } catch (Exception e) {
            handleError("\nError communication to the service", e.getMessage(), true);
        }
        return token;
    }

    protected void message(String template, Object... args) {
        String msg = MessageFormatter.arrayFormat(template, args).getMessage();
        System.out.println(msg);
    }

    protected void handleError(String msg, String errorMessage, boolean rethrow) throws StopProcesingException {
        String resMsg = MessageFormatter.arrayFormat("{}{}{}", new String[] { msg, errorMessage == null ? " - " : ": ",
                errorMessage == null ? "got a REST exception" : errorMessage }).getMessage();
        System.out.println(resMsg);
        if (rethrow) {
            throw new StopProcesingException();
        }
    }

    protected void handleRestException(String msg, HttpServerErrorException ex, boolean rethrow)
            throws StopProcesingException {
        String res = null;
        try {
            String obj = ex.getResponseBodyAsString();
            ObjectMapper om = new ObjectMapper();
            ErrorResult err = om.readValue(obj, ErrorResult.class);
            res = err.getErrorMessage();
        } catch (Exception e) {
        }
        handleError(msg, res, rethrow);
    }

}
$(function () {
// please use URL for the service you have subscribed to
    var serviceUrl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc"
    var url = serviceUrl + "/rest/Logon";
    var postObj = {"companyId":"0000", "userName":"loginName","password":"pwd"};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
   // please use URL for the service you have subscribed to
    var serviceUrl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc"
    var apiurl = serviceUrl + "/rest/Logon";
    var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
    httpWebRequest.ContentType = "application/json";
    httpWebRequest.Method = "POST";

    using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
    {
        string json = new JavaScriptSerializer().Serialize(new
                    {
                        companyId = "0000",
                        userName = "loginName",
                        password = "pwd"
                    });

        streamWriter.Write(json);
    }

    var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
    using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
    {
        var result = streamReader.ReadToEnd();
    }

The returned JSON is structured like this:

{
  "errorMessage": null,
  "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

This method is used to authenticate a client/customer. A companyId, userName and password will be provided by Lyons. The call returns an entity containing a unique session token that will expire after 20 minutes of inactivity.

It is recommended to cache this token and keep it alive by calling the RequiredLogon method asynchronously every 15 minutes for as long as needed. If the RequiredLogon method returns true, the Logon method should be called again and the token re-cached.

This approach allows for fast service transactions (as the Logon and Logoff calls are not part of the overall transaction) and minimizes the load to the service.

HTTP Request

POST {base-url}/rest/Logon

Request

Parameter Type Description
companyId integer The ID of the company the user is associated with
userName string the full username
password string the full password

Response

Parameter Type Description
token string The session token used to access the service methods

RequiredLogon

Sub Main(args As String())
''''''''''' Replace service url in below code with your service that you subscribed to in below VB code.
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/aba/ABAServiceWCF.svc/rest/RequiredLogon"

        Dim inputJson As String = "{""token"":""2274e0da-a70f-4f06-8304-c0938c4c6f75""}"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()

        End If
    End Sub
import requests
// Replace service url in below code with your service that you subscribed  in below Python code.
  serviceUrl = https://lyonsreg.com/webservices/aba/ABAServiceWCF.svc/rest/RequiredLogon
data = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}
response = requests.post(serviceUrl, json=data)
    protected boolean login(RestTemplate rt, String token) throws StopProcesingException {
        TokenRequest req = new TokenRequest(token);
        boolean res = true;
        try {
            BooleanResult resObj = rt.postForObject("/logon", req, BooleanResult.class);
            Assert.notNull(resObj, "The response is null");
            res = resObj.isValue();
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError logging on to the service", ex, true);
        } catch (Exception e) {
            handleError("\nError communication to the service", e.getMessage(), true);
        }
        return res;
    }
$(function () {
   // please use URL for the service you have subscribed to
    var serviceUrl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc"
    var url = serviceUrl + "/rest/RequiredLogon";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
  // please use URL for the service you have subscribed to
    var serviceUrl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc"
    var apiurl = serviceUrl + "/rest/RequiredLogon";
    var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
    httpWebRequest.ContentType = "application/json";
    httpWebRequest.Method = "POST";

    using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
    {
        string json = new JavaScriptSerializer().Serialize(new
                    {
                        token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    });

        streamWriter.Write(json);
    }

    var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
    using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
    {
        var result = streamReader.ReadToEnd();
    }

The returned JSON is structured like this:

{
  "errorMessage": null,
  "value": true
}

This method does not have to be called to use the web services. It is available for client applications to determine if the session has expired.

HTTP Request

POST {base-url}/rest/RequiredLogon

Request

Parameter Type Description
token string the session token returned by the Logon call

Response

Parameter Type Description
value string The activity status of the token

Logoff

   Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/aba/ABAServiceWCF.svc/rest/Logoff"

        Dim inputJson As String = "{""token"":""xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx""}"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()

        End If
    End Sub
import requests
data = {
  "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
response = requests.post(
  'https://lyonsreg.com/webservices/aba/ABAServiceWCF.svc/rest/Logoff',
  json=data)
$(function () {
    var url = "https://lyonsreg.com/webservices/aba/ABAServiceWCF.svc/rest/Logoff";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
    var apiurl = "https://lyonsreg.com/webservices/aba/ABAServiceWCF.svc/rest/Logoff";
    var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
    httpWebRequest.ContentType = "application/json";
    httpWebRequest.Method = "POST";

    using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
    {
        string json = new JavaScriptSerializer().Serialize(new
                    {
                        token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    });

        streamWriter.Write(json);
    }

    var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
    using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
    {
        var result = streamReader.ReadToEnd();
    }

This method is used to logoff from an authenticated login.

This approach allows for fast service transactions (as the Logon and Logoff calls are not part of the overall transaction) and minimizes the load to the service.

HTTP Request

POST {base-url}/rest/Logoff

Request

Parameter Type Description
token string The session token used to access the service methods

Account Ownership and Status Verification

/**
 *
 *    You can find fully functional example client project here.
 *    Unzip the file and follow the instructions in the ReadMe.txt in the main folder.
 *
 */
/**
 *    You can download the binary form of the necessary Lyons Commons library here
 *    and AOA library here, and upload them in your Maven repository.
 *
 *    Alternatively, you can build the libraries from the respective projects:
 *        Lyons Commons library project is here
 *        AOA  library project is here
 *
 *    You can find fully functional example client project here.
 *  Unzip the file and follow the instructions in the ReadMe.txt in the main folder.
 *
 *  Alternatively, Upload the binary form of the libraries  here
 *
 */

This web service returns a code and/or message to help you determine whether to Accept or Deny a payment transaction for a submitted checking or savings account number.

This web service returns a single, primary financial institution with detailed information for a submitted 9-digit bank routing number. Lyons will first verify the bank routing number as eligible by applying the industry standard Mod10 algorithm. Upon satisfying this requirement, Lyons will determine the existence of the routing/account number, and if found, will then verify the ownership and status of the account as being open and in good standing.

You will be able to download the AOA sample test accounts by clicking here.

Response Codes

Code Message
-999 AOA Service failed
-70 Account Ownership details Missing
-71 The First Name is not provided
-72 The Last Name is not provided
-73 Either Business Name or First/Last Name must be provided
-75 SSN length must be 4 or 9 digits
-76 Date Of Birth must be 8 characters in length
-77 Date Of Birth must be numeric
-78 ID Type value must be one character in length.
-79 Internal AOA failure.
-63 ~ -61 Communication Error
-54 Your AOA account preferences are not configured
-53 Customer Present value must be 0 or 1.
-52 Customer Present value must be one character in length.
-51 Customer Present value must be numeric.
-43 Invalid Amount field.
-42 Amount value length (only digits including the cents) exceeds maximum of 12 characters.
-41 Amount value must be numeric.
-33 Account Number length must be 1 to 17 characters long.
-31 Account Number value must be numeric.
-30 Account Number must be entered.
-22 ABA Number must be exactly 9 digits.
-21 ABA value must be numeric.
-20 ABA value must be entered.
-2 Inquiry field length too short.
-3 Inquiry field length too long.
-4 Populated with improper data type or value.
-5 Amount value cannot be zero or less than 0.01
101 Accept
103 Deny
104 Deny
198 No Account Experience Available
199 Insufficient info to make a decision

CheckAccountStatusWithDates

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckAccountStatusWithDates"

        Dim inputJson As String = "{""token"":""xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"",    
        ""returnDetails"":"XX",""accountStatusRequest"":{""aba"":""xxxxxxxxx"", ""account"":""58004820"", ""amount"":""132.45"", ""customerPresent"":""0"" , ""country"":""US""}}"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()

        End If
    End Sub
import requests
data = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "returnDetails": "XXXX", "accountStatusRequest": { "rtn": "XXXX",
  "accountNo": "XXXX",
  "customerPresent": "XXXX",
  "amount": "XXXX",
  "denyNsf": "XXXX",
  "country": "XXXX"
   } 
}
response = requests.post('https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckAccountStatusWithDates', json=data)
/**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "CheckAccountStatusWithDates"
     * @param aoa The aoa to search
     * @throws StopProcesingException
     */
    public String call(RestTemplate rt, String token, String returnDetails, AccountStatusRequest accountStatusRequest)
            throws StopProcesingException {
        CheckAccountStatuseq = new CheckAccountStatusWithDates(token, returnDetails, accountStatusRequest);
        DetailedStatusCodeResultWithDates res = null;
        try {
            res = rt.postForObject("/".concat(method), req, DetailedStatusCodeResultWithDates.class);
            Assert.notNull(res, "The returned DetailedStatusCodeResultWithDates is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the AOA service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the AOA service 2", e.getMessage(), false);
        }
        return res.getStatusCode();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckAccountStatusWithDates";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "returnDetails": "XXXX", "accountStatusRequest": { "rtn": "XXXX",
  "accountNo": "XXXX",
  "customerPresent": "XXXX",
  "amount": "XXXX",
  "denyNsf": "XXXX",
  "country": "XXXX"
   } 
};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckAccountStatusWithDates";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
       {token:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
       returnDetails: "XXXX",accountStatusRequest: { rtn: "XXXX",
       accountNo: "XXXX",customerPresent: "XXXX",amount: "XXXX",denyNsf: "XXXX",country: "XXXX"
       }});
  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": "Communication Error(ABA)",
  "statusCode": 199
}

Return the status code of an account from the AOA network.

HTTP Request

POST {base-url}/rest/CheckAccountStatusWithDates

Request

Parameter Type Description Field Status
token string The session token returned by the Logon call Mandatory field
returnDetails string Provide 1 or true to return primary institution details.Provide 0 or false if you do not require primary institution details. Optional field
accountStatusRequest Object Account status request details Mandatory object
rtn string The routing number to search Mandatory field
accountNo string The account number at the financial institution Mandatory field
amount string The amount of the transaction.Format(no commas):NNN0.00 Optional field
customerPresent string Flag whether the client is present at time of request (provide 1 or 0) Optional field
denyNsf string Flag to deny non sufficient funds (provide 1 or 0) Optional field
country string Two character country code. Optional field
accountOwner Object Do not provide this object.

Response

Parameter Type Description
statusCode number Numeric representation of account verification
statusDescription string Description of status code representation of both Account status and Ownership Verification
validRtn boolean True if the provided routing number is verified.
primaryInstitution Object Primary financial institution if requested.
name string Complete name of the financial institution
address string Physical address line
city string City
state string State
postalCode string Address postal code
country string Two character country code.
phone string Main phone number
lastUpdate string Approximately how long ago the Account was updated
addClosedDate string Approximately how long ago a closed date was added to the Account

Error Messages

Message Description
No Access User does not have access to this product
Internal Error Internal Application Error, contact system admin
Internal Error(Configuration) No Vendor has been set for this customer product
Communication Error(ABA) Error communicating with ABA web service

CheckOverallAccountStatusWithOwnershipInfo

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckOverallAccountStatusWithOwnershipInfo"

        Dim inputJson As String = "{""token"":""xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"",    
        ""returnDetails"":"XX",""accountStatusRequest"":{""aba"":""xxxxxxxxx"", ""account"":""58004820"", ""amount"":""132.45"", ""customerPresent"":""0"" , ""country"":""US"",""accountOwner"":{ ""firstName"":""xxxxxxxxx"", ""lastName"":""XXXXX"", ""middleName"":""132.45"", ""namePfx"":""0"",""nameSfx"":""xxxxxxxxx"", ""businessName"":""XXXXX"", ""address1"":""132.45"", ""address2"":""0"" , ""city"":""132.45"", ""state"":""0"",""zip"":""xxxxxxxxx"", ""ssn"":""XXXXX"", ""dob"":""132.45"", ""idType"":""1"",""idNo"":""1"", ""idState"":""TX""}},
        }"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()

        End If
    End Sub
import requests
data = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "returnDetails": "XXXX", "accountStatusRequest": { "rtn": "XXXX",
  "accountNo": "XXXX",
  "customerPresent": "XXXX",
  "amount": "XXXX",
  "denyNsf": "XXXX",
  "country": "XXXX",
  "accountOwner": 
       {
        "firstName": "XXXX",
        "lastName": "XXXX",
        "middleName": "XXXX",
        "namePfx": "XX",
        "nameSfx": "XXXX",
        "businessName": "XXXX",
        "address1": "XXXX",
        "address2": "XXXX",
        "city": "XXXX",
        "state": "XXXX",
        "zip": "XXXX",
        "ssn": "XXXX",
        "dob": "XXXX",
        "idType": "XXXX",
        "idNo": "XXXX",
        "idState": "XXXX" 
     } 
   } 
}
response = requests.post('https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckOverallAccountStatusWithOwnershipInfo', json=data)
/**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "CheckOverallAccountStatusWithOwnershipInfo"
     * @param aoa The aoa to search
     * @throws StopProcesingException
     */
    public String call(RestTemplate rt, String token, String returnDetails, AccountStatusRequest accountStatusRequest)
            throws StopProcesingException {
        CheckOverallAccountStatusWithOwnershipInfo req = new CheckOverallAccountStatusWithOwnershipInfo(token, returnDetails, accountStatusRequest);
        StatusCodeResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, StatusCodeResult.class);
            Assert.notNull(res, "The returned StatusCodeResult is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the AOA service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the AOA service 2", e.getMessage(), false);
        }
        return res.getStatusCode();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckOverallAccountStatusWithOwnershipInfo";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "returnDetails": "XXXX", "accountStatusRequest": { "rtn": "XXXX",
  "accountNo": "XXXX",
  "customerPresent": "XXXX",
  "amount": "XXXX",
  "denyNsf": "XXXX",
  "country": "XXXX",
  "accountOwner": 
       {
        "firstName": "XXXX",
        "lastName": "XXXX",
        "middleName": "XXXX",
        "namePfx": "XX",
        "nameSfx": "XXXX",
        "businessName": "XXXX",
        "address1": "XXXX",
        "address2": "XXXX",
        "city": "XXXX",
        "state": "XXXX",
        "zip": "XXXX",
        "ssn": "XXXX",
        "dob": "XXXX",
        "idType": "XXXX",
        "idNo": "XXXX",
        "idState": "XXXX" 
     } 
   } 
};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckOverallAccountStatusWithOwnershipInfo";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
       {token:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
       returnDetails: "XXXX",accountStatusRequest: { rtn: "XXXX",
       accountNo: "XXXX",customerPresent: "XXXX",amount: "XXXX",denyNsf: "XXXX",country: "XXXX",
       accountOwner: {firstName: "XXXX",lastName: "XXXX", middleName: "XXXX",namePfx: "XX",
       nameSfx: "XXXX",businessName: "XXXX",address1: "XXXX",address2: "XXXX",city: "XXXX",
       state: "XXXX",zip: "XXXX",ssn: "XXXX",dob: "XXXX",idType: "XXXX",idNo: "XXXX",
       idState: "XXXX"}}});
  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": "",
  "statusCode": 101,
  "validRtn": true,
  "overallStatusCode": 101,
  "businessOrFullNameMatch": "Y",
  "firstNameMatch": "U",
  "lastNameMatch": "U",
  "cityMatch": "Y",
  "stateMatch": "Y",
  "zipMatch": "Y",
  "ssnOrDobMatch": "Y",
  "idMatch": "U",
  "primaryInstitution": {
    "Address": "XXXXXXXXXXXXXXX",
    "City": "XXXX",
    "Country": "US",
    "Name": "XXXXXX_XXXXXX",
    "Phone": "301-602-XXXX",
    "PostalCode": "XXXXX-0000",
    "State": "MD"
  },
  "lastUpdate": "6 months",
  "addClosedDate": "6 months"
}

Returns both Account status code and Account Ownership Status code for an account from the AOA network.

HTTP Request

POST {base-url}/rest/CheckOverallAccountStatusWithOwnershipInfo

Request

Parameter Type Description Field Status
token string The session token returned by the Logon call Mandatory field
returnDetails string Provide 1 or true to return primary institution details.Provide 0 or false if you do not require primary institution details. Optional field
accountStatusRequest Object Account status request details Mandatory object
rtn string The routing number to search Mandatory field
accountNo string The account number at the financial institution Mandatory field
amount string The amount of the transaction.Format(no commas):NNN0.00 Optional field
customerPresent string Flag whether the client is present at time of request (provide 1 or 0) Optional field
denyNsf string Flag to deny non sufficient funds (provide 1 or 0) Optional field
country string Two character country code. Optional field
accountOwner Object Account Owner details Mandatory object
firstName string The first name of the Account owner Mandatory field if Business Name not provided
lastName string The last name of the Account owner Mandatory field if Business Name not provided
middleName string The middle name of the Account owner Optional field
namePfx string The Name Prefix Optional field
nameSfx string The Name Suffix Optional field
businessName string The Business Name of Account owner Mandatory field if First Name and Last name not provided
address1 string The Address Line 1 of Account owner Optional field
address2 string The Address Line 2 of Account owner Optional field
city string The City of Account owner Optional field
state string The State abbreviation of the Account owner Optional field
zip string The zip of the Account owner. Format: NNNNN[-NNNN] Optional field
ssn string The SSN of the Account owner Optional field
dob string The date of birth of the Account owner. Format: YYYYMMDD Optional field
idType string The Valid ID Types Optional field**1
idNo string The ID Number Optional field
idState string The ID state abbreviation Optional field

Notes: * 1 - Valid ID Types are

ID Types Value Description
0 Drivers License USA
1 Military USA
2 Passport
3 Resident Alien ID
4 State identification
5 Student identification
6 Drivers License foreign
7 Drivers License Canada
8 Drivers License Mexico
9 Other primary ID foreign
A Matricula Consular card
B South America Cedula

Response

Parameter Type Description
statusCode number Numeric representation of account verification
validRtn boolean True if the provided routing number is verified.
ownershipStatusCode number Numeric representation of account Ownership verification
overallStatusCode number Numeric representation of combined status(Account status and Ownership) verification
businessOrFullNameMatch string Indicates if Business or full name is matched
firstNameMatch string Indicates if first name is matched
lastNameMatch string Indicates if last name is matched
cityMatch string Indicates if city name is matched
stateMatch string Indicates if state name is matched
zipMatch string Indicates if zip code is matched
ssnMatch string Indicates if ssn is matched
dobMatch string Indicates if date of birth is matched
idMatch string Indicates if id is matched
primaryInstitution Object Primary financial institution if requested.
name string Complete name of the financial institution
address string Physical address line
city string City
state string State
postalCode string Address postal code
country string Two character country code.
phone string Main phone number
lastUpdate string Approximately how long ago the Account was updated
addClosedDate string Approximately how long ago a closed date was added to the Account

Error Messages

Message Description
No Access User does not have access to this product
Internal Error Internal Application Error, contact system admin
Internal Error(Configuration) No Vendor has been set for this customer product
Communication Error(AOA) Error communicating with AOA web service

CheckAccountOwnershipDetailsWithDates

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckAccountOwnershipDetailsWithDates"

        Dim inputJson As String = "{""token"":""xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"",    
        ""returnDetails"":"XX",""accountStatusRequest"":{""aba"":""xxxxxxxxx"", ""account"":""58004820"", ""amount"":""132.45"", ""customerPresent"":""0"" , ""country"":""US"",""accountOwner"":{ ""firstName"":""xxxxxxxxx"", ""lastName"":""XXXXX"", ""middleName"":""132.45"", ""namePfx"":""0"",""nameSfx"":""xxxxxxxxx"", ""businessName"":""XXXXX"", ""address1"":""132.45"", ""address2"":""0"" , ""city"":""132.45"", ""state"":""0"",""zip"":""xxxxxxxxx"", ""ssn"":""XXXXX"", ""dob"":""132.45"", ""idType"":""1"",""idNo"":""1"", ""idState"":""TX""}},
        }"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()

        End If
    End Sub
import requests
data = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "returnDetails": "XXXX", "accountStatusRequest": { "rtn": "XXXX",
  "accountNo": "XXXX",
  "customerPresent": "XXXX",
  "amount": "XXXX",
  "denyNsf": "XXXX",
  "country": "XXXX",
  "accountOwner": 
       {
        "firstName": "XXXX",
        "lastName": "XXXX",
        "middleName": "XXXX",
        "namePfx": "XX",
        "nameSfx": "XXXX",
        "businessName": "XXXX",
        "address1": "XXXX",
        "address2": "XXXX",
        "city": "XXXX",
        "state": "XXXX",
        "zip": "XXXX",
        "ssn": "XXXX",
        "dob": "XXXX",
        "idType": "XXXX",
        "idNo": "XXXX",
        "idState": "XXXX" 
     } 
   } 
}
response = requests.post('https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckAccountOwnershipDetailsWithDates', json=data)
/**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "CheckAccountOwnershipDetailsWithDates"
     * @param aoa The aoa to search
     * @throws StopProcesingException
     */
    public String call(RestTemplate rt, String token, String returnDetails, AccountStatusRequest accountStatusRequest)
            throws StopProcesingException {
        CheckAccountOwnershipDetailsWithDates req = new CheckAccountOwnershipDetailsWithDates(token, returnDetails, accountStatusRequest);
        StatusCodeResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, StatusCodeResult.class);
            Assert.notNull(res, "The returned StatusCodeResult is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the AOA service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the AOA service 2", e.getMessage(), false);
        }
        return res.getStatusCode();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckAccountOwnershipDetailsWithDates";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "returnDetails": "XXXX", "accountStatusRequest": { "rtn": "XXXX",
  "accountNo": "XXXX",
  "customerPresent": "XXXX",
  "amount": "XXXX",
  "denyNsf": "XXXX",
  "country": "XXXX",
  "accountOwner": 
       {
        "firstName": "XXXX",
        "lastName": "XXXX",
        "middleName": "XXXX",
        "namePfx": "XX",
        "nameSfx": "XXXX",
        "businessName": "XXXX",
        "address1": "XXXX",
        "address2": "XXXX",
        "city": "XXXX",
        "state": "XXXX",
        "zip": "XXXX",
        "ssn": "XXXX",
        "dob": "XXXX",
        "idType": "XXXX",
        "idNo": "XXXX",
        "idState": "XXXX" 
     } 
   } 
};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/aoa/AOAServiceWCF.svc/rest/CheckAccountOwnershipDetailsWithDates";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
       {token:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
       returnDetails: "XXXX",accountStatusRequest: { rtn: "XXXX",
       accountNo: "XXXX",customerPresent: "XXXX",amount: "XXXX",denyNsf: "XXXX",country: "XXXX",
       accountOwner: {firstName: "XXXX",lastName: "XXXX", middleName: "XXXX",namePfx: "XX",
       nameSfx: "XXXX",businessName: "XXXX",address1: "XXXX",address2: "XXXX",city: "XXXX",
       state: "XXXX",zip: "XXXX",ssn: "XXXX",dob: "XXXX",idType: "XXXX",idNo: "XXXX",
       idState: "XXXX"}}});
  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": "",
  "statusCode": 101,
  "validRtn": true,
  "businessOrFullNameMatch": "Y",
  "firstNameMatch": "U",
  "lastNameMatch": "U",
  "cityMatch": "Y",
  "stateMatch": "Y",
  "zipMatch": "Y",
  "ssnOrDobMatch": "Y",
  "idMatch": "U",
  "primaryInstitution": {
    "Address": "XXXXXXXXXXXXXXX",
    "City": "XXXX",
    "Country": "US",
    "Name": "XXXXXX_XXXXXX",
    "Phone": "301-602-XXXX",
    "PostalCode": "XXXXX-0000",
    "State": "MD"
  },
  "lastUpdate": "6 months",
  "addClosedDate": "6 months"
}

Returns both Account status code and Account Ownership Status code for an account from the AOA network.

HTTP Request

POST {base-url}/rest/CheckAccountOwnershipDetailsWithDates

Request

Parameter Type Description Field Status
token string The session token returned by the Logon call Mandatory field
returnDetails string Provide 1 or true to return primary institution details.Provide 0 or false if you do not require primary institution details. Optional field
accountStatusRequest Object Account status request details Mandatory object
rtn string The routing number to search Mandatory field
accountNo string The account number at the financial institution Mandatory field
amount string The amount of the transaction.Format(no commas):NNN0.00 Optional field
customerPresent string Flag whether the client is present at time of request (provide 1 or 0) Optional field
denyNsf string Flag to deny non sufficient funds (provide 1 or 0) Optional field
country string Two character country code. Optional field
accountOwner Object Account Owner details Mandatory object
firstName string The first name of the Account owner Mandatory field if Business Name not provided
lastName string The last name of the Account owner Mandatory field if Business Name not provided
middleName string The middle name of the Account owner Optional field
namePfx string The Name Prefix Optional field
nameSfx string The Name Suffix Optional field
businessName string The Business Name of Account owner Mandatory field if First Name and Last name not provided
address1 string The Address Line 1 of Account owner Optional field
address2 string The Address Line 2 of Account owner Optional field
city string The City of Account owner Optional field
state string The State abbreviation of the Account owner Optional field
zip string The zip of the Account owner. Format: NNNNN[-NNNN] Optional field
ssn string The SSN of the Account owner Optional field
dob string The date of birth of the Account owner. Format: YYYYMMDD Optional field
idType string The Valid ID Types Optional field**1
idNo string The ID Number Optional field
idState string The ID state abbreviation Optional field

Notes: * 1 - Valid ID Types are

ID Types Value Description
0 Drivers License USA
1 Military USA
2 Passport
3 Resident Alien ID
4 State identification
5 Student identification
6 Drivers License foreign
7 Drivers License Canada
8 Drivers License Mexico
9 Other primary ID foreign
A Matricula Consular card
B South America Cedula

Response

Parameter Type Description
statusCode number Numeric representation of account verification
validRtn boolean True if the provided routing number is verified.
businessOrFullNameMatch string Indicates if Business or full name is matched
firstNameMatch string Indicates if first name is matched
lastNameMatch string Indicates if last name is matched
cityMatch string Indicates if city name is matched
stateMatch string Indicates if state name is matched
zipMatch string Indicates if zip code is matched
ssnMatch string Indicates if ssn is matched
dobMatch string Indicates if date of birth is matched
idMatch string Indicates if id is matched
primaryInstitution Object Primary financial institution if requested.
name string Complete name of the financial institution
address string Physical address line
city string City
state string State
postalCode string Address postal code
country string Two character country code.
phone string Main phone number
lastUpdate string Approximately how long ago the Account was updated
addClosedDate string Approximately how long ago a closed date was added to the Account

Error Messages

Message Description
No Access User does not have access to this product
Internal Error Internal Application Error, contact system admin
Internal Error(Configuration) No Vendor has been set for this customer product
Communication Error(AOA) Error communicating with AOA web service

OFAC

/**
 *
 *    You can find fully functional example client project here.
 *    Unzip the file and follow the instructions in the ReadMe.txt in the main folder.
 *
 */
/**
 *    You can download the binary form of the necessary Lyons Commons library here
 *    and OFAC library here, and upload them in your Maven repository.
 *
 *    Alternativelly, you can build the libraries from the respectiv projects:
 *        Lyons Commons library project is here
 *        OFAC  library project is here
 *
 *    You can find fully functional example client project here.
 *  Unzip the file and follow the instructions in the ReadMe.txt in the main folder.
 *
 *  Alternativelly, Upload the binary form of the libraries  here
 */

Returns results for a name scanned against the OFAC list This web service cross-references a submitted name against the Office of Foreign Asset Controls (OFAC) SDN watch list, the Bureau of Industry and Security (BIS) Denied Persons list, and the new Non-SDN list (NS-PLC). The function returns any potential matches along with a score, indicating the likelihood of an actual match. Lyons will scan the Specially Designated Nations (SDN) and the Bureau of Industry and Security (BIS) Denied Person List for your submitted names and/or country. The results are returned with a weighted score, aliases, the entity type and the list(s) where the name was found.

OFACLogonScanName

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACLogonScanName"
        Dim inputJson As String = "{""companyId"":""xxxxxxxx"",    ""userName"":""xxxxxxxxx"", ""password"":""XXXXXXXX"", ""name"":""XXXXXX"" }"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {"companyId":"0000", "userName":"loginName","password":"pwd", "name":"testName"}
response = requests.post('https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACLogonScanName', json=data)
/**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "OFACLogonScanName"
     * @param ofac The ofac to search
     * @throws StopProcesingException
     */
    public List<Entity> call(RestTemplate rt, String companyID, String method, String userName, String password, String name)
            throws StopProcesingException {
        OFACLogonScanNameRequest req = new OFACLogonScanNameRequest(companyID, userName, password, name);
        EntityListResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, EntityListResult.class);
            Assert.notNull(res, "The returned EntityListResult is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the OFAC service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the OFAC service 2", e.getMessage(), false);
        }    
        return res.getEntities();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACLogonScanName";
    var postObj = {"companyId":"0000", "userName":"loginName","password":"pwd", "name":"testName"};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACLogonScanName";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          companyId:"0000",
          userName:"loginName",
          password:"pwd",
          name:"testName"
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": null,
  "entities": [
    {
      "entityNumber": 12071,
      "fullName": "HAAMI",
      "entityType": "vessel",
      "country": "",
      "listType": "sdn",
      "guid": "f67926ed-79b8-4fd8-b30f-d47b5032a23c",
      "score": 80
    },
    {
      "entityNumber": 15051,
      "fullName": "HAMOON",
      "entityType": "fka",
      "country": "",
      "listType": "sdn",
      "guid": "f67926ed-79b8-4fd8-b30f-d47b5032a23c",
      "score": 84.21052631578948
    }
  ]
}

OFAC Logon to service and checks an individuals name or company's name against the Office of Foreign Assets Controls (OFAC) SDN watch list, Bureau of Industry and Security (BIS) Denied Persons list and the Non-SDN list (NS-PLC).

HTTP Request

POST {base-url}/rest/OFACLogonScanName

Request

Parameter Type Description
companyId int The ID of the company the user is associated with
userName string the full username
password string the full password
name string full name for search query

Response

Parameter Type Description
entityNumber integer A unique number within the list or index of results list. Two records having the same entityNumber means the has addresses in two different countries or an entity has an alternative identity - the entity is known by another name).
fullname string The full name of the entity.
nameForProcessing string The adjusted entity name that was used for matching.
nameInAscii string The ASCII equivalent of the name.
entityType string Identifies the entity as a person, business, vessel, etc.
country string Two character country code.
listType string The list in which it appears. Abbreviations may be used, e.g. "SDN" for "Specially Designated Nationals", "bis_dpl" for "Denied Persons List", "PLC" for "Palestinian Legislative Council", etc.
guid string A temporary globally unique identifier for referencing this entity. This identifier will changes hourly.
score double An indicator with values between 80 and 100 of the matching likelihood.

Error Messages

Message Description
Internal system error - 67 Internal system error, please contact system admin
Must pass a name when searching. Empty search name

OFACScanName

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanName"
        Dim inputJson As String = "{""token"":""xxxxxxxx"", ""name"":""XXXXXX"" }"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name":"testName"}
response = requests.post('https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanName', json=data)
/**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "OFACScanName"
     * @param ofac The ofac to search
     * @throws StopProcesingException
     */
    public List<Entity> call(RestTemplate rt, String token, String method, String name)
            throws StopProcesingException {
        OFACScanNameRequest req = new OFACScanNameRequest(token, name);
        EntityListResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, EntityListResult.class);
            Assert.notNull(res, "The returned EntityListResult is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the OFAC service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the OFAC service 2", e.getMessage(), false);
        }    
        return res.getEntities();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanName";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name":"testName"};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanName";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          name:"testName"
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": null,
  "entities": [
    {
      "entityNumber": 12071,
      "fullName": "HAAMI",
      "entityType": "vessel",
      "country": "",
      "listType": "sdn",
      "guid": "f67926ed-79b8-4fd8-b30f-d47b5032a23c",
      "score": 80
    },
    {
      "entityNumber": 15051,
      "fullName": "HAMOON",
      "entityType": "fka",
      "country": "",
      "listType": "sdn",
      "guid": "f67926ed-79b8-4fd8-b30f-d47b5032a23c",
      "score": 84.21052631578948
    }
  ]
}

Checks an individuals name or company's name against the Office of Foreign Assets Controls (OFAC) SDN watch list, Bureau of Industry and Securitys (BIS) Denied Persons list and the Non-SDN list (NS-PLC).

HTTP Request

POST {base-url}/rest/OFACScanName

Request

Parameter Type Description
token string the session token returned by the Logon call
name string full name for search query

Response

Parameter Type Description
entityNumber integer A unique number within the list or index of results list. Two records having the same entityNumber means the has addresses in two different countries or an entity has an alternative identity - the entity is known by another name).
fullname string The full name of the entity.
nameForProcessing string The adjusted entity name that was used for matching.
nameInAscii string The ASCII equivalent of the name.
entityType string Identifies the entity as a person, business, vessel, etc.
country string Two character country code.
listType string The list in which it appears. Abbreviations may be used, e.g. "SDN" for "Specially Designated Nationals", "bis_dpl" for "Denied Persons List", "PLC" for "Palestinian Legislative Council", etc.
guid string A temporary globally unique identifier for referencing this entity. This identifier will changes hourly.
score double An indicator with values between 80 and 100 of the matching likelihood.

Error Messages

Message Description
Internal system error - 89 Internal system error, please contact system admin
Must pass a name when searching. Empty search name

OFACScanCountry

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanCountry"
        Dim inputJson As String = "{""token"":""xxxxxxxx"", ""name"":""XXXXXX"", ""country"":""UNITED STATES"" }"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name":"testName", "country":"UNITED STATES"}
response = requests.post('https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanCountry', json=data)
/**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "OFACScanCountry"
     * @param ofac The ofac to search
     * @throws StopProcesingException
     */
    public List<Entity> call(RestTemplate rt, String token, String method, String name, STring country)
            throws StopProcesingException {
        OFACScanCountryRequest req = new OFACScanCountryRequest(token, name, country);
        EntityListResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, EntityListResult.class);
            Assert.notNull(res, "The returned EntityListResult is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the OFAC service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the OFAC service 2", e.getMessage(), false);
        }    
        return res.getEntities();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanCountry";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name":"testName", "country":"UNITED STATES"};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanCountry";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          name:"testName",
          country:"UNITED STATES"
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": null,
  "entities": [
    {
      "entityNumber": 12071,
      "fullName": "HAAMI",
      "entityType": "vessel",
      "country": "",
      "listType": "sdn",
      "guid": "f67926ed-79b8-4fd8-b30f-d47b5032a23c",
      "score": 80
    },
    {
      "entityNumber": 15051,
      "fullName": "HAMOON",
      "entityType": "fka",
      "country": "",
      "listType": "sdn",
      "guid": "f67926ed-79b8-4fd8-b30f-d47b5032a23c",
      "score": 84.21052631578948
    }
  ]
}

Checks an individuals name or company's name along with country against the Office of Foreign Assets Controls (OFAC) SDN watch list, Bureau of Industry and Security (BIS) Denied Persons list and the Non-SDN list (NS-PLC).

HTTP Request

POST {base-url}/rest/OFACScanCountry

Request

Parameter Type Description
token string the session token returned by the Logon call
name string full name for search query
country string Two character country code.

Response

Parameter Type Description
entityNumber integer A unique number within the list or index of results list. Two records having the same entityNumber means the has addresses in two different countries or an entity has an alternative identity - the entity is known by another name).
fullname string The full name of the entity.
nameForProcessing string The adjusted entity name that was used for matching.
nameInAscii string The ASCII equivalent of the name.
entityType string Identifies the entity as a person, business, vessel, etc.
country string Two character country code.
listType string The list in which it appears. Abbreviations may be used, e.g. "SDN" for "Specially Designated Nationals", "bis_dpl" for "Denied Persons List", "PLC" for "Palestinian Legislative Council", etc.
guid string A temporary globally unique identifier for referencing this entity. This identifier will changes hourly.
score double An indicator with values between 80 and 100 of the matching likelihood.

Error Messages

Message Description
Internal system error - 162 Internal system error, please contact system admin
Internal system error - 163 Internal system error, please contact system admin
Internal system error - 214 Error looking up country name
Internal system error - 240 Error looking up country code
Must pass either a name and/or a valid country name or its 2-letter code when searching. [XX] is not a valid country code. Invalid country code
Must pass a name when searching. Empty search name
Must pass either a name and/or a valid country name or its 2-letter code when searching invalid search parameters

GetCountryList

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/GetCountryList"
        Dim inputJson As String = "{""token"":""xxxxxxxx"", ""name"":""XXXXXX"", ""country"":""UNITED STATES"" }"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name":"testName", "country":"US"}
response = requests.post('https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/GetCountryList', json=data)
/**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "GetCountryList"
     * @param ofac The ofac to search
     * @throws StopProcesingException
     */
    public List<Contry> call(RestTemplate rt, String token, String method)
            throws StopProcesingException {
        TokenRequest req = new TokenRequest(token);
        CountryListResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, CountryListResult.class);
            Assert.notNull(res, "The returned CountryListResult is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the OFAC service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the OFAC service 2", e.getMessage(), false);
        }    
        return res.getCountries();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/GetCountryList";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/GetCountryList";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": null,
  "countries": [
    {
      "code": "AF",
      "name": "AFGHANISTAN"
    },
    {
      "code": "AL",
      "name": "ALBANIA"
    },
    {
      "code": "DZ",
      "name": "ALGERIA"
    },
    {
      "code": "AO",
      "name": "ANGOLA"
    },
    {
      "code": "AR",
      "name": "ARGENTINA"
    },
    {
      "code": "AM",
      "name": "ARMENIA"
    },
    {
      "code": "AW",
      "name": "ARUBA"
    }
  ]
}

Returns a list of countries from the OFAC database.

HTTP Request

POST {base-url}/rest/GetCountryList

Request

Parameter Type Description
token string the session token returned by the Logon call

Response

Parameter Type Description
code integer Country 2 letter code
name string Full country name

Error Messages

Message Description
Internal system error - 187 Internal system error, please contact system admin
Internal system error - 188 Internal system error, please contact system admin

OFACScanNameFullRecord

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanNameFullRecord"
        Dim inputJson As String = "{""token"":""xxxxxxxx"", ""name"":""XXXXXX"", ""country"":""UNITED STATES"" }"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name":"testName", "country":"UNITED STATES"}
response = requests.post('https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanNameFullRecord', json=data)
/**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "OFACScanCountry"
     * @param ofac The ofac to search
     * @throws StopProcesingException
     */
    public List<FullEntity> call(RestTemplate rt, String token, String method, String name, STring country)
            throws StopProcesingException {
        OFACScanNameFullRecordRequest req = new OFACScanNameFullRecordRequest(token, name, country);
        FullEntityListResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, FullEntityListResult.class);
            Assert.notNull(res, "The returned EntityListResult is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the OFAC service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the OFAC service 2", e.getMessage(), false);
        }    
        return res.getEntities();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanNameFullRecord";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name":"testName", "country":"UNITED STATES"};
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/ofac/OFACServiceWCF.svc/rest/OFACScanNameFullRecord";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          name:"testName",
          country:"UNITED STATES"
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": null,
  "entities": [
    {
            "entityNumber": 419265,
            "fullName": "Khalil Ben Ahmed Ben Mohamed Jarraya",
            "entityType": "Individual",
            "country": "Italy",
            "listType": null,
            "guid": "14d10643-ae9b-4e94-9b9b-311c3f47f531",
            "score": 100,
            "program": null,
            "remarks": "Legal Basis: 787/2010 (OJ L234); 76/2006 (OJ L12) | Reg Date: 2010-09-03; 2006-01-18",
            "sdnType": null,
            "title": null,
            "callSign": null,
            "vessType": null,
            "vessTonnage": null,
            "vessGRT": null,
            "vessFlag": null,
            "vessOwner": null,
            "dob": "1970-08-XX",
            "passport": "K989895",
            "additionalAddress": [
                {
                    "address": null,
                    "city": "Nuoro",
                    "state": null,
                    "postalCode": null,
                    "country": "Italy",
                    "addrRemarks": null
                }
            ],
            "additionalAlias": [
                {
                    "fullName": "Khalil Yarraya",
                    "entType": "AKA",
                    "remarks": "Legal Basis: 2145/2004 (OJ L370) | Reg Date: 2004-12-17"
                },
                {
                    "fullName": "Ben Narvan Abdel Aziz",
                    "entType": "AKA",
                    "remarks": "Legal Basis: 2145/2004 (OJ L370) | Reg Date: 2004-12-17"
                },
                {
                    "fullName": "Amro",
                    "entType": "AKA",
                    "remarks": "Legal Basis: 76/2006 (OJ L12) | Reg Date: 2006-01-18"
                },
                {
                    "fullName": "Omar",
                    "entType": "AKA",
                    "remarks": "Legal Basis: 76/2006 (OJ L12) | Reg Date: 2006-01-18"
                },
                {
                    "fullName": "Amrou",
                    "entType": "AKA",
                    "remarks": "Legal Basis: 76/2006 (OJ L12) | Reg Date: 2006-01-18"
                },
                {
                    "fullName": "Amr",
                    "entType": "AKA",
                    "remarks": "Legal Basis: 76/2006 (OJ L12) | Reg Date: 2006-01-18"
                },
                {
                    "fullName": "Abdel Aziz Ben Narvan",
                    "entType": "AKA",
                    "remarks": "Legal Basis: 1291/2007 (OJ L287) | Reg Date: 2007-11-01"
                }
            ]
        }        
  ]
}

Checks an individuals name or company's name along with country against the Office of Foreign Assets Controls (OFAC) SDN watch list, Bureau of Industry and Security (BIS) Denied Persons list and the Non-SDN list (NS-PLC) and retrieve the full list information for that search.

Request

Parameter Type Description
token string the session token returned by the Logon call
name string full name for search query
country string Two character country code.

Response

Parameter Type Description
entityNumber integer A unique number within the list or index of results list. Two records having the same entityNumber means the has addresses in two different countries or an entity has an alternative identity - the entity is known by another name).
fullname string The full name of the entity.
nameForProcessing string The adjusted entity name that was used for matching.
nameInAscii string The ASCII equivalent of the name.
entityType string Identifies the entity as an individual, aircraft, vessel, etc.
country string Two character country code.
listType string The list in which it appears. Abbreviations may be used, e.g. "SDN" for "Specially Designated Nationals", "bis_dpl" for "Denied Persons List", "PLC" for "Palestinian Legislative Council", etc.
guid string A temporary globally unique identifier for referencing this entity. This identifier will changes hourly.
score double An indicator with values between 80 and 100 of the matching likelihood.
program string The name/abbreviation of the sanction program.
remarks string Additional information, if any, about the entity.
sdnType string Currently it is the same as the entityType.
title string If the entity is an individual, the individual's title.
callSign string If the entity is a vessel, the vessel's call sign.
vessType string The vessel type, e.g. "Bulk Cargo", "Container Ship", "Ferry", etc.
vessTonnage string The vessel's tonnage.
vessGRT string The vessel's gross registered tonnage.
vessFlag string The vessel's flag.
vessOwner string The vessel's owner.
dob string date of birth of the entity (blank)
passport string If an entity is an individual, this is the passport number.
additionalAddress Object List A list of addresses the entity is known to possess.
- address string The full address for the additional address.
- city string The city for the additional address.
- state string The state for the additional address.
- postalCode string The postal code for the additional address.
- country string Two character country code.
- addrRemarks string Additional information about the address.
additionalAlias Object List A list of alternative identities of the entity.
- fullName string The full name of the entity.
- entType string Identifies the entity as a person, business, vessel, etc.
- remarks string Additional information about the address.

Error Messages

Message Description
Internal system error - 167 Internal system error, please contact system admin
Internal system error - 214 Error looking up country name
Internal system error - 240 Error looking up country code
[XX] is not a valid country code. Invalid country code
Must pass a name when searching. Empty search name
Must pass either a name or a valid country name or its 2-letter code when searching invalid search parameters

RTN

/**
 *
 *    You can find fully functional example client project here.
 *    Unzip the file and follow the instructions in the ReadMe.txt in the main folder.
 *
 */
/**
 *    You can download the binary form of the necessary Lyons Commons library here
 *    and RTN library here, and upload them in your Maven repository.
 *
 *    Alternatively, you can build the libraries from the respective projects:
 *        Lyons Commons library project is here
 *        RTN  library project is here
 *    You can find fully functional example client project here.
 *  Unzip the file and follow the instructions in the ReadMe.txt in the main folder.
 *
 *  Alternativelly, Upload the binary form of the libraries  here
 */

The RTN Web Service API provides the most information about each institution including main and branch information with institution names, routing numbers, addresses, phone numbers and much more. Currently the RTN service provides information for both US and Canadian financial institutions.

Lyons will determine if the routing number is currently active, and will return the routing and demographic information for the institution associated with the searched routing number.

Check under each code language tab for example projects that demonstrate how to correctly use the web service contracts and proper configurations for the service and the method calls.

Error Messages

Message Description
Internal server error Internal Application Error, contact system admin
No financial institutions found No financial institutions found for that ABA

VerifyRTN

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/VerifyRTN"
        Dim inputJson As String = "{""token"":""xxxxxxxx"", ""rtn"":""XXXXXX"", ""country"":""UNITED STATES"", ""includeInactives"":false, ""includeHistory"":false}"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {    "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA", "includeInactives":false, "includeHistory":false }
response = requests.post('https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/VerifyRTN', json=data)
    /**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "VerifyRTN"
     * @param rtn The rtn to search
     * @param country The country code to search
     * @param includeInactives flag to determine if inactive routing numbers should be included in the search
     * @param includeHistory flag to include routing number history in search
     * @throws StopProcesingException
     */
    public Boolean call(RestTemplate rt, String token, String method, String rtn, String country, Boolean includeInactives, Boolean includeHistory)
            throws StopProcesingException {
        RtnRequest req = new RtnRequest(token, rtn, country, includeHistory);
        BooleanResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, BooleanResult.class);
            Assert.notNull(res, "The returned Boolean is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the RTN service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the RTN service 2", e.getMessage(), false);
        }
        return res.isValue();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/VerifyRTN";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA", "includeInactives":false, "includeHistory":false };
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/VerifyRTN";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          rtn = "xxxxxxxxx",
          country = "CA",
          includeInactives = false,
          includeHistory = false
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": null,
  "status": true
}

Lookup Routing Number on Lyons Server and return true if found.

HTTP Request

POST {base-url}/rest/VerifyRTN

Request

Parameter Type Description
token string the session token returned by the Logon call
rtn string routing number to search
country string Two character country code.
includeInactives boolean flag to determine if inactive routing numbers should be included in the search
includeHistory boolean flag to determine if old routing numbers should be included in search

Response

Parameter Type Description
status boolean Status of routing number

VerifyWire(RTN)

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/VerifyWire"
        Dim inputJson As String = "{""token"":""xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"", ""rtn"":""XXXXXX"", ""country"":""UNITED STATES"", ""includeInactive"":false, ""includeHistory"":false}"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {    "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA", "includeInactive":false, "includeHistory":false }
response = requests.post('https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/VerifyWire', json=data)
    /**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "VerifyWire"
     * @param rtn The rtn to search
     * @param country The country code to search
     * @param includeInactives flag to determine if inactive routing numbers should be included in the search
     * @param includeHistory flag to include routing number history in search
     * @throws StopProcesingException
     */
    public Boolean call(RestTemplate rt, String token, String method, String rtn, String country, Boolean includeInactives, Boolean includeHistory)
            throws StopProcesingException {
        RtnRequest req = new RtnRequest(token, rtn, country, includeInactives, includeHistory);
        BooleanResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, BooleanResult.class);
            Assert.notNull(res, "The returned Boolean is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the RTN service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the RTN service 2", e.getMessage(), false);
        }
        return res.isValue();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/VerifyWire";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "rtn":"xxxxxxxxx", "country":"CA", "includeInactives":false,"includeHistory":false };
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/VerifyWire";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          rtn = "xxxxxxxxx",
          country = "CA",
          includeInactives = false,
          includeHistory = false
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
  "errorMessage": null,
  "status": true
}

Lookup the Routing Number as a wire on Lyons Server and return true if found.

HTTP Request

POST {base-url}/rest/VerifyWire

Request

Parameter Type Description
token string the session token returned by the Logon call
rtn string routing number to search
country string Two character country code.
includeInactives boolean flag to determine if inactive routing numbers should be included in the search
includeHistory boolean flag to determine if old routing numbers should be included in search

Response

Parameter Type Description
status boolean Status of routing number

GetInstitutionsDetailsPrimaryFirst(RTN)

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionsDetailsPrimaryFirst"
        Dim inputJson As String = "{""token"":""xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"", ""rtn"":""XXXXXX"", ""country"":""UNITED STATES"", ""includeInactive"":false, ""includeWireSearch"":true, ""includeHistory"":false}"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {    "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA","includeInactive":true, "includeWireSearch":true, "includeHistory":true }
response = requests.post('https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionsDetailsPrimaryFirst', json=data)
    /**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "GetInstitutionsDetailsPrimaryFirst"
     * @param rtn The rtn to search
     * @param country The country code to search
     * @param includeInactives flag to determine if inactive routing numbers should be included in the search   
     * @param includeHistory flag to include routing number history in search
     * @throws StopProcesingException
     */
    public List<Institution> call(RestTemplate rt, String token, String method, String rtn, String country, Boolean includeInactive, Boolean includeWireSearch, Boolean includeHistory)
            throws StopProcesingException {
        RtnRequest req = new RtnRequest(token, rtn, country,includeInactive, includeWireSearch, includeHistory);
        InstitutionListResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, InstitutionListResult.class);
            Assert.notNull(res, "The returned Institution List is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the RTN service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the RTN service 2", e.getMessage(), false);
        }
        return res.getInstitutions();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionsDetailsPrimaryFirst";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA", "includeInactive":true,"includeWireSearch":true,"includeHistory":true };
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionsDetailsPrimaryFirst";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          rtn = "xxxxxxxxx",
          country = "CA",         
          includeInactive = true, 
          includeWireSearch: true,
          includeHistory = true
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
    "errorMessage": null,
    "institutions": [
        {
            "institutionId": 1,
            "legacyLyonsId": xxxx,
            "mainInstitutionId": null,
            "externalInstitutionId": null,
            "institutionType": "Banks",
            "name": "STATE BANK OF MISSOURI",
            "branchName": "STATE BANK OF MISSOURI",
            "addressLine1": "101 NW 2ND ST",
            "addressLine2": null,
            "city": "CONCORDIA",
            "state": "MO",
            "country": "US",
            "postalCode": "64020-0000",
            "mailingAddr": "PO BOX 819; CONCORDIA, MO 64020",
            "fedWire": false,
            "swift": "",
            "fax": "660-463-2196",
            "telex": "",
            "homePage": "www.gostatebank.com",
            "notes": "",
            "active": true,
            "branchCount": 5,
            "routingNumbers": [
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "ABA",
                    "fractional": XXXXXXXXX19",
                    "correspondent": false,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": null
                },
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "ACH",
                    "fractional": null,
                    "correspondent": false,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": null
                },
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "fractional": null,
                    "correspondent": true,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": [
                        {
                            "routingNumber": "XXXXXXXXX",
                            "purpose": "Wire",
                            "fractional": null,
                            "correspondent": true,
                            "active": true,
                            "preferred": false,
                            "useForTransactions": true,
                            "notes": null,
                            "archivedDate": "2019-04-18T15:18:15.980-04:00"
                        },
                        {
                            "routingNumber": "XXXXXXXXX",
                            "purpose": "Wire",
                            "fractional": null,
                            "correspondent": false,
                            "active": true,
                            "preferred": false,
                            "useForTransactions": true,
                            "notes": null,
                            "archivedDate": "2019-04-18T15:17:15.390-04:00"
                        }
                    ]
                }
            ],
            "contacts": [
                {
                    "contactType": "Adjust",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Customer Service",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "ACH",
                    "name": "",
                    "title": null,
                    "email": "",
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Wire",
                    "name": "",
                    "title": null,
                    "email": "",
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Institution",
                    "name": null,
                    "title": null,
                    "email": "sbminfo@gostatebank.com",
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Return",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                }
            ],
            "correspondents": [
                {
                    "correspondentInstitutionId": 1,
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "account": null,
                    "institutionName": "UMB BANK, NA",
                    "notes": null
                }
            ],
            "internationalCorrespondents": [
                {
                    "institutionName": "UMB BANK, NA",
                    "swift": "XXXXXXX",
                    "participant": true,
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "accountNumber": null
                }
            ]
        },
        {
            "institutionId": 1,
            "legacyLyonsId": 1,
            "mainInstitutionId": xxxxx,
            "externalInstitutionId": null,
            "institutionType": "Banks",
            "name": "STATE BANK OF MISSOURI",
            "branchName": "STATE BANK OF MISSOURI",
            "addressLine1": "114 S COUNTY RD",
            "addressLine2": null,
            "city": "ALMA",
            "state": "MO",
            "country": "US",
            "postalCode": "64001-0000",
            "mailingAddr": "PO BOX 199; ALMA, MO 64001",
            "fedWire": false,
            "swift": "",
            "fax": "660-674-2801",
            "telex": "",
            "homePage": "www.gostatebank.com",
            "notes": "",
            "active": true,
            "branchCount": 0,
            "routingNumbers": [
                {
                    "routingNumber": "XXXXXXXXX,
                    "purpose": "ABA",
                    "fractional": "XXXXXXXXX19",
                    "correspondent": false,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": null
                },
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "ACH",
                    "fractional": null,
                    "correspondent": false,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": null
                },
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "fractional": null,
                    "correspondent": true,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": [
                        {
                            "routingNumber": "XXXXXXXXX",
                            "purpose": "Wire",
                            "fractional": null,
                            "correspondent": true,
                            "active": true,
                            "preferred": false,
                            "useForTransactions": true,
                            "notes": null,
                            "archivedDate": "2019-04-18T15:23:21.830-04:00"
                        },
                        {
                            "routingNumber": "XXXXXXXXX",
                            "purpose": "Wire",
                            "fractional": null,
                            "correspondent": false,
                            "active": true,
                            "preferred": false,
                            "useForTransactions": true,
                            "notes": null,
                            "archivedDate": "2019-04-18T15:21:10.373-04:00"
                        }
                    ]
                }
            ],
            "contacts": [
                {
                    "contactType": "Adjust",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Customer Service",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "ACH",
                    "name": "",
                    "title": null,
                    "email": "",
                    "phoneNumber": "(XXX) 674-2216",
                    "extension": null
                },
                {
                    "contactType": "Wire",
                    "name": "",
                    "title": null,
                    "email": "",
                    "phoneNumber": "(XXX) 674-2216",
                    "extension": null
                },
                {
                    "contactType": "Institution",
                    "name": null,
                    "title": null,
                    "email": "sbminfo@gostatebank.com",
                    "phoneNumber": "(XXX) 674-2216",
                    "extension": null
                },
                {
                    "contactType": "Return",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                }
            ],
            "correspondents": [
                {
                    "correspondentInstitutionId": 86699,
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "account": null,
                    "institutionName": "UMB BANK, NA",
                    "notes": null
                }
            ],
            "internationalCorrespondents": [
                {
                    "institutionName": "UMB BANK, NA",
                    "swift": "UMKCUS44",
                    "participant": true,
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "accountNumber": null
                }
            ]
        },
    ]
}

Returns a list of financial institutions with full details for an RTN sorted by main locations first.

The mainInstitutionId attribute in the returned institution objects has the following meaning:

HTTP Request

POST {base-url}/rest/GetInstitutionsDetailsPrimaryFirst

Request

Parameter Type Description
token string the session token returned by the Logon call
rtn string routing number to search
country string Two character country code.
includeInactives boolean flag to determine if inactive routing numbers should be included in the search
includeWireSearch boolean flag to determine if Wire routing numbers should be included in the search
includeHistory boolean flag to determine if old routing numbers should be included in search

Response

Parameter Type Description
institutionId int The institution identification number associated with the institution
legacyLyonsId int The old lyons institution identification number associated with the institution
mainInstitutionId int The institution identification number associated with this institutions main branch
externalInstitutionId int The external institution identification number associated with canadian institutions which is referred to FinancialInstitutionID
institutionType string Institution Type
name string Complete name of the financial institution
branchName string individual branch name of the financial institution
address1 string Physical Address Line 1
address2 string Physical Address Line 2
city string City or Province
state string State
country string Country
postalCode string Zip Code or Postal Code
mailingAddr string Mailing Address
fedWire boolean FedWire participation indicator
swift string SWIFT identifier
fax string Main Fax Number
telex string TELEX identifier
homePage string Institutions Internet home page / URL
notes string Account Notes
active boolean Active Institution
branchCount int The number of branches as defined for Main institutions.
routingNumbers array list of routingNumber objects that are connected with this institution
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- fractional string 11 Digit Fractional code.
-- correspondent boolean If the routing number comes from a correspondent institution.
-- active boolean Indicates if the routing number used is in active state.
-- preferred boolean Indicates if the routing number used is preferred one.
-- useForTransactions boolean If this routing number is used for transactions
-- notes string Notes for particular routing number
--routingNumberHistory Array A list of previous routing numbers for this record
----routingNumber string Routing Number
---- purpose string The application of this routing number Electronic, Paper, or Wire
---- fractional string 11 Digit Fractional code.
---- correspondent boolean If the routing number comes from a correspondent institution.
----active boolean Indicates if the routing number used is in active state.
---- preferred boolean Indicates if the routing number used is preferred one.
---- useForTransactions boolean If this routing number is used for transactions
---- notes string Notes for particular routing number
---- archivedDate string The EST date and time this record was created.
contacts array list of contacts that are connected with this institution
-- contactType string Contact Type (Institution, Return, Adjust, Wire, Customer Service, ACH, Wire, OFCR)
-- name string name for contact
-- email string Primary or corporate e-mail address for contact
-- phoneNumber string phone number for contact
-- Extension string phone number Extension for contact
correspondents array list of correspondent institutions associated with this branches routing number
--correspondentInstitutionId int The institution identification number associated with the correspondent institution
-- institutionName string Institution Name
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- account string Correspondent Account Number
-- notes string Notes for particular routing number
internationalCorrespondents array list of International correspondent institutions associated with this branches routing number
-- institutionName string Institution Name
-- swift string Society for Worldwide Interbank Financial Communications.' Within the. international transfer world, SWIFT is a universal messaging system. SWIFTs are BICs. (Bank Identifier Code) connected to the S.W.I.F.T. network
-- participant boolean Indicates if the Institution is participant.
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- accountNumber string International correspondent account number.

GetInstitutionsDetailsBySwift(RTN)

Sub Main(args As String())
        Dim serviceUrl As String = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionsDetailsBySwift"
        Dim inputJson As String = "{""token"":""xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"", ""swift"":""XXXXXX"", ""country"":""US"", ""includeInactive"":false, ""includeRoutingNumberHistory"":false}"
        Dim client As New HttpClient()
        Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
        Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
        If response.IsSuccessStatusCode Then
            RestStr = response.Content.ReadAsStringAsync().Result
            Console.WriteLine(RestStr)
            Console.ReadLine()
        End If
    End Sub
import requests
data = {    "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "swift":"xxxxxxxxx", "country":"CA","includeInactive":true, "includeRoutingNumberHistory":true }
response = requests.post('https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionsDetailsBySwift', json=data)
    /**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "GetInstitutionsDetailsBySwift"
     * @param swift The swift to search
     * @param country The country code to search
     * @param includeInactives flag to determine if inactive routing numbers should be included in the search   
     * @param includeRoutingNumberHistory flag to include routing number history in search
     * @throws StopProcesingException
     */
    public List<Institution> call(RestTemplate rt, String token, String method, String swift, String country, Boolean includeInactive, Boolean includeRoutingNumberHistory)
            throws StopProcesingException {
        RtnRequest req = new RtnRequest(token, swift, country,includeInactive, includeRoutingNumberHistory);
        InstitutionListResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, InstitutionListResult.class);
            Assert.notNull(res, "The returned Institution List is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the RTN service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the RTN service 2", e.getMessage(), false);
        }
        return res.getInstitutions();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionsDetailsBySwift";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "swift":"xxxxxxxxx", "country":"CA", "includeInactive":true,"includeRoutingNumberHistory":true };
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionsDetailsBySwift";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          swift = "xxxxxxxxx",
          country = "CA",         
          includeInactive = true,
          includeRoutingNumberHistory = true
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
    "errorMessage": null,
    "institutions": [
        {
            "institutionId": 1,
            "legacyLyonsId": xxxx,
            "mainInstitutionId": null,
            "externalInstitutionId": null,
            "institutionType": "Banks",
            "name": "STATE BANK OF MISSOURI",
            "branchName": "STATE BANK OF MISSOURI",
            "addressLine1": "101 NW 2ND ST",
            "addressLine2": null,
            "city": "CONCORDIA",
            "state": "MO",
            "country": "US",
            "postalCode": "64020-0000",
            "mailingAddr": "PO BOX 819; CONCORDIA, MO 64020",
            "fedWire": false,
            "swift": "",
            "fax": "660-463-2196",
            "telex": "",
            "homePage": "www.gostatebank.com",
            "notes": "",
            "active": true,
            "branchCount": 5,
            "routingNumbers": [
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "ABA",
                    "fractional": XXXXXXXXX19",
                    "correspondent": false,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": null
                },
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "ACH",
                    "fractional": null,
                    "correspondent": false,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": null
                },
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "fractional": null,
                    "correspondent": true,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": [
                        {
                            "routingNumber": "XXXXXXXXX",
                            "purpose": "Wire",
                            "fractional": null,
                            "correspondent": true,
                            "active": true,
                            "preferred": false,
                            "useForTransactions": true,
                            "notes": null,
                            "archivedDate": "2019-04-18T15:18:15.980-04:00"
                        },
                        {
                            "routingNumber": "XXXXXXXXX",
                            "purpose": "Wire",
                            "fractional": null,
                            "correspondent": false,
                            "active": true,
                            "preferred": false,
                            "useForTransactions": true,
                            "notes": null,
                            "archivedDate": "2019-04-18T15:17:15.390-04:00"
                        }
                    ]
                }
            ],
            "contacts": [
                {
                    "contactType": "Adjust",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Customer Service",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "ACH",
                    "name": "",
                    "title": null,
                    "email": "",
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Wire",
                    "name": "",
                    "title": null,
                    "email": "",
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Institution",
                    "name": null,
                    "title": null,
                    "email": "sbminfo@gostatebank.com",
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Return",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                }
            ],
            "correspondents": [
                {
                    "correspondentInstitutionId": 1,
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "account": null,
                    "institutionName": "UMB BANK, NA",
                    "notes": null
                }
            ],
            "internationalCorrespondents": [
                {
                    "institutionName": "UMB BANK, NA",
                    "swift": "XXXXXXX",
                    "participant": true,
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "accountNumber": null
                }
            ]
        },
        {
            "institutionId": 1,
            "legacyLyonsId": 1,
            "mainInstitutionId": xxxxx,
            "externalInstitutionId": null,
            "institutionType": "Banks",
            "name": "STATE BANK OF MISSOURI",
            "branchName": "STATE BANK OF MISSOURI",
            "addressLine1": "114 S COUNTY RD",
            "addressLine2": null,
            "city": "ALMA",
            "state": "MO",
            "country": "US",
            "postalCode": "64001-0000",
            "mailingAddr": "PO BOX 199; ALMA, MO 64001",
            "fedWire": false,
            "swift": "",
            "fax": "660-674-2801",
            "telex": "",
            "homePage": "www.gostatebank.com",
            "notes": "",
            "active": true,
            "branchCount": 0,
            "routingNumbers": [
                {
                    "routingNumber": "XXXXXXXXX,
                    "purpose": "ABA",
                    "fractional": "XXXXXXXXX19",
                    "correspondent": false,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": null
                },
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "ACH",
                    "fractional": null,
                    "correspondent": false,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": null
                },
                {
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "fractional": null,
                    "correspondent": true,
                    "active": true,
                    "preferred": true,
                    "useForTransactions": true,
                    "notes": null,
                    "history": [
                        {
                            "routingNumber": "XXXXXXXXX",
                            "purpose": "Wire",
                            "fractional": null,
                            "correspondent": true,
                            "active": true,
                            "preferred": false,
                            "useForTransactions": true,
                            "notes": null,
                            "archivedDate": "2019-04-18T15:23:21.830-04:00"
                        },
                        {
                            "routingNumber": "XXXXXXXXX",
                            "purpose": "Wire",
                            "fractional": null,
                            "correspondent": false,
                            "active": true,
                            "preferred": false,
                            "useForTransactions": true,
                            "notes": null,
                            "archivedDate": "2019-04-18T15:21:10.373-04:00"
                        }
                    ]
                }
            ],
            "contacts": [
                {
                    "contactType": "Adjust",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "Customer Service",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                },
                {
                    "contactType": "ACH",
                    "name": "",
                    "title": null,
                    "email": "",
                    "phoneNumber": "(XXX) 674-2216",
                    "extension": null
                },
                {
                    "contactType": "Wire",
                    "name": "",
                    "title": null,
                    "email": "",
                    "phoneNumber": "(XXX) 674-2216",
                    "extension": null
                },
                {
                    "contactType": "Institution",
                    "name": null,
                    "title": null,
                    "email": "sbminfo@gostatebank.com",
                    "phoneNumber": "(XXX) 674-2216",
                    "extension": null
                },
                {
                    "contactType": "Return",
                    "name": null,
                    "title": null,
                    "email": null,
                    "phoneNumber": "(XXX) 463-2194",
                    "extension": null
                }
            ],
            "correspondents": [
                {
                    "correspondentInstitutionId": 86699,
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "account": null,
                    "institutionName": "UMB BANK, NA",
                    "notes": null
                }
            ],
            "internationalCorrespondents": [
                {
                    "institutionName": "UMB BANK, NA",
                    "swift": "UMKCUS44",
                    "participant": true,
                    "routingNumber": "XXXXXXXXX",
                    "purpose": "Wire",
                    "accountNumber": null
                }
            ]
        },
    ]
}

Returns a list of financial institutions with full details for an swift sorted by main locations first.

The mainInstitutionId attribute in the returned institution objects has the following meaning:

HTTP Request

POST {base-url}/rest/GetInstitutionsDetailsBySwift

Request

Parameter Type Description
token string the session token returned by the Logon call
swift string swift code to search
country string Two character country code.
includeInactives boolean flag to determine if inactive routing numbers should be included in the search
includeRoutingNumberHistory boolean flag to determine if old routing numbers should be included in search

Response

Parameter Type Description
institutionId int The institution identification number associated with the institution
legacyLyonsId int The old lyons institution identification number associated with the institution
mainInstitutionId int The institution identification number associated with this institutions main branch
externalInstitutionId int The external institution identification number associated with canadian institutions which is referred to FinancialInstitutionID
institutionType string Institution Type
name string Complete name of the financial institution
branchName string individual branch name of the financial institution
address1 string Physical Address Line 1
address2 string Physical Address Line 2
city string City or Province
state string State
country string Country
postalCode string Zip Code or Postal Code
mailingAddr string Mailing Address
fedWire boolean FedWire participation indicator
swift string SWIFT identifier
fax string Main Fax Number
telex string TELEX identifier
homePage string Institutions Internet home page / URL
notes string Account Notes
active boolean Active Institution
branchCount int The number of branches as defined for Main institutions.
routingNumbers array list of routingNumber objects that are connected with this institution
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- fractional string 11 Digit Fractional code.
-- correspondent boolean If the routing number comes from a correspondent institution.
-- active boolean Indicates if the routing number used is in active state.
-- preferred boolean Indicates if the routing number used is preferred one.
-- useForTransactions boolean If this routing number is used for transactions
-- notes string Notes for particular routing number
--routingNumberHistory Array A list of previous routing numbers for this record
----routingNumber string Routing Number
---- purpose string The application of this routing number Electronic, Paper, or Wire
---- fractional string 11 Digit Fractional code.
---- correspondent boolean If the routing number comes from a correspondent institution.
----active boolean Indicates if the routing number used is in active state.
---- preferred boolean Indicates if the routing number used is preferred one.
---- useForTransactions boolean If this routing number is used for transactions
---- notes string Notes for particular routing number
---- archivedDate string The EST date and time this record was created.
contacts array list of contacts that are connected with this institution
-- contactType string Contact Type (Institution, Return, Adjust, Wire, Customer Service, ACH, Wire, OFCR)
-- name string name for contact
-- email string Primary or corporate e-mail address for contact
-- phoneNumber string phone number for contact
-- Extension string phone number Extension for contact
correspondents array list of correspondent institutions associated with this branches routing number
--correspondentInstitutionId int The institution identification number associated with the correspondent institution
-- institutionName string Institution Name
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- account string Correspondent Account Number
-- notes string Notes for particular routing number
internationalCorrespondents array list of International correspondent institutions associated with this branches routing number
-- institutionName string Institution Name
-- swift string Society for Worldwide Interbank Financial Communications.' Within the. international transfer world, SWIFT is a universal messaging system. SWIFTs are BICs. (Bank Identifier Code) connected to the S.W.I.F.T. network
-- participant boolean Indicates if the Institution is participant.
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- accountNumber string International correspondent account number.

GetPrimaryInstitutionDetails(RTN)

Sub Main(args As String())
        Try
            Dim serviceUrl As String = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetPrimaryInstitutionDetails"

            Dim inputJson As String = "{""token"":""XXXXXXXXXXXXXX"", ""rtn"":""XXXX"", ""country"":""US"", ""includeInactive"":false, ""includeWireSearch"":true, ""includeHistory"":false}"
            Dim client As New HttpClient()
            Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
            Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
            If response.IsSuccessStatusCode Then
                RestStr = response.Content.ReadAsStringAsync().Result
                Console.WriteLine(RestStr)
                Console.ReadLine()

            End If
        Catch ex As WebException
            Console.WriteLine(ex.ToString
                                      )
        End Try
    End Sub
import requests
data = {    "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA", "includeInactive":true,includeWireSearch":true, "includeHistory":true }
response = requests.post('https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetPrimaryInstitutionDetails', json=data)
    /**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "GetPrimaryInstitutionDetails"
     * @param rtn The rtn to search
     * @param country The country code to search
     * @param includeInactive flag to determine if inactive routing numbers should be included in the search
     * @param includeWireSearch flag to determine if Wire routing numbers should be included in the search
     * @param includeHistory flag to include routing number history in search
     * @throws StopProcesingException
     */
    public Institution call(RestTemplate rt, String token, String method, String rtn, String country, Boolean includeInactive,Boolean includeWireSearch, Boolean includeHistory)
            throws StopProcesingException {
        RtnRequest req = new RtnRequest(token, rtn, country, includeInactive, includeWireSearch, includeHistory);
        InstitutionResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, InstitutionResult.class);
            Assert.notNull(res, "The returned Institution is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the RTN service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the RTN service 2", e.getMessage(), false);
        }
        return res.getInstitution();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetPrimaryInstitutionDetails";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA", "includeInactive":true,"includeWireSearch":true ,"includeHistory":true };
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetPrimaryInstitutionDetails";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          rtn = "xxxxxxxxx",
          country = "CA",
          includeInactive = true,
          includeWireSearch = true,
          includeHistory = true
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
    "errorMessage": null,
    "institutions": {
        "institutionId": 1,
        "legacyLyonsId": 1,
        "mainInstitutionId": null,
        "externalInstitutionId": null,
        "institutionType": "Banks",
        "name": "CONNECTION BANK",
        "branchName": "CONNECTION BANK",
        "address1": "636 AVE G",
        "address2": null,
        "city": "FORT MADISON",
        "state": "IA",
        "country": "US",
        "postalCode": "52627-0000",
        "mailingAddr": "PO BOX 329; FORT MADISON, IA 52627-0329",
        "fedWire": false,
        "swift": "QUCTUS41",
        "fax": "319-376-1227",
        "telex": "",
        "homePage": "www.myconnectionbank.com",
        "notes": "FORMERLY FORT MADISON BANK & TRUST CO.",
         "active": true,
        "branchCount": 241,
        "routingNumbers": [
            {
                "routingNumber": "XXXXXXXXX",
                "purpose": "ABA",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": [
                    {
                        "routingNumber": "XXXXXXXXX",
                         "purpose": "ABA",
                        "fractional": "XXXXXXXX",
                        "correspondent": false,
                        "active": true,
                        "preferred": true,
                        "useForTransactions": false,
                        "notes": null,
                        "archivedDate" :null
                    }
                ]
            },
            {
               "routingNumber": "XXXXXXXXX",
                "purpose": "ACH",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": []
            },
            {
                "routingNumber": "XXXXXXXXX",
                "purpose": "Wire",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": []
            }
        ],
        "contacts": [
            {
                "contactType": "Institution",
                "name": null,
                "title": null,
                "email": "customer.service@myconnectionbank.com",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Return",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Adjust",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Customer Service",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "ACH",
                "name": "",
                "title": null,
                "email": "",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Wire",
                "name": "",
                "title": null,
                "email": "",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            }
        ],
        "correspondents": [
            {
                "correspondentInstitutionId": 1,
                "routingNumber": "XXXXXXX",
                "purpose": null,
                "account": null,
                "institutionName": "QUAD CITY BANK & TRUST CO",
                "notes": null
            }
        ],
         "internationalCorrespondents": [
            {
               "institutionName": "UMB BANK, NA",
                "swift": "XXXXXXX",
                "participant": true,
                "routingNumber": "XXXXXXX",
                "purpose": "Wire",
                "accountNumber": null
            }
        ]
    }
}

Get primary single institution with full details for an RTN.

The mainInstitutionId attribute in the returned institution object has the following meaning:

HTTP Request

POST {base-url}/rest/GetPrimaryInstitutionDetails

Request

Parameter Type Description
token string The session token returned by the Logon call
rtn string Routing number to search
country string Country name to serach
includeInactive boolean Flag to determine if inactive routing numbers should be included in the search
includeWireSearch boolean Flag to determine if Wire routing numbers should be included in the search
includeHistory boolean Flag to determine if old routing numbers should be included in search

Response

Parameter Type Description
institutionId int The institution identification number associated with the institution
legacyLyonsId int The old lyons institution identification number associated with the institution
mainInstitutionId int The institution identification number associated with this institutions main branch
externalInstitutionId int The external institution identification number associated with canadian institutions which is referred to FinancialInstitutionID
institutionType string Institution Type
name string Complete name of the financial institution
branchName string Individual branch name of the financial institution
address1 string Physical Address Line 1
address2 string Physical Address Line 2
city string City or Province
state string State
country string Country
postalCode string Zip Code or Postal Code
mailingAddr string Mailing Address
fedWire boolean FedWire participation indicator
swift string SWIFT identifier
fax string Main Fax Number
telex string TELEX identifier
homePage string Institutions Internet home page / URL
notes string Account Notes
active boolean Active Institution
branchCount int The number of branches as defined for Main institutions.
routingNumbers array list of routingNumber objects that are connected with this institution
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- fractional string 11 Digit Fractional code.
-- correspondent boolean If the routing number comes from a correspondent institution.
-- active boolean Indicates if the routing number used is in active state.
-- preferred boolean Indicates if the routing number used is preferred one.
-- useForTransactions boolean If this routing number is used for transactions
-- notes string Notes for particular routing number
--routingNumberHistory Array A list of previous routing numbers for this record
----routingNumber string Routing Number
---- purpose string The application of this routing number Electronic, Paper, or Wire
---- fractional string 11 Digit Fractional code.
---- correspondent boolean If the routing number comes from a correspondent institution.
----active boolean Indicates if the routing number used is in active state.
---- preferred boolean Indicates if the routing number used is preferred one.
---- useForTransactions boolean If this routing number is used for transactions
---- notes string Notes for particular routing number
---- archivedDate string The EST date and time this record was created.
contacts array list of contacts that are connected with this institution
-- contactType string Contact Type (Institution, Return, Adjust, Wire, Customer Service, ACH, Wire, OFCR)
-- name string name for contact
-- email string Primary or corporate e-mail address for contact
-- phoneNumber string phone number for contact
-- Extension string phone number Extension for contact
correspondents array list of correspondent institutions associated with this branches routing number
--correspondentInstitutionId int The institution identification number associated with the correspondent institution
-- institutionName string Institution Name
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- account string Correspondent Account Number
-- notes string Notes for particular routing number
internationalCorrespondents array list of International correspondent institutions associated with this branches routing number
-- institutionName string Institution Name
-- swift string Society for Worldwide Interbank Financial Communications.' Within the. international transfer world, SWIFT is a universal messaging system. SWIFTs are BICs. (Bank Identifier Code) connected to the S.W.I.F.T. network
-- participant boolean Indicates if the Institution is participant.
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- accountNumber string International correspondent account number.

GetSingleInstitutionsDetailsPrimaryFirst(RTN)

Sub Main(args As String())
        Try
            Dim serviceUrl As String = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetSingleInstitutionsDetailsPrimaryFirst"

            Dim inputJson As String = "{""token"":""XXXXXXXXXXXXXX"", ""rtn"":""XXXX"", ""country"":""US"", ""includeInactive"":false, ""includeWireSearch"":true, ""includeHistory"":false}"
            Dim client As New HttpClient()
            Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
            Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
            If response.IsSuccessStatusCode Then
                RestStr = response.Content.ReadAsStringAsync().Result
                Console.WriteLine(RestStr)
                Console.ReadLine()

            End If
        Catch ex As WebException
            Console.WriteLine(ex.ToString
                                      )
        End Try
    End Sub
import requests
data = {    "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA", "includeInactive":true,includeWireSearch":true, "includeHistory":true }
response = requests.post('https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetSingleInstitutionsDetailsPrimaryFirst', json=data)
    /**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "GetSingleInstitutionsDetailsPrimaryFirst"
     * @param rtn The rtn to search
     * @param country The country code to search
     * @param includeInactive flag to determine if inactive routing numbers should be included in the search
     * @param includeWireSearch flag to determine if Wire routing numbers should be included in the search
     * @param includeHistory flag to include routing number history in search
     * @throws StopProcesingException
     */
    public Institution call(RestTemplate rt, String token, String method, String rtn, String country, Boolean includeInactive,Boolean includeWireSearch, Boolean includeHistory)
            throws StopProcesingException {
        RtnRequest req = new RtnRequest(token, rtn, country, includeInactive, includeWireSearch, includeHistory);
        InstitutionResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, InstitutionResult.class);
            Assert.notNull(res, "The returned Institution is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the RTN service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the RTN service 2", e.getMessage(), false);
        }
        return res.getInstitution();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetSingleInstitutionsDetailsPrimaryFirst";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "rtn":"xxxxxxxxx", "country":"CA", "includeInactive":true,"includeWireSearch":true ,"includeHistory":true };
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetSingleInstitutionsDetailsPrimaryFirst";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          rtn = "xxxxxxxxx",
          country = "CA",
          includeInactive = true,
          includeWireSearch = true,
          includeHistory = true
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
    "errorMessage": null,
    "institutions": {
        "institutionId": 1,
        "legacyLyonsId": 1,
        "mainInstitutionId": null,
        "externalInstitutionId": null,
        "institutionType": "Banks",
        "name": "CONNECTION BANK",
        "branchName": "CONNECTION BANK",
        "address1": "636 AVE G",
        "address2": null,
        "city": "FORT MADISON",
        "state": "IA",
        "country": "US",
        "postalCode": "52627-0000",
        "mailingAddr": "PO BOX 329; FORT MADISON, IA 52627-0329",
        "fedWire": false,
        "swift": "QUCTUS41",
        "fax": "319-376-1227",
        "telex": "",
        "homePage": "www.myconnectionbank.com",
        "notes": "FORMERLY FORT MADISON BANK & TRUST CO.",
         "active": true,
        "branchCount": 241,
        "routingNumbers": [
            {
                "routingNumber": "XXXXXXXXX",
                "purpose": "ABA",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": [
                    {
                        "routingNumber": "XXXXXXXXX",
                         "purpose": "ABA",
                        "fractional": "XXXXXXXX",
                        "correspondent": false,
                        "active": true,
                        "preferred": true,
                        "useForTransactions": false,
                        "notes": null,
                        "archivedDate" :null
                    }
                ]
            },
            {
               "routingNumber": "XXXXXXXXX",
                "purpose": "ACH",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": []
            },
            {
                "routingNumber": "XXXXXXXXX",
                "purpose": "Wire",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": []
            }
        ],
        "contacts": [
            {
                "contactType": "Institution",
                "name": null,
                "title": null,
                "email": "customer.service@myconnectionbank.com",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Return",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Adjust",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Customer Service",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "ACH",
                "name": "",
                "title": null,
                "email": "",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Wire",
                "name": "",
                "title": null,
                "email": "",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            }
        ],
        "correspondents": [
            {
                "correspondentInstitutionId": 1,
                "routingNumber": "XXXXXXX",
                "purpose": null,
                "account": null,
                "institutionName": "QUAD CITY BANK & TRUST CO",
                "notes": null
            }
        ],
         "internationalCorrespondents": [
            {
               "institutionName": "UMB BANK, NA",
                "swift": "XXXXXXX",
                "participant": true,
                "routingNumber": "XXXXXXX",
                "purpose": "Wire",
                "accountNumber": null
            }
        ]
    }
}

Get primary single institution with full details for an RTN if present else it will return non primary institution.

The mainInstitutionId attribute in the returned institution object has the following meaning:

HTTP Request

POST {base-url}/rest/GetSingleInstitutionsDetailsPrimaryFirst

Request

Parameter Type Description
token string The session token returned by the Logon call
rtn string Routing number to search
country string Country name to serach
includeInactive boolean Flag to determine if inactive routing numbers should be included in the search
includeWireSearch boolean Flag to determine if Wire routing numbers should be included in the search
includeHistory boolean Flag to determine if old routing numbers should be included in search

Response

Parameter Type Description
institutionId int The institution identification number associated with the institution
legacyLyonsId int The old lyons institution identification number associated with the institution
mainInstitutionId int The institution identification number associated with this institutions main branch
externalInstitutionId int The external institution identification number associated with canadian institutions which is referred to FinancialInstitutionID
institutionType string Institution Type
name string Complete name of the financial institution
branchName string Individual branch name of the financial institution
address1 string Physical Address Line 1
address2 string Physical Address Line 2
city string City or Province
state string State
country string Country
postalCode string Zip Code or Postal Code
mailingAddr string Mailing Address
fedWire boolean FedWire participation indicator
swift string SWIFT identifier
fax string Main Fax Number
telex string TELEX identifier
homePage string Institutions Internet home page / URL
notes string Account Notes
active boolean Active Institution
branchCount int The number of branches as defined for Main institutions.
routingNumbers array list of routingNumber objects that are connected with this institution
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- fractional string 11 Digit Fractional code.
-- correspondent boolean If the routing number comes from a correspondent institution.
-- active boolean Indicates if the routing number used is in active state.
-- preferred boolean Indicates if the routing number used is preferred one.
-- useForTransactions boolean If this routing number is used for transactions
-- notes string Notes for particular routing number
--routingNumberHistory Array A list of previous routing numbers for this record
----routingNumber string Routing Number
---- purpose string The application of this routing number Electronic, Paper, or Wire
---- fractional string 11 Digit Fractional code.
---- correspondent boolean If the routing number comes from a correspondent institution.
----active boolean Indicates if the routing number used is in active state.
---- preferred boolean Indicates if the routing number used is preferred one.
---- useForTransactions boolean If this routing number is used for transactions
---- notes string Notes for particular routing number
---- archivedDate string The EST date and time this record was created.
contacts array list of contacts that are connected with this institution
-- contactType string Contact Type (Institution, Return, Adjust, Wire, Customer Service, ACH, Wire, OFCR)
-- name string name for contact
-- email string Primary or corporate e-mail address for contact
-- phoneNumber string phone number for contact
-- Extension string phone number Extension for contact
correspondents array list of correspondent institutions associated with this branches routing number
--correspondentInstitutionId int The institution identification number associated with the correspondent institution
-- institutionName string Institution Name
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- account string Correspondent Account Number
-- notes string Notes for particular routing number
internationalCorrespondents array list of International correspondent institutions associated with this branches routing number
-- institutionName string Institution Name
-- swift string Society for Worldwide Interbank Financial Communications.' Within the. international transfer world, SWIFT is a universal messaging system. SWIFTs are BICs. (Bank Identifier Code) connected to the S.W.I.F.T. network
-- participant boolean Indicates if the Institution is participant.
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- accountNumber string International correspondent account number.

GetInstitutionDetailsById(RTN)

Sub Main(args As String())
        Try
            Dim serviceUrl As String = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionDetailsById"

            Dim inputJson As String = "{""token"":""XXXXXXXXXXXXXX"", ""institutionId"":""XXXX"", ""includeHistory"":false}"
            Dim client As New HttpClient()
            Dim inputContent As HttpContent = New StringContent(inputJson, Encoding.UTF8, "application/json")
            Dim response As HttpResponseMessage = client.PostAsync(serviceUrl, inputContent).Result
            If response.IsSuccessStatusCode Then
                RestStr = response.Content.ReadAsStringAsync().Result
                Console.WriteLine(RestStr)
                Console.ReadLine()

            End If
        Catch ex As WebException
            Console.WriteLine(ex.ToString
                                      )
        End Try
    End Sub
import requests
data = {    "token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "institutionId":0, "includeHistory":true }
response = requests.post('https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionDetailsById', json=data)
    /**
     *    
     *    
     * @param rt The RestTemplate created as shown in the main General Considerations section
     * @param token The session token from the Logon method
     * @param method Must be "GetInstitutionDetailsById"
     * @param institutionId The institutionId to search
     * @param includeHistory flag to include routing number history in search
     * @throws StopProcesingException
     */
    public Institution call(RestTemplate rt, String token, String method, String institutionId, Boolean includeHistory)
            throws StopProcesingException {
        RtnRequest req = new RtnRequest(token, rtn, country, includeHistory);
        InstitutionResult res = null;
        try {
            res = rt.postForObject("/".concat(method), req, InstitutionResult.class);
            Assert.notNull(res, "The returned InstitutionList is null");
        } catch (HttpServerErrorException ex) {
            handleRestException("\nError calling " + method + " on the RTN service 1", ex, false);
        } catch (Exception e) {
            handleError("\nError calling " + method + " on the RTN service 2", e.getMessage(), false);
        }
        return res.getInstitution();
    }
$(function () {
    var url = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionDetailsById";
    var postObj = {"token":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",    "institutionId":0, "includeHistory":false };
    $.ajax({
        type: "POST",
        data :JSON.stringify(postObj),
        url: url,
        contentType: "application/json",
        success: function (res) { var results = res; }
    });
});
var apiurl = "https://lyonsreg.com/webservices/rtn2.1/RTNServiceWCF.svc/rest/GetInstitutionDetailsById";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(apiurl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
  string json = new JavaScriptSerializer().Serialize(new
        {
          token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          institutionId = 0,
          includeHistory = true
        });

  streamWriter.Write(json);
}

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
  var result = streamReader.ReadToEnd();
}

The returned JSON is structured like this:

{
    "errorMessage": null,
    "institutions": {
        "institutionId": 1,
        "legacyLyonsId": 1,
        "mainInstitutionId": null,
        "externalInstitutionId": null,
        "institutionType": "Banks",
        "name": "CONNECTION BANK",
        "branchName": "CONNECTION BANK",
        "address1": "636 AVE G",
        "address2": null,
        "city": "FORT MADISON",
        "state": "IA",
        "country": "US",
        "postalCode": "52627-0000",
        "mailingAddr": "PO BOX 329; FORT MADISON, IA 52627-0329",
        "fedWire": false,
        "swift": "QUCTUS41",
        "fax": "319-376-1227",
        "telex": "",
        "homePage": "www.myconnectionbank.com",
        "notes": "FORMERLY FORT MADISON BANK & TRUST CO.",
         "active": true,
        "branchCount": 241,
        "routingNumbers": [
            {
                "routingNumber": "XXXXXXXXX",
                "purpose": "ABA",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": [
                    {
                        "routingNumber": "XXXXXXXXX",
                         "purpose": "ABA",
                        "fractional": "XXXXXXXX",
                        "correspondent": false,
                        "active": true,
                        "preferred": true,
                        "useForTransactions": false,
                        "notes": null,
                        "archivedDate" :null
                    }
                ]
            },
            {
               "routingNumber": "XXXXXXXXX",
                "purpose": "ACH",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": []
            },
            {
                "routingNumber": "XXXXXXXXX",
                "purpose": "Wire",
                "fractional": "XXXXXXXX",
                "correspondent": false,
                "active": true,
                "preferred": true,
                "useForTransactions": true,
                "notes": null,
                "history": []
            }
        ],
        "contacts": [
            {
                "contactType": "Institution",
                "name": null,
                "title": null,
                "email": "customer.service@myconnectionbank.com",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Return",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Adjust",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Customer Service",
                "name": null,
                "title": null,
                "email": null,
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "ACH",
                "name": "",
                "title": null,
                "email": "",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            },
            {
                "contactType": "Wire",
                "name": "",
                "title": null,
                "email": "",
                "phoneNumber": "(XXX) XXX-XXXX",
                "extension": null
            }
        ],
        "correspondents": [
            {
                "correspondentInstitutionId": 1,
                "routingNumber": "XXXXXXX",
                "purpose": null,
                "account": null,
                "institutionName": "QUAD CITY BANK & TRUST CO",
                "notes": null
            }
        ],
         "internationalCorrespondents": [
            {
               "institutionName": "UMB BANK, NA",
                "swift": "XXXXXXX",
                "participant": true,
                "routingNumber": "XXXXXXX",
                "purpose": "Wire",
                "accountNumber": null
            }
        ]
    }
}

Returns a financial institution with full details. Both Routing Number and wire routing numbers will be searched.

The mainBranchId attribute in the returned institution object has the following meaning:

HTTP Request

POST {base-url}/rest/GetInstitutionDetailsById

Request

Parameter Type Description
token string the session token returned by the Logon call
institutionId int InstitutionId of institution
includeHistory boolean flag to determine if old routing numbers should be included in search

Response

Parameter Type Description
institutionId int The institution identification number associated with the institution
legacyLyonsId int The old lyons institution identification number associated with the institution
mainInstitutionId int The institution identification number associated with this institutions main branch
externalInstitutionId int The external institution identification number associated with canadian institutions which is referred to FinancialInstitutionID
institutionType string Institution Type
name string Complete name of the financial institution
branchName string individual branch name of the financial institution
address1 string Physical Address Line 1
address2 string Physical Address Line 2
city string City or Province
state string State
country string Country
postalCode string Zip Code or Postal Code
mailingAddr string Mailing Address
fedWire boolean FedWire participation indicator
swift string SWIFT identifier
fax string Main Fax Number
telex string TELEX identifier
homePage string Institutions Internet home page / URL
notes string Account Notes
active boolean Active Institution
branchCount int The number of branches as defined for Main institutions.
routingNumbers array list of routingNumber objects that are connected with this institution
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- fractional string 11 Digit Fractional code.
-- correspondent boolean If the routing number comes from a correspondent institution.
-- active boolean Indicates if the routing number used is in active state.
-- preferred boolean Indicates if the routing number used is preferred one.
-- useForTransactions boolean If this routing number is used for transactions
-- notes string Notes for particular routing number
--routingNumberHistory Array A list of previous routing numbers for this record
----routingNumber string Routing Number
---- purpose string The application of this routing number Electronic, Paper, or Wire
---- fractional string 11 Digit Fractional code.
---- correspondent boolean If the routing number comes from a correspondent institution.
----active boolean Indicates if the routing number used is in active state.
---- preferred boolean Indicates if the routing number used is preferred one.
---- useForTransactions boolean If this routing number is used for transactions
---- notes string Notes for particular routing number
---- archivedDate string The EST date and time this record was created.
contacts array list of contacts that are connected with this institution
-- contactType string Contact Type (Institution, Return, Adjust, Wire, Customer Service, ACH, Wire, OFCR)
-- name string name for contact
-- email string Primary or corporate e-mail address for contact
-- phoneNumber string phone number for contact
-- Extension string phone number Extension for contact
correspondents array list of correspondent institutions associated with this branches routing number
--correspondentInstitutionId int The institution identification number associated with the correspondent institution
-- institutionName string Institution Name
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- account string Correspondent Account Number
-- notes string Notes for particular routing number
internationalCorrespondents array list of International correspondent institutions associated with this branches routing number
-- institutionName string Institution Name
-- swift string Society for Worldwide Interbank Financial Communications.' Within the. international transfer world, SWIFT is a universal messaging system. SWIFTs are BICs. (Bank Identifier Code) connected to the S.W.I.F.T. network
-- participant boolean Indicates if the Institution is participant.
-- routingNumber string Routing Number
-- purpose string The application of this routing number Electronic, Paper, or Wire
-- accountNumber string International correspondent account number.