From 0f72217aeea074e7cca5e1ae5904ac7f509fde5b Mon Sep 17 00:00:00 2001 From: David Coplowe Date: Fri, 8 Nov 2024 15:47:40 +0000 Subject: [PATCH] Fixed --- docs/lending/guides/loan-writeback/deposit.md | 3 +- .../guides/loan-writeback/introduction.md | 21 ++++++--- .../loan-writeback/record-general-loan.md | 46 ++++++++++++------- docs/lending/overview.md | 5 +- sidebars/lending.js | 1 - 5 files changed, 49 insertions(+), 27 deletions(-) diff --git a/docs/lending/guides/loan-writeback/deposit.md b/docs/lending/guides/loan-writeback/deposit.md index 76f103681..1625aca2a 100644 --- a/docs/lending/guides/loan-writeback/deposit.md +++ b/docs/lending/guides/loan-writeback/deposit.md @@ -323,5 +323,4 @@ POST https://api.codat.io/companies/{companyId}/connections/{connectionId}/push/ ## Read next -* Record the repayment of a [general loan](/lending/guides/loan-writeback/record-general-loan). -* Record the repayment of an [invoice finance](/lending/guides/loan-writeback/record-invoice-finance) loan. \ No newline at end of file +* Record the repayment of a [ loan](/lending/guides/loan-writeback/record-general-loan). \ No newline at end of file diff --git a/docs/lending/guides/loan-writeback/introduction.md b/docs/lending/guides/loan-writeback/introduction.md index c6c7798d2..d46d16c74 100644 --- a/docs/lending/guides/loan-writeback/introduction.md +++ b/docs/lending/guides/loan-writeback/introduction.md @@ -18,13 +18,22 @@ This guide takes you through the steps needed to implement and run the loan writ This solution covers the loan writeback procedure for both general lending, such as term loans, and selective invoice finance. +:::tip Use our SDK + +Save time by using our Lending SDK to integrate directly with our API. +The loan writeback namespace includes all the methods you need to develop your loan writeback solution. + +Check out our docs for [typescript](https://github.com/codatio/client-sdk-typescript/tree/main/lending#loanwriteback), [python](https://github.com/codatio/client-sdk-python/tree/main/lending#loan_writeback), [C#](https://github.com/codatio/client-sdk-csharp/tree/main/lending#loanwriteback), [Go](https://github.com/codatio/client-sdk-go/tree/main/lending#loanwriteback), and [Java](https://github.com/codatio/client-sdk-java/tree/main/lending#loanwriteback). + +::: + ### What is loan writeback? Loan writeback (also known as lending writeback) is the process of continuously updating an accounting software with information about a loan. It helps maintain an accurate position of the loan during the entire lending cycle by recording the loan liability, any interest, fees, or repayments, and facilitating the reconciliation of bank accounts. -:::warning Bank feeds is required for loan writeback +:::warning Bank feeds authorization -Loan writeback requires the lender to support the [bank feeds](/bank-feeds/overview) functionality so that the lender can record their own bank transactions associated with issuing the loan in their borrower's accounting software. +For some accounting software, you must obtain approval to integrate bank feeds prior to implementing loan writeback. ::: @@ -34,7 +43,9 @@ A bookkeeper can account for a loan in numerous ways in an accounting software. This results in loans being improperly recorded as revenue and repayments as operating costs. At the end of the reporting period, this can make it hard for the bookkeeper to close their books. -By implementing loan writeback functionality in your application, you can make sure loan bookeeping is done regularly, correctly, and quickly so that you always see an up-to-date state of the borrower's accounts. +By implementing loan writeback functionality in your application, you can make sure loan bookkeeping is done regularly, correctly, and quickly so that you always see an up-to-date state of the borrower's accounts. + +POLINA (I'm trying to say that write back is useful for you too): Loan writeback not only helps SMBs make their accounts more accurate but also helps you and other lenders identify loans in an SMBs accounting software thus helping you improve your underwriting by being able to accurately identify the SMBs debt repayment history. :::info Mandatory loan writeback @@ -52,7 +63,7 @@ The process of loan writeback involves recording loan withdrawals, repayments, a 3. **Record** payments owed to you, the lender, in your SMB's accounting software. -The first two steps are identical for the general lending and invoice finance scenarios. The process of recording repayments differs based on the lending option. +The process is identical for the general lending and invoice finance scenarios. ```mermaid sequenceDiagram @@ -114,8 +125,6 @@ As a result, the lender's account transactions balance to zero, and the advance ## Prerequisites -* As a lender, use Codat's [Bank Feeds API](/bank-feeds/overview) to represent your bank account in Codat's domain. Keep hold of the [source bank account](/bank-feeds-api#/operations/create-source-account) `id` — you will use it when recording deposits and repayments. - * If you are implementing loan writeback for Xero, *Xero Bank Feeds API* needs to be enabled for your registered app. Xero usually does this during the certification process for lenders' apps so that you can test your solution before completing the certification. * Check that you have [created a Codat company](/configure/portal/companies#add-a-new-company) that represents your SMB customer and linked it to an accounting software. If you are already using Codat for lending, it's likely you have previously created some companies. diff --git a/docs/lending/guides/loan-writeback/record-general-loan.md b/docs/lending/guides/loan-writeback/record-general-loan.md index 96baae9e8..5259bf44f 100644 --- a/docs/lending/guides/loan-writeback/record-general-loan.md +++ b/docs/lending/guides/loan-writeback/record-general-loan.md @@ -1,13 +1,15 @@ --- -title: "Record general loan repayments" -description: "Record the repayment of money owed to the lender for a general loan in the SMB's accounting software" -sidebar_label: "Record: general loans" +title: "Record loan repayments" +description: "Record the repayment of money owed to the lender for a loan in the SMB's accounting software" +sidebar_label: "Record repayments" --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Based on the loan's terms and conditions, the borrower will periodically repay the lender the loan amount and any associated fees. +The loan writeback process is the same for both general lending and invoice finance. +The key distinction lies in the repayment method: general lending usually involves recurring payments, while invoice finance is repaid when the SMB’s customer pays the invoice. +Since the underlying process is the same, we will focus on general lending and also provide additional details on how to further automate the process for invoice financiers. To reflect that programmatically, perform these steps every time a repayment is made: @@ -58,7 +60,7 @@ To perform these operations, you will need the following properties: ### Create transfer -Use the [Create transfer](/lending-api#/operations/create-transfer) endpoint again, this time to record the loan repayment amount. Note that you are performing a transfer *from* `borrowersBankAccount.id` *to* `lendersBankAccountId`. +Use the [Create transfer](/lending-api#/operations/create-transfer) endpoint again, this time to record the total repayment amount. Note that you are performing a transfer *from* `borrowersBankAccount.id` *to* `lendersBankAccountId`. @@ -71,14 +73,14 @@ codatLending.loanWriteback.transfers.create({ accountRef: { id: borrowersBankAccount.id, }, - amount: repaymentAmount, + amount: totalRepaymentAmount, currency: borrowersBankAccount.currency, }, to: { accountRef: { id: lendersBankAccountId, }, - amount: repaymentAmount, + amount: totalRepaymentAmount, currency: borrowersBankAccount.currency, }, }, @@ -102,14 +104,14 @@ transfers_create_request = operations.CreateTransferRequest( account_ref=shared.AccountRef( id=borrowers_bank_account.id, ), - amount=Decimal(repayment_amount), + amount=Decimal(total_repayment_amount), currency=borrowers_bank_account.currency, ), to=shared.TransferAccount( account_ref=shared.AccountRef( id=lenders_bank_account_id, ), - amount=Decimal(repayment_amount), + amount=Decimal(total_repayment_amount), currency=borrowers_bank_account.currency, ), ), @@ -131,14 +133,14 @@ var transfersCreateResponse = await codatLending.LoanWriteback.Transfers.CreateA AccountRef = new AccountRef() { Id = borrowersBankAccount.Id, }, - Amount = repaymentAmount, + Amount = totalRepaymentAmount, Currency = borrowersBankAccount.Currency, }, To = new TransferAccount() { AccountRef = new AccountRef() { Id = lendersBankAccountId, }, - Amount = repaymentAmount, + Amount = totalRepaymentAmount, Currency = borrowersBankAccount.Currency, }, }, @@ -159,14 +161,14 @@ transfersCreateResponse, err := codatLending.LoanWriteback.Transfers.Create(ctx, AccountRef: &shared.AccountRef{ ID: lending.String(borrowersBankAccount.ID), }, - Amount: types.MustNewDecimalFromString(repaymentAmount), + Amount: types.MustNewDecimalFromString(totalRepaymentAmount), Currency: lending.String(borrowersBankAccount.Currency), }, To: &shared.TransferAccount{ AccountRef: &shared.AccountRef{ ID: lending.String(lendersBankAccountID), }, - Amount: types.MustNewDecimalFromString(repaymentAmount), + Amount: types.MustNewDecimalFromString(totalRepaymentAmount), Currency: lending.String(borrowersBankAccount.Currency), }, }, @@ -189,7 +191,7 @@ CreateTransferRequest req = CreateTransferRequest.builder() .id(borrowersBankAccount.id) .build() ) - .amount(repaymentAmount) + .amount(totalRepaymentAmount) .currency(borrowersBankAccount.currency) .build()) .to(TransferAccount.builder() @@ -197,7 +199,7 @@ CreateTransferRequest req = CreateTransferRequest.builder() .id(lendersBankAccountId) .build() ) - .amount(repaymentAmount) + .amount(totalRepaymentAmount) .currency(borrowersBankAccount.currency) .build()) .build()) @@ -224,14 +226,14 @@ POST https://api.codat.io/companies/{companyId}/connections/{connectionId}/push/ "accountRef": { "id": borrowersBankAccount.id, }, - "account": repaymentAmount, + "account": totalRepaymentAmount, "currency": borrowersBankAccount.currency, }, "to": { "accountRef": { "id": lendersBankAccountId, }, - "account": repaymentAmount, + "account": totalRepaymentAmount, "currency": borrowersBankAccount.currency, } } @@ -674,6 +676,16 @@ POST https://api.codat.io/companies/{companyId}/connections/{connectionId}/push/ At the end of this 3-stage process, your borrower will have the loan writeback reflected correctly in their accounting software. This saves them time on reconciliation and makes sure they (and you!) have clarity on the state of the loan. +## Automate invoice finance repayment + +Certain accounting software providers offer webhook notifications to alert you about changes to invoices in the SMB’s accounts. +By subscribing to these notifications, you can automatically trigger repayments once the customer pays the SMB. + +To enhance your repayment automation, check out the supported webhooks from [Xero](https://developer.xero.com/documentation/guides/webhooks/overview/) and [Intuit](https://developer.intuit.com/app/developer/qbo/docs/develop/webhooks). + +Some accounting software providers support webhook notifications to get notified about changes to invoices in the SMB's accounts. +This means you can subscribe to these and automatically trigger the repayment once the customer has paid the SMB. + :::tip Recap In this guide, you have learned: * What is loan writeback and what it's used for. diff --git a/docs/lending/overview.md b/docs/lending/overview.md index 23b30547a..74d6ecbac 100644 --- a/docs/lending/overview.md +++ b/docs/lending/overview.md @@ -141,7 +141,10 @@ Our Lending API empowers you with a host of features to help you streamline your ## Build with client libraries -Use our [comprehensive SDKs](/get-started/libraries) to kick-start and simplify your developers' journey automating the collection of your customers' financial data and making an assessment of a small business's financial health and performance. The SDKs come in multiple languages and provide sample requests and responses for the full range of lending and underwriting scenarios. +Use our [comprehensive SDKs](/get-started/libraries) to kick-start and simplify your developers' journey automating the collection of your customers' financial data and making an assessment of a small business's financial health and performance. +The SDKs come in multiple languages and provide sample requests and responses for the full range of lending and underwriting scenarios. + +Our Lending SDK provides all the necessary methods to build your solution, enabling you to develop everything from a merchant capital product to loan writeback with just a single SDK. diff --git a/sidebars/lending.js b/sidebars/lending.js index 8eb1f9cdb..7a90ec1e7 100644 --- a/sidebars/lending.js +++ b/sidebars/lending.js @@ -45,7 +45,6 @@ module.exports = [ "lending/guides/loan-writeback/configure", "lending/guides/loan-writeback/deposit", "lending/guides/loan-writeback/record-general-loan", - "lending/guides/loan-writeback/record-invoice-finance", ], }, {