# getDefacto Documentation > Defacto provides instant, embedded financing for SMBs across Europe. Our API gives you everything you need to build and scale financing inside your product — with no operational complexity or regulatory risk. We’ve powered over €1B in financing for 12K+ SMBs through 15+ partners. Plug in and launch fast. Append .md to any documentation page URL to get its markdown version. ## API Reference - [Get access to the API](https://developers.getdefacto.com/reference/get-access-to-the-api.md) - [Authentication](https://developers.getdefacto.com/reference/authentication.md) - [What are the reasons for ineligibility?](https://developers.getdefacto.com/reference/what-are-the-reasons-for-a-loan-request-rejection.md) - [Financial products](https://developers.getdefacto.com/reference/financial-products.md) - [Make your first loan in 5 minutes](https://developers.getdefacto.com/reference/make-your-first-loan.md) - [Marketplace x PAY_LATER](https://developers.getdefacto.com/reference/marketplace-x-pay_later.md): You are a marketplace and you want to offer your users (buyers) a “Buy Now Pay Later” option? - [Marketplace x CASH_IN_NOW](https://developers.getdefacto.com/reference/marketplace-x-cash_in_now.md): You are a marketplace and you want to offer your users (sellers) to get paid upfront? - [Fintech x WALLET_FINANCING](https://developers.getdefacto.com/reference/fintech-x-open_loan.md): You are a neobank, B2B SaaS and you want to offer your users credit products? - [How do we calculate fees](https://developers.getdefacto.com/reference/how-do-we-calculate-fees.md) - [/bill/{bill_id}/sent](https://developers.getdefacto.com/reference/post_bill-bill-id-sent.md): This endpoint enables you to notify Defacto when you sent the bill for the fees of the loans to your user. A bill should be sent to the user only when its status is VALIDATED (see GET /bills endpoint). It is very important to use this endpoint so that Defacto can proceed to a recollection process that will be fair for our users. This endpoint is useful only for partners who send the bill themselves. By default the bills are sent the the payers of the fees by Defacto. If you need to send them by yourself please get in touch with us. - [/bills](https://developers.getdefacto.com/reference/get_bills.md): List your fees invoices (i.e: your Defacto bill) for the loans you performed on the platform.
By default, this endpoint only returns your own bills, but you may request bills for your own specific borrowers (with a business identifier or ID) depending on your contract type. - [/referrer/{referrer_id}/upload-invoice/{revenue_share_id}](https://developers.getdefacto.com/reference/post_referrer-referrer-id-upload-invoice-revenue-share-id.md): Upload revenue share invoice for a referrer and update the related revenue share - [/referrer/{referrer_id}](https://developers.getdefacto.com/reference/get_referrer-referrer-id.md): Get referrer details by ID - [/borrower/{borrower_id}](https://developers.getdefacto.com/reference/get_borrower-borrower-id.md): Retrieve the full profile of a borrower by ID. Returns the borrower's status, business information, accounts, compliance checks, and next actions required. - [/borrower/{borrower_id}/deactivate](https://developers.getdefacto.com/reference/post_borrower-borrower-id-deactivate.md) - [/borrower/{borrower_id}/owner](https://developers.getdefacto.com/reference/post_borrower-borrower-id-owner.md): Create a borrower owner with identity documents - [/borrower/{borrower_id}/repayment-methods](https://developers.getdefacto.com/reference/get_borrower-borrower-id-repayment-methods.md):

List available repayment methods for borrower.

- [/borrower/{borrower_id}/repayment-methods](https://developers.getdefacto.com/reference/post_borrower-borrower-id-repayment-methods.md):

Add and/or choose the repayment method for borrower.

If payment method is "DIRECT_DEBIT" then the `account` parameter must not be null.

If `is_default_repayment_method` is true, then the repayment method becomes the borrower's default repayment method so that upcmoing loan requests will use this payment method and account as a default.

Please note: that the account defined in the `loan_to` attribute of created loans is left unchanged. If you want to change the destination account of a loan, you must cancel it and request a new loan.

If `apply_to_all_active_loans` is true, then the repayment method is used for upcoming payments of all loans that are in TO_REPAY or TO_REPAY_FEES statuses.

- [/borrower/{borrower_id}/sign](https://developers.getdefacto.com/reference/post_borrower-borrower-id-sign.md): Register the date a new borrower accepted our T&Cs - [/borrowers](https://developers.getdefacto.com/reference/get_borrowers.md): List all borrowers enrolled on Defacto for your account. Borrowers are companies that have been registered and can request loans through the Defacto platform. Returns a paginated list with their status, business info, accounts, and compliance data. - [/borrowers](https://developers.getdefacto.com/reference/post_borrowers.md):

Enroll a new borrower on Defacto.

This API will create a borrower and a credit line for this borrower. More information in the behavior section below.

Timeout: 30 seconds (status code will be 504 in such a case)


Required data

Borrower must be a commercial company -> eg. in France needs to be registered at an RCS.

If the borrower repays by direct debit, the following information are mandatory:

We strongly recommend that you fill up all the information when you can, even on the sandbox. For French borrowers, we manage to pull most of the director information automatically, however for other countries, this might not be the case. For the borrowers that Defacto is not able to fetch the mandatory data, you need to provide them to ensure borrower creation. Otherwise the API will return a 400 error and list the values that it could not obtain.

Behavior

This API endpoint creates a borrower in our system, configures our system to get the repayment of the loan, evaluates the maximum amount of money we can lend to this company and creates a credit line for this borrower. After the credit line is created for this borrower, you can get it with GET /credit-lines?borrower=.
Synchronous and asynchronous behaviors are offered.

Synchronous behavior:


Asynchronous behavior (default one):

🚧

Careful if you subscribe to the CreditLine.CREATED webhook!

If you subscribe to the webhook, please note that there is an inconsistency in the API at the moment. The webhook sends a borrower_id that does not correspond to the borrower id that you received with this endpoint (it's rather a business_id in our DB, that you cannot fetch).

So at the moment we recommend you to GET /credit-lines?borrower= for all borrowers waiting for a credit line when you receive the webhook event.

- [/onboarding/{onboarding_id}](https://developers.getdefacto.com/reference/get_onboarding-onboarding-id.md): ## [Partners] Follow the onboarding of a business If you haven't visited the guide: [how to make your first loan?](https://developers.getdefacto.com/reference/make-your-first-loan) we recommend you to visit it first. When your borrower is on our web app, sharing his financial data, you might want to keep track of his onboarding. This endpoints will let you get access to the onboarding status and details. You'll be able to know if the borrower has shared his financial data and is ready to request loans; how much does defacto proposes to lend him; and more. - [/onboardings](https://developers.getdefacto.com/reference/post_onboardings.md): ## [Partners] Start onboarding a new business If you haven't visited the guide: [how to make your first loan?](https://developers.getdefacto.com/reference/make-your-first-loan) we recommend you to visit it first. **Timeout after**: 30 seconds (status code will be 504 in such a case) In order to request loans you will need to have borrowers. In order to test borrower's eligibility, we'll need to have access to borrower business' financial data. This can be achieved in two ways: Either you have this piece of information and you may use the [sharing business data](https://developers.getdefacto.com/reference/post_business-data-account-transactions) API documentation to do so, or you might want to rely on defacto's onboarding process to get this information. In the later, you will need to create an onboarding for the business you want to request loans for. ### Behavior When you send this API request providing business information, your referral and callback url: The system will start an onboarding for you and you will get its id in the response. Then you must redirect the borrower to the onboarding tunnel so that he can select his financial tools and share as much data as he wants to max-out his eligible amount: - **In the normal case**, redirect him to `https://app.getdefacto.com/onboarding/continue/{onboarding_id}`. - **When the response contains a `secure_resume_link`**, redirect him to that link *instead* of the bare continue URL above. This happens when the business already has a bank-connected onboarding: to avoid exposing another party's financial data, that tunnel is gated and can only be reopened by a link carrying a short-lived secure token. The `secure_resume_link` is exactly that pre-authenticated continue URL. It is valid for **2 hours** — if it expires, POST /onboarding again to obtain a fresh one. Once borrower has accepted defacto's T&Cs and created his account, he'll be redirected back to the redirect_url you provided and if you subscribed to `CREDIT_LINE.Created` webhook you will receive it shortly. Read [webhook](https://developers.getdefacto.com/reference/webhooks-at-defacto) for details. ### Frequently Asked Questions **How do I get onboarding results?** You can use the GET /onboarding/{onboarding_id} endpoint to retrieve the onboarding results. **What should I do if the status of the onboarding is expired?** Onboardings last for 168 hours; after what you'll have to repeat the POST /onboarding request you just made. **How do I get the borrower's ID once onboarding is `COMPLETED`?** You can use the GET /onboarding/{onboarding_id} endpoint to retrieve the borrower's ID under the `borrower_id` attribute; or you can GET /borrowers/?identifier={business_identifier} to directly get the borrower object. - [/borrower/{borrower_id}/financial-products](https://developers.getdefacto.com/reference/get_borrower-borrower-id-financial-products.md): ## List the financial products available to the borrower. Financial products are the product against which a borrower can submit loan requests. Each come with its own set of rules, and balances (maximum amount available, etc.). - [/borrower/{borrower_id}/financial-products/capacity-growth](https://developers.getdefacto.com/reference/get_borrower-borrower-id-financial-products-capacity-growth.md): ## Capacity growth projection, per financial product with growth support. Explains how the borrower's max borrowing capacity on a financial product grows over usage "cycles": real past growth steps when the borrower is already in a cycle, and 1-2 illustrative future steps assuming on-time repayment. Amounts are always computed server-side; internal configuration and income figures are never returned, only the resulting curve (and whether it has plateaued, via `is_near_cap`). A projected step can also carry `is_less_certain`: even a step the curve keeps climbing toward can need a human at deployment time, independently of `is_near_cap`. `is_less_precise` flags the whole projection when it couldn't be based on the borrower's own income figure and fell back to a generic cap instead. `progress` states the usage criterion twice: as `pct_to_next_threshold`, and as the amounts behind it — `required_financing_amount` is what the current cycle asks the borrower to finance, `remaining_financing_amount` how much of it is left (0 once the criterion is passed). The criterion is really a volume in amount x days, so both amounts assume a loan running for the whole minimum cycle duration. `min_duration_days` and `pct_max_amount_to_use` are the two cycle rules those figures come from: finance at least `pct_max_amount_to_use` % of the capacity over a cycle lasting at least `min_duration_days` days. They are configured per business financial product, so read them from here rather than treating them as constants. Returns one entry per eligible financial product. Only the receivable financing product has cycle support today, so the list currently has at most one entry — an empty list means the borrower has no such product yet. - [/business/data-request/data-type/{data_type}](https://developers.getdefacto.com/reference/get_business-data-request-data-type-data-type.md): Get translations for a given data request data type. - [/translation/denial-code/{code}](https://developers.getdefacto.com/reference/get_translation-denial-code-code.md) - [/business/data/account-transactions](https://developers.getdefacto.com/reference/post_business-data-account-transactions.md): Upload bank account transactions into our platform to refine borrower credit line allowance. This endpoint doesn't support updates on data already uploaded. The account field of the transactions should match the id field of the accounts you share with the POST /business/data/accounts endpoint. - [/business/data/accounts](https://developers.getdefacto.com/reference/post_business-data-accounts.md): Upload bank account balances into our platform to refine borrower credit line allowance. This endpoint doesn't support updates on data already uploaded. The id field of the accounts should match the account field of the transactions you share with the POST /business/data/account-transactions endpoint. If you only have the IBAN of the account, the IBAN being a unique identifier, you can use the IBAN in both id and account_number. - [/business/data/batch-upload](https://developers.getdefacto.com/reference/post_business-data-batch-upload.md): Create a batch to upload data about a particular business. This endpoint returns an id that should be put into all /business/data/XXX endpoints. **Why use batch?** - with the batch, you can send accounts transactions in chunks instead of sending them all in a single API call - with the batch, you can share more context (see parameter below) with us which enables us to update credit lines more accurately - [/business/data/batch-upload/{batch_id}/close](https://developers.getdefacto.com/reference/post_business-data-batch-upload-batch-id-close.md): Close a batch of upload started with POST /business/data/batch-upload. This operation is a required one. Otherwise no data of the batch will be used. - [/business/data/invoices](https://developers.getdefacto.com/reference/post_business-data-invoices.md): Upload business invoices into our platform to refine borrower credit line allowance. This endpoint doesn't support updates on data already uploaded. - [/business/public-data](https://developers.getdefacto.com/reference/get_business-public-data.md): Search for borrower business information from various sources. This endpoint lets you find the right business identifier to use when onboarding a borrower or counterparty. - [/business/{business_id}/segment](https://developers.getdefacto.com/reference/get_business-business-id-segment.md) - [/cards](https://developers.getdefacto.com/reference/get_cards.md): List credit cards for the authenticated borrower. - [/cards/{card_id}](https://developers.getdefacto.com/reference/get_cards-card-id.md): Retrieve a credit card by its ID. - [/cards/{card_id}/entries](https://developers.getdefacto.com/reference/get_cards-card-id-entries.md): List entries for a credit card. - [/cards/{card_id}/ephemeral-key](https://developers.getdefacto.com/reference/post_cards-card-id-ephemeral-key.md): Create an ephemeral key to reveal the card's PAN and CVV via the card display SDK. - [/cards/{card_id}/status](https://developers.getdefacto.com/reference/patch_cards-card-id-status.md): Update card status. Accepted values: 'active', 'inactive', 'canceled'. - [/cards/{card_id}/entries/export](https://developers.getdefacto.com/reference/get_cards-card-id-entries-export.md): Export card transactions as a Pennylane-compatible CSV. Provide either period (YYYY-MM) or from_date + to_date. - [/counterparties](https://developers.getdefacto.com/reference/get_counterparties.md): List all the Counterparties. A Counterparty describes any commercial relations with a company. Counterparties are automatically created from the invoices. - [/counterparties](https://developers.getdefacto.com/reference/post_counterparties.md): Create a new counterparty. A Counterparty describes any commercial relations with a company. Counterparties are automatically created from the invoices. - [/counterparty/{counterparty_id}](https://developers.getdefacto.com/reference/get_counterparty-counterparty-id.md): Get a counterparty by id. A Counterparty describes any commercial relations with a company. Counterparties are automatically created from the invoices. - [/credit_line](https://developers.getdefacto.com/reference/get_credit-line.md): [DEPRECATED] Get the credit line associated with your account.
Your partner max-exposure is no longer available by API - [/credit_line/{credit_line_id}](https://developers.getdefacto.com/reference/get_credit-line-credit-line-id.md): [DEPRECATED] Get credit line by id.
Now use financial-product endpoint - [/credit_lines](https://developers.getdefacto.com/reference/get_credit-lines.md): List all the credit lines that have been opened for your company.
By default, this includes all credit lines that have been created for borrowers you registered, as well as the credit line associated with your account. - [/eligibility/beneficiary](https://developers.getdefacto.com/reference/post_eligibility-beneficiary.md):

Ask if the business can receive the money originated from a loan on one of its bank accounts.

It should be interpreted the following way:

- [/eligibility/borrower](https://developers.getdefacto.com/reference/post_eligibility-borrower.md):

Ask for the pre-eligibility of a borrower.

It should be interpreted the following way:

- [/eligibility/reasons](https://developers.getdefacto.com/reference/get_eligibility-reasons.md): List all the possible reasons for which a borrower would not be eligible for a loan. - [/events](https://developers.getdefacto.com/reference/get_events.md): Search for business events. These events will let you read business events to build you logic on top of it. - [/hello](https://developers.getdefacto.com/reference/get_hello.md): Make a first call to this endpoint to test your connection to Defacto API with your API Key - [/sandbox/business-eligible](https://developers.getdefacto.com/reference/post_sandbox-business-eligible.md): This endpoint enables you to configure the eligibility of a business. Pass NOT_ELIGIBLE to make a business non-eligible. Then, you'll be able to test how the Defacto API behaves when requesting a loan for a non-eligible business. You can test multiple scenarios: (1) when the business is the borrower or (2) when the business is on the invoice to finance but is not the borrower. - [/sandbox/business-generator](https://developers.getdefacto.com/reference/get_sandbox-business-generator.md): Generate a fake business for you to use in your test. Important, this endpoint does not create the business but simply return the payload. Call `/borrowers` to register this business and generate loan for it Warning: these invoices and their IBANs will not work in production. - [/sandbox/iban-generator](https://developers.getdefacto.com/reference/get_sandbox-iban-generator.md): Generate a new IBAN that will produce a given scenario on the sandbox, for example a rejected loan. Each IBAN can be used as the account of a single counterparty or borrower (a buyer or seller of yours). So, if you want to test the API for several of your counterparties, you will have to generate several of them. The BIC associated to these IBANs is FK2FACTO. Also, if you want to test another scenario on a given business, create a new IBAN and use it in the to_account field of the next invoice and loan that you create for this counterparty. For more information on the scenarios of the sandbox, please refer to the Testing Multiple Scenarios & Errors section. Warning: these IBANs will not work in production. - [/sandbox/invoice-generator](https://developers.getdefacto.com/reference/post_sandbox-invoice-generator.md): !!! The documentation website is not able to display the full response of this endpoint. The use of the curl command is recommended. !!! Generate a fake invoice that will produce a given scenario on the sandbox, for example a rejected loan. The generation will not add the invoice to the list of your invoices. You must do this via API. To achieve this, you can copy the invoice_creation_payload into the payload of the invoice creation API. If you want to test another scenario on a given business, create another fake invoice. For more information on the scenarios of the sandbox, please refer to the Testing your integration section. Warning: these invoices and their IBANs will not work in production. - [/installment-plan/{installment_plan_id}](https://developers.getdefacto.com/reference/get_installment-plan-installment-plan-id.md): ## Keep track of the progress of an installment plan When the borrower is late to repay his loans or bills, he probably agreed to an installment plan. This endpoint lets you keep track of a given installment plan. When every installments are in PAID status, the plan is fully repaid. - [/recollection-case/{recollection_case_id}](https://developers.getdefacto.com/reference/get_recollection-case-recollection-case-id.md): Get details of a recollection case. - [/recollection-case/{recollection_case_id}](https://developers.getdefacto.com/reference/put_recollection-case-recollection-case-id.md): Add notes to a recollection case to follow up on recollection process. - [/recollection-case/{recollection_case_id}/installment-plans](https://developers.getdefacto.com/reference/post_recollection-case-recollection-case-id-installment-plans.md): ## Allow repaying in multiple times This endpoint is dedicated to the creation of an installment plan as part of recollection strategy. You'll need a recollection-case id to use this endpoint. In the event of insolvency, your debtor can opt for an installment plan to repay his debt with smaller recurring pamyents. This smoothens the repayment effort, allowing the debtor to reimburse selected loans or bills progressively. the value of the `installment` parameter must be obtained by calling the POST /installment-plan/compute endpoint. The `repayment_method` field allows you to decide between direct-debit and sepa credit transfer. If you pick DIRECT_DEBIT, the debited account will reuse borrower's main repayment account. cf. GET /borrower/{borrower_id}/repayment-methods endpoint We know recollection process has costs, for this reason the `recollection_fees` field permits adding an arbitrary amount to proposed installment plan. This amount can cover recollection expenses for example. When recollection_fees are collected, they are paid-out to the partner later. - [/recollection-case/{recollection_case_id}/installment-plans/compute](https://developers.getdefacto.com/reference/post_recollection-case-recollection-case-id-installment-plans-compute.md): ## Simulate an installment plan Before creating an installment plan you might need to expose installment amounts & dates to your debtor so that you can find the right agreement. This endpoint will help you achieving such simulation. To use this endpoint, you'll need to provide the list of loans or bills you want to repay with proposed plan. Then select plan starting date and periodicity. The system automatically returns a plan avoiding avoiding bank holidays and weekends and explicitly, enlists loans paid on every installment & gives the lettering of each installment. The returned payload will serve as an input for POST /recollection-case//installment-plan endpoint. __Note:__ The `recollection_fees` amount allows you to add an arbitrary amount to the proposed installment plan. See POST /recollection-case//installment-plan endpoint. - [/recollection-cases](https://developers.getdefacto.com/reference/get_recollection-cases.md): Get recollection cases. You can filter results using debtor business identifier. - [/recollection-cases](https://developers.getdefacto.com/reference/post_recollection-cases.md): ## Open a recollection case When the borrower is late to repay his loans or bills, you must open a recollection case to start taking actions to recover the debt. This endpoint will let you open a new recollection case for a business (debtor). You need to indicate at least one loan or bill (ids). For the follow up of the case by the recollection agent, you need to add a task to be done in the future. The task MUST have a name and a due date, the description is optional. - [/payments](https://developers.getdefacto.com/reference/get_payments.md): Get payments related to loans - [/installments](https://developers.getdefacto.com/reference/get_installments.md): List installements. Filter by loan or various dates to find what you're looking for. - [/installment-plans](https://developers.getdefacto.com/reference/post_installment-plans-1.md): ## Create an installment plan When you send this API request, our system will create an installment-plan that replaces any scheduled payments you may have on the loans involved in this installment-plan. Once fully processed, the installment-plan reaches the SCHEDULED status with its payment intents in PROPOSED status, ready to be executed. **Key Parameters**: As the loan request is a complex operation, it has many parameters. The most important ones are: - payment method (SCT or Direct debit) - amount (in cents) - debited account information in case of direct debit - installments - loans and their amounts - installment date - payment reference ### Behavior The endpoint returns 201 immediately with the installment-plan in DRAFT status. Cancelation of the previous scheduled plans on the same loans, creation of payment intents, and activation of the new plan happen asynchronously in a background task — poll the resource to observe the transition to SCHEDULED. Retrying with the same salt_id returns the existing plan (dedup); when salt_id is omitted, it is derived from the sorted loan_ids. - [/invoice/{invoice_id}](https://developers.getdefacto.com/reference/delete_invoice-invoice-id.md): Delete an invoice by id - [/invoice/{invoice_id}](https://developers.getdefacto.com/reference/get_invoice-invoice-id.md): Get an invoice by id - [/invoice/{invoice_id}](https://developers.getdefacto.com/reference/patch_invoice-invoice-id.md): Updates an invoice (with status TO_SUBMIT or TO_EDIT only) - [/invoice/{invoice_id}/submit](https://developers.getdefacto.com/reference/post_invoice-invoice-id-submit.md): Submit an invoice for validation by Defacto (with status TO_SUBMIT or TO_EDIT). If some data is missing prior to validating the invoice, a 422 error will be returned with the list of the missing fields. - [/invoices](https://developers.getdefacto.com/reference/get_invoices.md): Get your invoices - [/invoices](https://developers.getdefacto.com/reference/post_invoices.md): Create an invoice. - If you create an invoice that will need to be edited afterwards, create a draft invoice with the is_draft parameter. Otherwise set is_draft to false. - This endpoint requires the base64-encoded value of the PDF of the invoice. You can for example use [base64guru](https://base64.guru/converter/encode/pdf). - [/invoices/upload](https://developers.getdefacto.com/reference/post_invoices-upload.md): Create an invoice entity from the PDF of an invoice. Send the file within a formData. The endpoint will automatically extract the invoice information and create an invoice entity from them. - [/loan/documents/{document_type}](https://developers.getdefacto.com/reference/post_loan-documents-document-type.md): Generates a link to an archive of loan documents - [/loan/repayment-terms](https://developers.getdefacto.com/reference/put_loan-repayment-terms.md):

Change repayment terms of some loans

Changing the payment method and / or date is only possible on loans that are TO_REPAY or TO_REPAY_FEES.

Postponing loan repayment date is only possible once, except for some financial products with customized rescheduling rules. An overall ceiling (configurable per financial product, 30 days by default) from the original contractual date still applies regardless. Repaying earlier is never restricted.

If loan is supposed to be repaid using a sepa direct-debit, you may not be able to change the debited account number less than 3 days before the scheduled payment date because payment has already been instructed. In such case you'll get a 400 error telling you that the payment cannot be cancelled anymore.

- [/loan/{loan_id}](https://developers.getdefacto.com/reference/get_loan-loan-id.md): Retrieve a loan by its ID. Returns the full loan details including status, amounts, repayment schedule, borrower information, and related documents. - [/loan/{loan_id}](https://developers.getdefacto.com/reference/patch_loan-loan-id.md): Updates a loan. - When the loan is SUBMITTED or TO_VALIDATE, all the below fields can be updated. - When the loan is VALIDATED or SCHEDULED, the references and to_repay_at fields can be updated. - When the loan is TO_REPAY, only the to_repay_at change be changed. The earliest acceptable date being loan.earliest_to_repay_at. This operation is not available when the loan is in another status. - [/loan/{loan_id}/cancel](https://developers.getdefacto.com/reference/post_loan-loan-id-cancel.md): Use this function to cancel a loan proposal. Available for TO_VALIDATE,VALIDATED and SCHEDULED loans. - [/loan/{loan_id}/events](https://developers.getdefacto.com/reference/get_loan-loan-id-events.md): Get the activity eligibility_request of a loan. - [/loan/{loan_id}/validate](https://developers.getdefacto.com/reference/post_loan-loan-id-validate.md): Use this function to accept a loan proposal. Available for TO_VALIDATE loans only. - [/loans](https://developers.getdefacto.com/reference/get_loans.md): List loans with pagination. Returns a paginated list of loans filterable by borrower, status, dates, and loan type. - [/loans](https://developers.getdefacto.com/reference/post_loans.md): ## Request a new loan. If you haven't visited the guide: [how to make your first loan?](https://developers.getdefacto.com/reference/make-your-first-loan) we recommend you to visit it first. **Key Parameters**: As the loan request is a complex operation, it has many parameters. The most important ones are: - borrower - amount - to_pay_at - to_repay_at - salt_id: ⚠️ In order to avoid accidental duplication in requested loans we recommend you to set the salt_id parameter to a unique value for each request. **Timeout after**: 30 seconds (status code will be 504 in such a case) For loan related to invoices, at the moment, we don't support multiple-invoices financing. - You can either request a loan for an existing invoice, in which case you should set invoice_ids. - Or you can create the invoice and request a loan with a single call to this API. - If you pass an invoice in invoices, the base64-encoded value of the PDF of the invoice is required under the document property. You can for example use base64guru. ### Behavior When you send this API request, our system will: 1. Create a loan (you will get its id in the response) 2. Start evaluating your loan request. Here you should choose between 2 behaviors: a. (default) Getting the decision asynchronously. The status of the returned loan will always be PENDING_VALIDATION. Webhooks will tell you if it goes approved or declined. In can happen from a few seconds after the request up to a few days after it. b. Getting the decision synchronously. This is recommended if this endpoint is called directly from a frontend. To activate this option, set "wait_for_validation": true. In such a case, the returned loan status will be: i. if the loan is automatically accepted by Defacto -> the status of the loan will be TO_VALIDATE if you set "auto_validate": false, or one of: VALIDATED, SCHEDULED, INITIATED, TO_REPAY. Fore more information on this, see section "Why the status of the loan in the response vary?" below. ii. if the loan is automatically declined by Defacto -> the status of the loan will be DECLINED and the denial_reason will be set. iii. if the loan validation takes longer than 20s (max response time is 2 business days) -> the status of the loan will be PENDING_VALIDATION. It is therefore very important to think about how to communicate with the end-user. While its not an issue for validated loans, it can get frustrating for declined loans. Users must be alerted of loans that gets declined few hours after their request. 3. If the loan is accepted by Defacto, it will then move forward and its status will be updated regularly. Subscribe to webhooks to get live notifications of this. **Why the status of the loan in the response vary?** The status vary because our system is asynchronous and the steps moving the loan forward may be executed immediately or not depending on the current load on our system. **What should I do if the status of the loan is __TO_VALIDATE__?** TO_VALIDATE means that Defacto accepted the loan as is. The next step is to get the user consent for this loan offer. When obtained, call [POST /loan/{loan_id}/validate](https://developers.getdefacto.com/reference/post_loan-loan-id-validate). Most of the time the user does not want to do this manual consent. To avoid requiring this, you can set "auto_validate": true in your request. When setting this option, please ensure that its very explicit for the user that the loan may be automatically accepted and paid so that they won't be able to cancel it. Users can cancel the loan only before Defacto sends the money to the beneficiary, which happens 24 to 48 hours before the "to_pay_at" date. - [/loan-request/{loan_request_id}](https://developers.getdefacto.com/reference/get_loan-request-loan-request-id.md): Read back a loan request opened by the caller's distribution. - [/loan-requests](https://developers.getdefacto.com/reference/get_loan-requests.md): List the loan requests opened by the caller's distribution. - [/loan-requests](https://developers.getdefacto.com/reference/post_loan-requests.md): Create an editable DRAFT loan request and return the front redirect URL. - [/repay/now](https://developers.getdefacto.com/reference/post_repay-now.md) - [/recollection-case/{recollection_case_id}/actions](https://developers.getdefacto.com/reference/post_recollection-case-recollection-case-id-actions.md): ## Add a recollection action to a case Record an action on an existing recollection case: either to log an action taken (the due date can be today) or to assign a task for a teammate to handle. The action needs a name and a due date; the description is optional. The author is taken from your identity. Provide `assignee` (an agent email) to assign the mirrored HubSpot task to that person; when the email matches a HubSpot owner the task is assigned to them, otherwise the task is created unassigned. - [/subscription/{subscription_id}/activate](https://developers.getdefacto.com/reference/post_subscription-subscription-id-activate.md): Activate a subscription. - [/subscription/invoice/{invoice_id}/download](https://developers.getdefacto.com/reference/get_subscription-invoice-invoice-id-download.md): Get a freshly presigned download URL for a subscription invoice PDF. - [/webhook/{webhook_id}](https://developers.getdefacto.com/reference/delete_webhook-webhook-id.md): Delete a webhook subscription. - [/webhook/{webhook_id}](https://developers.getdefacto.com/reference/patch_webhook-webhook-id.md): Update a webhook subscription. ⚠️ Our webhooks always call the POST method of the given url. For more information on webhooks such as how to secure them, you can refer to our guide. - [/webhooks](https://developers.getdefacto.com/reference/get_webhooks.md): List your webhook subscription. ⚠️ Our webhooks always call the POST method of the given url. For more information on webhooks such as how to secure them, you can refer to our guide. - [/webhooks](https://developers.getdefacto.com/reference/post_webhooks.md): Create a webhook subscription. ⚠️ Our webhooks always call the POST method of the given url. For more information on webhooks such as how to secure them, you can refer to our guide. ## Recipes - [Finance payables](https://developers.getdefacto.com/recipes/finance-payables-1.md) - [Finance receivables](https://developers.getdefacto.com/recipes/finance-receivables.md) - [Migrating from Credit Line to Financial Products](https://developers.getdefacto.com/recipes/migrating-from-credit-line-to-financial-products.md) - [Onboard your customers](https://developers.getdefacto.com/recipes/onboard-your-customers.md) - [Track loans & status](https://developers.getdefacto.com/recipes/track-loans-status.md)