> ## 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.

# Overview

> Understand how to exchange data with Lead via SFTP.

<Info>
  This guide details how to exchange data with Lead via SFTP, including the steps for file submission, processing, integration testing, and go-live readiness.
</Info>

## Connectivity for File Delivery

Lead uses [SFTP with key-based authentication](/file-integrations/sftp-setup) to ensure the secure transfer of all data.

## File Formats and Delimiters

Files are typically submitted in CSV format.

Use a pipe (|) delimiter to separate data elements, and do not use a comma (,) or semicolon (;) delimiter. Specific data schemas define the required fields, data types, and formatting for each file.

<Note>
  Details on which files you should submit for your use-case can be found at [Program Files](/file-integrations/program-files).
</Note>

To minimize file processing errors, we recommend using an open source CSV parser to confirm the CSV formatting is valid before submitting it to Lead.

<Warning>
  All header values are case-sensitive. Please ensure you are following the case definitions as described in each file schema. As an example, all [Customer File Schema](/file-integrations/customer/customer-schema) headers are lower-case, meaning `client_customer_id` as a header value will pass validation, but `CLIENT_CUSTOMER_ID` will not.
</Warning>

## Data Patterns

* **ID Semantics**: The `client_` prefix denotes a partner-generated unique ID for records being created or updated in Lead. To reference an existing record, use its ID without this prefix. Schema fields for such references may use semantic names (e.g., `replaced_by` expecting an existing card's ID) or names indicating the object type (like `account_id` referencing an account originally defined via `client_account_id`).
* **Updating Data**: Records may be updated via file. Updating records via file submission means a complete overwrite. Ensure each submission for an existing client\_id contains the entire updated record.

## File Submission and Processing

### Data Requirements

Depending on the nature of the file, files have differing expectations on what kind of data Lead expects.

<Warning>
  Unless the file type requires all entries daily, do not upload your full dataset on a daily basis. Instead, follow the submission pattern for data that corresponds to each file type in the table below.
</Warning>

| **Submission Requirement**                         | **File Types**                                                                                |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| New records and changes to existing records only   | Customer, Customer Relationship, Applications, Accounts, Cards, Authorized Users, Collaterals |
| New entries only (no updates or unchanged records) | Transactions, Sales Responses, ACH files                                                      |
| Updates only (no new entries)                      | Transactions Update                                                                           |
| All entries daily                                  | Balances (for accounts not in `closed` status), Non-posted Transactions (until posted)        |

## All or Nothing Processing

All files submitted to Lead follow an all-or-nothing paradigm at the file level. When you submit a file, Lead will attempt to process it in its entirety. If any schema or business validation errors are found within the rows of that file, the entire file will be rejected. Each file type’s data schema page and overview pages outlines a non-exhaustive list of which specific schema and business validations are run for that file type.

<Warning>
  We do not support partial file processing.
</Warning>

## Workflows

Files submitted to Lead are processed in grouped workflows. Workflows are logical groups of files that are processed together based on their functional category.

File processing is organized into the following workflow categories:

| **Workflow** | **Files**                                                                         | **File Naming Convention**                                                                                                                                      | Ingestion Paradigm                    |
| ------------ | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| Customer     | Customer and Customer Relationship                                                | `<Batch_id>_<File_Type>_<Version>.csv`                                                                                                                          | [Batch Submission](#batch-submission) |
| Compliance\* | Applications, Accounts, Cards, Authorized Users\*\*                               | `<Batch_id>_<File_Type>_<Version>.csv`                                                                                                                          | [Daily Submission](#daily-submission) |
| Financial    | Balances, Transactions, Collaterals, Non-posted Transactions, Transaction Updates | `<Date>_<File_Type>_<Version>.csv`                                                                                                                              | [Daily Submission](#daily-submission) |
| Sales        | Sales Request (Lead), Sales Response (Client)                                     | `<Date>_<File_Type>_<Version>.csv`                                                                                                                              | [Daily Submission](#daily-submission) |
| Documents    | PDF, JPG, JPEG Documents referenced within file data schemas.                     | `<Date>_<Unique_Id>_<DocumentType>_<Version>.<FileExtension>`  Suggested naming convention, but any string file name is sufficient for the Documents directory. | N/A                                   |

\* For partners onboarded prior to Q2, 2026, the Compliance workflow follows a once-per-day convention, mirroring the Financial workflow.

Best practice is to upload all of the files in a given workflow, wait for a [Slack Alert](https://docs.lead.bank/file-integrations/file-delivery/slack-alerts) with Lead's processing results for those files, then proceeding with either a version bump and resubmission of the workflow or an upload of your next workflow.

<Tip>
  **Consider Your Program Setup**\
  You might be configured for Lead to only expect a subset of files for a given workflow. For example, if your program does not use the Applications or Authorized Users file, then your compliance workflow will only consist of the Accounts and Cards files
</Tip>

<Note>
  **A Note About Sales**

  If your program is a credit-based program (e.g. a credit card or a term loan product), Lead will perform a sales handshake regardless of whether your program has a balance sheet model of Originate-to-Sell or On-Sheet Lending. This workflow runs after the Financial workflows pass validations for a given day. At that point, Lead generates a Sales Request file and you submit a Sales Response file accordingly. Sales Request files only contain receivables designated as Originate-to-Sell (OTS) — if there are no OTS receivables on a given day, the file will be empty. See this [<u>page</u>](https://docs.lead.bank/docs/settlement-amount-methodology#/) for more details.
</Note>

## Ingestion Paradigms

All files within a workflow are grouped together under specific Ingestion Paradigms, which dictate how the files are validated, processed, and resubmitted. Different file types and program configurations follow different rules for submission frequency and processing logic.

#### Daily Submission

**Applies to:**

* Financial Workflow
* Sales Workflow
* Compliance Workflow for partners onboarded prior to Q2, 2026

**How It Works:**

* On any given day T, our system expects a file containing activity for day T-1.
* The filename will reflect date T, but the data inside corresponds to activity from the previous day (T-1).
* Activity is expected to cover the full calendar day: 12:00 a.m. to 11:59:59 p.m. CT on T-1.
* Since the Central Time timezone can change between CST and CDT, we recommend having your code build the calendar day based on the "America/Chicago". When processing your files, Lead will parse the timestamp with the current "America/Chicago" timezone, and extract the date from the timestamp. We then check that dates included are from T-1 (i.e., the date before the file's date).

Files following the Daily Submission paradigm follow a **sequential submission** rule:

* You may only submit Day T+1’s file after Day T’s file has been successfully validated.
* This rule applies even if the file for a given day contains headers only with no activity.

<Note>
  [See use case examples](/file-integrations/use-cases/deposit-accounts) to determine Day 0 so you can begin testing and uploading files.
</Note>

#### Batch Submission

Once you submit a file with a `batch_id`, Lead will wait five minutes for other files to be delivered with the same `batch_id` and then begin processing the full batch. Under Batch Submission, files within a workflow are grouped together. Files with no errors or dependencies on erroneous files will be processed successfully. For example - an Accounts file submission within a Compliance workflow may return a success message, even when an error exists in a Cards file uploaded with the same `batch_id` because no changes to the Accounts file are required.

Batch Submission will only return a cross-file validation failure when a file includes a reference to an object that Lead cannot find, either within the same batch, a previous batch, or an API submission.

**Applies to:**

* Compliance Workflow (Applications, Accounts, and Cards files) for programs onboarded from Q2 2026 onward.

Once a workflow is processed successfully, no more submissions for the same Batch may be submitted.

#### Strict Batch Submission

**Applies to:**

* Customer Workflow (Customer, Customer Relationship)
  * **If your program is configured to require the Customer Relationship file:** Both files must be submitted with the same batch ID before a batch will begin to process.
  * **If your program is configured to only require the Customer file:** Each file needs a unique batch ID.

**How It Works:**

Strict Batching allows multiple file submissions per day, distinct by a unique `batch_id`. In this semantic, the workflow is atomic: all files required for the workflow must pass validation together. Strict Batching differs from Batching in that, if either file has any failures, the entire batch will fail to process, requiring resubmission of the full batch.

* **Batching:** All files in the workflow must be submitted with the same `batch_id` to trigger processing.
* **Validation:** If *any* file in the batch fails validation, the **entire batch** is rejected. No data from the batch is persisted.

<Danger>
  Ensure that the Batch ID is unique for each batch; re-used batch IDs will not be processed.
</Danger>

## Resubmitting Files

If a file or workflow receives an Error alert, that indicates that Lead has not saved any information contained within the file. You must resubmit it for Lead to process the files.

1. Correct the errors based on the Slack alert.
2. Increment the `<Version>` in the filename, keeping the same date or batch ID designator from the file name.
3. Resubmit the corrected file to the appropriate SFTP folder.

**Restrictions on Resubmitting Successful Files:**

For **Daily** file submission workflows, *Lead is not able to accept multiple successful submissions for one day*. If a success alert is delivered for a day, subsequent submissions for the same date will not be processed. If, for any reason, a record was missed in a daily file's aggregation, and that file processes successfully, the missed record would need to be included in the subsequent day's file submission.

### Reminders

<Tip>
  **File Schemas**

  Each file type you submit has a defined data schema outlining all fields, requirements, and data types. Please consult the specific schema documentation for each file (e.g., Accounts Data Schema, Transactions Data Schema). You should familiarize yourself deeply with the file schemas.
</Tip>

<Tip>
  **Files in SFTP**

  Once we've provisioned your SFTP access, you may need to submit a first file before you can view the directory.
</Tip>

<Warning>
  **Escaped JSON**

  When a field requires JSON data within a CSV, the JSON string must be enclosed in double quotes, and any internal double quotes must be escaped by doubling them. Refer to the individual data schema pages for fields requiring this format.
</Warning>
