Quickstart

Originating and servicing a loan

In this example, you'll see how to use Onbo's APIs for a borrower's full credit life cycle, from application to approval & disbursement, to servicing. This guide will provide cURL snippets for each API request, but you should consider using our Postman Collection for the best experience.

First, let's take a look at a loan's application flow at a high level. Here's how it works:

Now let's go through each step of the application:

1) Complete KYC and create the User

The first step in the loan origination process is to create a user with the applicant's name, email, SSN and other KYC info the /users POST endpoint.

curl --location --request POST 'https://sandbox-api.stilt.com/v1/users' \
--header 'X_CLIENT_UUID: {{YOUR_CLIENT_ID}}' \
--header 'EPOCH: {{EPOCH}}' \
--header 'X_STILT_HMAC: {{HMAC}}' \
--header 'Content-MD5: {{MD5}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "first_name": "Blair",
    "middle_name": "Cassidy",
    "last_name": "Dufresne",
    "email": "bcdufresne5000@gmail.com",
    "phone": "6166723456",
    "dob": "1988-05-16",
    "ssn": "Cs8CjMVdlNuJ+OZUjNTTyW295pUNWTzC8zHP/eVpa0s=",
    "address": {
        "line_1": "5161 Stansfield Dr",
        "line_2": null,
        "line_3": null,
        "zip": "18092",
        "city": "Zionsville",
        "state": "PA",
        "country": "UNITED STATES"
    }
}'

Note that the ssn must first be AES encrypted using your API secret. See our encrypting sensitive data guide for an example.

2) Create the loan application

Once a user applies, you can decide to reject or approve the applicant. You'll inform Onbo of your credit decision with the /applications POST endpoint, passing the user's uuid returned from the /users POST call.

curl --location --request POST 'https://sandbox-api.stilt.com/v1/users/{{user_uuid}}/loans/applications' \
--header 'X_CLIENT_UUID: {{YOUR_API_SECRET}}' \
--header 'X_STILT_HMAC: {{HMAC}}' \
--header 'EPOCH: {{EPOCH}}' \
--header 'Content-MD5: {{MD5}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": 5000.0,
    "decision": "approved",
    "offers": [
        {
            "apr": 0.0,
            "amount": 2500.0,
            "term": null,
            "term_frequency": "MONTHLY",
            "interest_rate": 0.0,
            "origination_fee": 0.0
        }
    ]
}'

3) Get the Promissory Note

In order for a loan offer to be accepted, the User must first sign the promissory note (also known as the loan agreement). Call the /promissory_note GET endpoint with the user's uuid and the offer's uuid. Onbo will return the promissory note as a pdf ready to be presented directly to the user, along with a document_uuid.

curl --location --request GET 'https://sandbox-api.stilt.com/v1/users/{user_uuid}/loans/{offer_uuid}/documents/promissory_note' \
--header 'X_CLIENT_UUID: {{YOUR_API_SECRET}}' \
--header 'X_STILT_HMAC: {{HMAC}}' \
--header 'EPOCH: {{EPOCH}}' \
--header 'Content-MD5: {{MD5}}' \
--data-raw ''
4) Activate the loan and disburse the loan proceeds

Once a user accepts the promissory note, it's time to activate the loan. To do this, call the /loans PATCH endpoint with the user, offer and document's uuid.

curl --location --request PATCH 'https://sandbox-api.stilt.com/v1/users/{user_uuid}/loans/{loan_uuid}' \
--header 'X_CLIENT_UUID: {{YOUR_API_SECRET}}' \
--header 'X_STILT_HMAC: {{HMAC}}' \
--header 'EPOCH: {{EPOCH}}' \
--header 'Content-MD5: {{MD5}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "status": "Accepted",
    "document_uuid":"052aa276-56cd-11ec-bf63-0242ac130002",
    "disbursement_bank_info": {
        "ach_routing_number": "103100195",
        "bank_account_number": "456455535",
        "bank_name": "Chime",
        "account_type" : "checking"   
    }
}'

Note that activating a loan converts the offer_uuid into the loan_uuid, which is used for subsequent methods like getting statements and initiating repayments

Once the loan has been disbursed, we can service the loan:

5) Get a statement

After a loan has been disbursed, /statements GET should be used to retrieve information about the loan like the balance as well as its statements.

curl --location --request GET 'https://sandbox-api.stilt.com/v1/users/{user_uuid}/loans/{loan_uuid}/statements' \
--header 'X_CLIENT_UUID: {{YOUR_API_SECRET}}' \
--header 'X_STILT_HMAC: {{HMAC}}' \
--header 'EPOCH: {{EPOCH}}' \
--header 'Content-MD5: {{MD5}}' \
--data-raw ''
6) Transmit a repayment

And finally, to transmit a repayment from the borrower's account, call /repayment POST to initiate a loan repayment

curl --location --request POST 'https://sandbox-api.stilt.com/v1/users/{user_uuid}/loans/{loan_uuid}/payments' \
--header 'X_CLIENT_UUID: {{YOUR_API_SECRET}}' \
--header 'X_STILT_HMAC: {{HMAC}}' \
--header 'EPOCH: {{EPOCH}}' \
--header 'Content-MD5: {{MD5}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": "185",
    "payment_type": "SINGLE_PAYMENT",
    "payment_date": "2022-05-05",
    "repayment_bank_info": {
        "ach_routing_number": "103100195",
        "bank_account_number": "456455535",
        "bank_name": "Chime",
        "account_type" : "checking"   
    }
}'

Congrats on originating your first loan! Check out our implementation guides for each product, or head over to our API Reference for more details.

Last updated