This is a staging build of the docs
Skip to main content

Deposit lent funds

Deposit the loan and reflect it in the SMB's accounting platform

Once you receive the configuration information, you are ready to deposit funds into the borrower's bank account. This is known as loan drawdown general lending, and an advance in invoice finance. You will need to:

  1. Create a transfer from the lender's bank account to the borrower's bank account.

  2. Create a bank feed transaction to represent the account transfer in the lender's bank account.

To perform these operations, you will need the following properties:

Create transfer

To record the transfer of money from the lender's bank account to the borrower's bank account:

  1. Use the Get create transfer model endpoint to determine the transfer request parameters.

  2. Call the Create transfer endpoint to perform the transfer of money. Note that you are performing a transfer from lendersBankAccount.id to borrowersBankAccount.id.

codatLending.loanWriteback.transfers.create({
accountingTransfer: {
date: depositDate,
from: {
accountRef: {
id: lendersBankAccount.id,
},
amount: depositAmount,
currency: borrowersBankAccount.currency,
},
to: {
accountRef: {
id: borrowersBankAccount.id,
},
amount: depositAmount,
currency: borrowersBankAccount.currency,
},
},
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
}).then((res: CreateTransferResponse) => {
if (res.statusCode == 200) {
// handle response
}
});

Create bank feed transaction

To record the loan deposit into the lender's bank account:

  1. Get the create bank account transactions model to determine the parameters required for transaction creation.

  2. Create bank account transactions to deposit the amount into the lender's bank account.

We provided example bank transaction creation payloads in the snippets below:

codatLending.loanWriteback.bankTransactions.create({
accountingCreateBankTransactions: {
accountId: lendersBankAccount.id,
transactions: [
{
id: transactionId, // Unique identifier for this bank transaction
amount: -depositAmount,
date: depositDate,
description: description, // Include a reference to the transfer, the loan and you, the lender
},
],
},
accountId: lendersBankAccount.Id,
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
}).then((res: CreateBankTransactionsResponse) => {
if (res.statusCode == 200) {
// handle response
}
});


Was this page useful?
❤️
👍
🤔
👎
😭