> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lead.bank/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy

> How to originate and disburse loans with Lead's legacy lending product.

<Warning>
  This version of the product — originating loans via file upload and disbursements via the Disbursement API or ACH file — is no longer available for new partners. Refer to the Overview page to see more about the latest version of the product.
</Warning>

## Introduction

Lead supports both consumer and commercial lending programs on this legacy lending product. There are two core steps involved:

* You originate loans through [secure file transfers via SFTP](/file-integrations/sftp-setup).
* You disburse loans in one of two ways: (1) use the [Disbursement API](https://docs.lead.bank/api-reference/endpoint/lending/create-a-disbursement), or (2) send Lead an ACH file with the disbursement details.

## Disbursing with the Disbursement API

The Disbursement API is a rail-agnostic mechanism to instruct Lead to execute a disbursement once the loan's origination has been approved by Lead. It accepts the required inputs that Lead needs to successfully execute the disbursement, creates a `Disbursement` object, then notifies you of state changes on the disbursement as it moves through its lifecycle.

Once the loan origination has been approved, take the `client_loan_id` of the loan you want to disburse, and call the Disbursement API with these inputs:

* **Payment method**: The payment rail to be used in the loan disbursement. Only ACH as a payment rail is currently supported.
* **Payment details:** Details specific to the payment rail that are required for Lead to successfully execute the disbursement. For ACH, these inputs are required: statement descriptor, counterparty information (e.g., account number, routing number), delivery type (same business day or next business day).

If your program is configured to use the Disbursement API, Lead will run periodic validations to ensure that all loans originated were subsequently disbursed. Because of this, even in cases where the disbursement amount is \$0 (e.g., if the full loan amount is being withheld for a period of time before it is disbursed externally), you are still required to call the [Create Disbursement API](https://docs.lead.bank/api-reference/endpoint/lending/create-a-disbursement) endpoint for every `client_loan_id` originated.

### Tracking the Disbursement Lifecycle via Webhooks

After a `Disbursement` object is created, it transitions through various states until it reaches a terminal state of `succeeded` or `failed`. At each state change, we send you a webhook:

* `lending.disbursement.processing`: Lead is processing the disbursement, and you can no longer cancel it.
* `lending.disbursement.succeeded`: The disbursement succeeded, and funds have landed in the counterparty's account (assuming the account is in good standing with the counterparty's bank).
* `lending.disbursement.failed`: The disbursement failed. Refer to the `failure` hash on the `Disbursement` object to see details about the failure.

### ACH Corrections

When you send a disbursement via ACH rails, occasionally receiving banks identify an error with the disbursement (e.g., account number is incorrect) and notify Lead. When Lead receives such errors, we send you a `lending.disbursement.ach_correction` webhook. Since you can receive these ACH corrections regardless of whether the disbursement succeeded or failed, your system must anticipate handling these notifications throughout the disbursement's lifecycle. These corrections are intended to communicate that information in your system needs to be addressed or updated (e.g., update the account number).

When you see an ACH correction, follow these steps:

<Steps>
  <Step title=" ">
    **Review the correction:** Assess the details provided in the `lending.disbursement.ach_correction` event to understand the nature of the error. Details about the correction will be included in the `payment_details.correction`[ hash](https://docs.lead.bank/api-reference/endpoint/lending/retrieve-a-disbursement#response-payment-details-correction).
  </Step>

  <Step title=" ">
    **Update your records:** Correct the erroneous or outdated details in your system to prevent future disbursement failures.
  </Step>

  <Step title=" ">
    **Resubmit if necessary:** If the ACH-based disbursement is in a `failed` state and you have not yet resubmitted the disbursement request, initiate the disbursement again with the corrected information.
  </Step>
</Steps>

<Note>
  For more details on events and webhooks, visit our [Events & Webhooks page](/api-integrations/webhooks).
</Note>

## Disbursing with an ACH File

ACH file integrations are no longer available. Refer to our [ACH API Guide](https://docs.lead.bank/api-integrations/ach/overview) to see our full suite of API-based ACH functionality.
