API 101

Getting Started

Introduction to Developing on LoanCirrus

LoanCirrus is a world class Digital Banking Platform enabling lending and a range of other services. LoanCirrus is built to connect into the global digital financial ecosystem.

With a full set of REST APIs, developers can quickly and easily integrate into other Software Applications such as Websites, Payment Systems, Financial Services and more. 

REST APIs Overview

LoanCirrus API follows the Representational state transfer (REST) standard allowing resources (clients, loans, etc) to be standard with a standard set of GET, POST, PUT, DELETE, PATCH HTTP requests. Communication also follows the REST architecture constraints including being stateless and cacheable. All responses are returned as JSON objects.

Obtaining An API Token

In order to obtain an API token, you must first ensure that your instance of LoanCirrus has been subscribed to a ‘paid‘ plan. You will then be required to be set up as a user by the admin and given ‘API Access‘ permission. Once that is done you will receive an email containing the API token and all other relevant information related to your account.

Endpoints

LoanCirrus is a multi-tenanted environment with all tenants having access at their own sub-domain. To make a request to a tenant use the pattern of ?<tenanId>.app.loancirrus.com/api/?<version>/ for production and ?<tenanId>.sandbox.loancirrus.com/api/?<version>/ for the sandbox.

Posting Data

API requests which post data can either use url-encoding or json to enter data. The content-type header must be set to “application/json” for the json request. The following two example shows the two methods for posting data. Note that for some requests, much more information can be posted using the json input that is available with url-encoding but all url-encoded requests are supported with their json equivalents.

// Using just URL encoding

curl -d “type=APPROVAL” https://demo.app.loancirrus.com/api/v1/loans/359644/transactions?api_token=sampleapitokenhere

// Using JSON

curl -H “Accept: application/json” -H “Content-type: application/json” -H “Authorization: Bearer sampleapitokenhere” -X POST -d ‘{ “type”: “APPROVAL”}’ https://demo.app.loancirrus.com/api/v1/loans/359644/transactions

Example:

The following example makes a request using the api_token ‘sampleapitoken’ to the tenant ‘demo’ to retrieve all repayments for loan account ‘abc123’.

https://demo.app.loancirrus.com/api/v1/loans/abc123/repayments

This will return a response like the following:

{
    "repayments": [
        {
            "dueDate": "2017-09-05",
            "principalDue": 4166.67,
            "principalPaid": 0,
            "interestDue": 525.68,
            "interestPaid": 0,
            "feesDue": 0,
            "feesPaid": 0,
            "penaltyDue": 0,
            "penaltyPaid": 0,
            "daysLate": 0,
            "daysInArrears": 0,
            "state": "PENDING"
        },
        …
    ]
}

Was this helpful?