API Documentation
Signup Now
  • Welcome!
  • Authenticate with Api-secret keys
  • Lenme Webhooks
    • Lenme Webhook Events
    • Integrating Lenme Webhooks
  • Reference
    • API Reference
    • List borrower's loan request
    • Get Borrower Loan History
    • Offer Loan Requests
    • Fund Loan
    • Fetch Banking Data
    • Fetch Transfer History
    • Get Loans
    • Get Loan payments
    • Fetch Third Party Service
Powered by GitBook
On this page
  1. Reference

Offer Loan Requests

This endpoint is used to make an offer for a loan request, given a loan request id.

HTTPS Request

POST https://api.lenmo.app/api/v3/loan_requests/{id}/make_offer/

Path Parameters

Name
Type
Description

id*

Long

The loan request id to be offered.

Headers

Name
Type
Description

Accept

String

The content type of the response.

X-API-KEY*

String

The API key that gives the user the authentication to perform this request.

X-Timestamp*

String

The timestamp of the request.

X-HMAC*

String

The HMAC generated for the request.

Request Body

Name
Type
Description

offered_interest*

Float

A Float value between 0.03 and 2.0

automate_fund

Boolean

Boolean flag to specify whether to automatically fund the loan after offer acceptance (defaults to false if not provided).

{
    "id": 1,
    "offered_interest": 0.03,
     "offer_status": "pending",
      "lender": { 
        // ...lender data...
      }, 
      "loan_request": { 
        // ...loan request data... 
      },
      "monthly_payment": 100,
      "loan_gain": 100.02,
      "created": "2022-05-27T10:37:14.658672Z",
      "offer_status_changed": "2020-05-06 17:25:01 Etc/GMT",
      "processed_on_dwolla": true,
      "automate_fund": true
}
  1. If authentication credentials are invalid

    {
        "detail": "Authentication credentials were not provided."
    }
  2. If the investor is currently borrowing

    {
        "message": "Borrower can not offer."
    }

Cases:

  1. Offered interest is more than the loan request max interest rate

    {
        "message": "The maximum interest rate allowed for this loan request is {loan_request_max_interest_rate}"
    }
  2. The investor does not have sufficient balance to offer the loan (applicable only if automate_fund is True).

    {
        "message": "Your balance isn't enough to offer this loan. Please add {REQUIRED_AMOUNT} to proceed."
    }
  3. The loan request has been canceled

    {
        "message": "This Loan Request has been Canceled"
    }
  4. The loan request has been signed

    {
        "message": "You can't make an offer to a Signed Loan Request"
    }
  5. The investor already made an offer for this loan request

    {
        "message": "You have already made an offer for this Loan Request"
    }
  6. Borrower accepted another offer

    {
        "message": "You can't make an offer as the borrower has already accepted another offer"
    }
  7. The investor has no verified bank account.

    {
        "message": "We cannot process this request as it appears that your bank account has not been verified. Please verify your bank account and try again later."
    }

Sample Request

curl -X POST "https://api.lenmo.app/api/v3/loan_requests/$loan_request_id/make_offer/" \
    -H "accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-API-KEY: YOUR_API_KEY" \
    -H "X-Timestamp: REQUEST_TIMESTAMP" \
    -H "X-HMAC: REQUEST_HMAC"
    -d '{
            "offered_interest": 0.3,
            "automate_fund": true
        }'
import requests

lq_id = 126315

url = "https://api.lenmo.app/api/v3/loan_requests/{}/make_offer/".format(lq_id)

headers = {
    "Accept": "application/json",
    "X-API-KEY": "YOUR_API_KEY",
    "X-Timestamp": "REQUEST_TIMESTAMP",
    "X-HMAC": "REQUEST_HMAC",
}

body = {"offered_interest": 1, "automate_fund": True}

r = requests.post(url, json=body, headers=headers)
print(r.text)
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            int lqId = 126315;
            String urlString = "https://api.lenmo.app/api/v3/loan_requests/" + lqId + "/make_offer/";
            URL url = new URL(urlString);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Accept", "application/json");
            connection.setRequestProperty("X-API-KEY", "YOUR_API_KEY");
            connection.setRequestProperty("X-Timestamp", "REQUEST_TIMESTAMP");
            connection.setRequestProperty("X-HMAC", "REQUEST_HMAC");
            connection.setRequestProperty("Content-Type", "application/json; utf-8");
            connection.setDoOutput(true);

            String jsonInputString = "{\"offered_interest\": 1}";
            try(OutputStream os = connection.getOutputStream()) {
                byte[] input = jsonInputString.getBytes("utf-8");
                os.write(input, 0, input.length);
            }

            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
            String inputLine;
            StringBuilder response = new StringBuilder();
            while ((inputLine = in.readLine()) != null) {
                response.append(inputLine);
            }
            in.close();

            System.out.println(response.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
require 'net/http'
require 'json'
require 'uri'

lq_id = 126315
url = URI("https://api.lenmo.app/api/v3/loan_requests/#{lq_id}/make_offer/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["X-API-KEY"] = "YOUR_API_KEY"
request["X-Timestamp"] = "REQUEST_TIMESTAMP"
request["X-HMAC"] = "REQUEST_HMAC"
request.body = { offered_interest: 1 }.to_json

response = http.request(request)
puts response.body
const fetch = require('node-fetch');

const lqId = 126315;
const url = `https://api.lenmo.app/api/v3/loan_requests/${lqId}/make_offer/`;

const headers = {
    "Accept": "application/json",
    "X-API-KEY": "YOUR_API_KEY",
    "X-Timestamp": "REQUEST_TIMESTAMP",
    "X-HMAC": "REQUEST_HMAC",
    "Content-Type": "application/json",
};

const body = {
    offered_interest: 1
};

fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(body)
})
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$lqId = 126315;
$url = "https://api.lenmo.app/api/v3/loan_requests/$lqId/make_offer/";

$headers = [
    "Accept: application/json",
    "X-API-KEY: YOUR_API_KEY",
    "X-Timestamp: REQUEST_TIMESTAMP",
    "X-HMAC: REQUEST_HMAC",
    "Content-Type: application/json"
];

$body = json_encode([
    "offered_interest" => 1
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>

Response Parameters

Parameter
Type
Description

id

Long

Offer id

offered_interest

Float

The interest rate of the offer

offer_status

String

Status of the offer .e.g pending, accepted, rejected, expired ..

lender

Dict

Contains lender data for loan

Dict

Contains loan request details for this offer

monthly_payment

Float

Monthly payment of the offer

loan_gain

Float

The loan gain of the offered loan request

created

Date

UTC time of the offer creation on the database

offer_status_changed

Date

UTC time of the last action took on this offer

processed_on_dwolla

Boolean

Status of transfer associated with the offer

PreviousGet Borrower Loan HistoryNextFund Loan

Last updated 2 months ago

loan_request