Skip to main content

Deposit lent funds

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

Once you receive the configuration information, you are ready to deposit funds into the borrower's bank account. This is known as loan drawdown in 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:

  • Lender's lendersBankAccountId
  • SMB's borrowersBankAccount.id and currency
  • depositDate - the date the funding was deposited into the borrower's bank account
  • depositAmount - the funding amount or advance provided to the SMB

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 lendersBankAccountId to borrowersBankAccount.id.

codatLending.loanWriteback.transfers.create({
accountingTransfer: {
date: depositDate,
from: {
accountRef: {
id: lendersBankAccountId,
},
amount: depositAmount,
currency: borrowersBankAccount.currency,
},
to: {
accountRef: {
id: borrowersBankAccount.id,
},
amount: depositAmount,
currency: borrowersBankAccount.currency,
},
},
companyId: companyId,
connectionId: connectionId,
}).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: lendersBankAccountId,
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: companyId,
connectionId: connectionId,
}).then((res: CreateBankTransactionsResponse) => {
if (res.statusCode == 200) {
// handle response
}
});


Was this page useful?
👏
👍
🤔
👎
😭