### Connect to Lead SFTP Server Source: https://docs.lead.bank/file-integrations/sftp-setup Command to establish an SFTP connection to Lead Bank's servers. Requires specifying the path to your private key and your username. Supports both production and sandbox environments. ```bash # Prod sftp -v -i ~/.ssh/your_key username@sftp.lead.bank # Sandbox sftp -v -i ~/.ssh/your_key username@sftp.sandbox.lead.bank ``` -------------------------------- ### Add Lead SFTP Host Key to Known Hosts Source: https://docs.lead.bank/file-integrations/sftp-setup Commands to add the Lead Bank SFTP server's public key to your local `known_hosts` file for both production and sandbox environments. This prevents "man-in-the-middle" warnings during connection. ```bash # Prod ssh-keyscan sftp.lead.bank >> ~/.ssh/known_hosts # Sandbox ssh-keyscan sftp.sandbox.lead.bank >> ~/.ssh/known_hosts ``` -------------------------------- ### Generate SSH Keypair Source: https://docs.lead.bank/file-integrations/sftp-setup Command to generate an SSH keypair. Supports RSA, ECDSA, and ED25519 key types. After generation, display the public key using `cat` for submission. ```bash ssh-keygen -t [rsa|ecdsa|ed25519] cat ``` -------------------------------- ### Accounts File Schema: Document Field Example (JSON) Source: https://docs.lead.bank/changelog This snippet shows an example of the 'documents' field within the Accounts File Schema. It details the expected JSON structure for referencing customer-facing documents, including document ID, type, consent date, and version. This is crucial for correctly formatting document references when integrating with the Accounts File Schema. ```json [ { "document_id": "client_document_123", "type": "xyz_firm_privacy_notice", "consented_at": "2025-02-12T15:38:34.101-06:00", "version": "20220202" } ] ``` -------------------------------- ### Idempotent POST Request Example Source: https://docs.lead.bank/api-integrations/idempotency This example demonstrates how to make an idempotent POST request to the /v1/ach endpoint by including the 'Idempotency-Key' header. ```APIDOC ## POST /v1/ach ### Description This endpoint allows for making idempotent POST requests. By including an `Idempotency-Key` header, you can safely retry requests without creating duplicate operations. If the original request was successful, the API returns the same response; otherwise, it processes the request normally. ### Method POST ### Endpoint /v1/ach ### Parameters #### Header Parameters - **Idempotency-Key** (string) - Required - A unique value (e.g., V4 UUID) up to 255 characters, used to ensure request idempotency. Valid for 48 hours. - **accept** (string) - Optional - Specifies the desired response format, typically `application/json`. - **content-type** (string) - Optional - Specifies the format of the request body, typically `application/json`. #### Request Body - **echo** (string) - Optional - A field to demonstrate request processing. ### Request Example ```bash curl --request POST \ --url https://api.sandbox.lead.bank/v1/ach \ --header 'Idempotency-Key: example-payment-123-retry-001' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "echo": "Hello!" }' ``` ### Response #### Success Response (200) - **echo** (string) - Description of the echoed field from the request. #### Response Example ```json { "echo": "Hello!" } ``` ``` -------------------------------- ### Validate Lead SFTP Host Key Fingerprint Source: https://docs.lead.bank/file-integrations/sftp-setup Commands to generate and validate the fingerprint of the Lead Bank SFTP server's public key for both production and sandbox environments. This is crucial for ensuring the authenticity of the server you are connecting to. ```bash # Prod ssh-keyscan sftp.lead.bank 2>&1 | ssh-keygen -lf - # Sandbox ssh-keyscan sftp.sandbox.lead.bank 2>&1 | ssh-keygen -lf - ``` -------------------------------- ### Website Lead Bank Configuration Source: https://docs.lead.bank/api-reference/endpoint/account-number/list-all-account-number This section details the configuration options for the Lead Bank project associated with a website, including various payment method controls and metadata. ```APIDOC ## GET /websites/{website_id}/lead_bank ### Description Retrieves the lead bank configuration for a specific website. ### Method GET ### Endpoint /websites/{website_id}/lead_bank ### Parameters #### Path Parameters - **website_id** (string) - Required - The unique identifier of the website. ### Response #### Success Response (200) - **internal_transfer** (object) - Controls for internal transfers. - **incoming** (object) - Controls for receiving internal transfers. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_number_ids_allowlist** (array) - Allowlist of account_number IDs that can send. Max length: 20. - items (string) - The ID of the Lead Bank Account Number object. - **outgoing** (object) - Controls for sending internal transfers. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_number_ids_allowlist** (array) - Allowlist of account_number IDs to send to. Max length: 20. - items (string) - The ID of the Lead Bank Account Number object. - **metadata** (object) - A set of key-value pairs for additional information. - **originator_id** (string) - The ID of the Originator object. Example: originator_xyz123. Pattern: ^originator_[^\s]{1,33}$ - **incoming_ach** (object) - Incoming ACH payment controls. - **accept_credit** (boolean) - Accept ACH credits. - **accept_debit** (boolean) - Accept ACH debits. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_company_ids_allowlist** (array) - Allowed Company IDs when mode is allowlist_only. Max length: 20. - items (string) - ACH Company Id. Example: 1234567890. Pattern: ^\d{10}$ - **outgoing_ach** (object) - Outgoing ACH payment controls. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Enum: us_domestic. - **account_number** (string) - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. - **incoming_wire** (object) - Incoming Wire payment controls. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Enum: us_domestic. - **account_number** (string) - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. - **outgoing_wire** (object) - Outgoing Wire payment controls. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Enum: us_domestic. - **account_number** (string) - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. #### Response Example ```json { "internal_transfer": { "incoming": { "counterparty_filter": "accept_all", "counterparty_account_number_ids_allowlist": [] }, "outgoing": { "counterparty_filter": "accept_all", "counterparty_account_number_ids_allowlist": [] } }, "metadata": {}, "originator_id": "originator_xyz123", "incoming_ach": { "accept_credit": true, "accept_debit": false, "counterparty_filter": "accept_all", "counterparty_company_ids_allowlist": [] }, "outgoing_ach": { "counterparty_filter": "accept_all", "counterparty_account_numbers_allowlist": [] }, "incoming_wire": { "counterparty_filter": "accept_all", "counterparty_account_numbers_allowlist": [] }, "outgoing_wire": { "counterparty_filter": "accept_all", "counterparty_account_numbers_allowlist": [] } } ``` ``` ```APIDOC ## PUT /websites/{website_id}/lead_bank ### Description Updates the lead bank configuration for a specific website. ### Method PUT ### Endpoint /websites/{website_id}/lead_bank ### Parameters #### Path Parameters - **website_id** (string) - Required - The unique identifier of the website. #### Request Body - **internal_transfer** (object) - Optional - Controls for internal transfers. - **incoming** (object) - Optional - Controls for receiving internal transfers. - **counterparty_filter** (string) - Optional - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_number_ids_allowlist** (array) - Optional - Allowlist of account_number IDs that can send. Max length: 20. - items (string) - The ID of the Lead Bank Account Number object. - **outgoing** (object) - Optional - Controls for sending internal transfers. - **counterparty_filter** (string) - Optional - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_number_ids_allowlist** (array) - Optional - Allowlist of account_number IDs to send to. Max length: 20. - items (string) - The ID of the Lead Bank Account Number object. - **metadata** (object) - Optional - A set of key-value pairs for additional information. - **originator_id** (string) - Optional - The ID of the Originator object. Example: originator_xyz123. Pattern: ^originator_[^\s]{1,33}$ - **incoming_ach** (object) - Optional - Incoming ACH payment controls. - **accept_credit** (boolean) - Optional - Accept ACH credits. - **accept_debit** (boolean) - Optional - Accept ACH debits. - **counterparty_filter** (string) - Optional - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_company_ids_allowlist** (array) - Optional - Allowed Company IDs when mode is allowlist_only. Max length: 20. - items (string) - ACH Company Id. Example: 1234567890. Pattern: ^\d{10}$ - **outgoing_ach** (object) - Optional - Outgoing ACH payment controls. - **counterparty_filter** (string) - Optional - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Optional - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Optional - Enum: us_domestic. - **account_number** (string) - Optional - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Optional - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. - **incoming_wire** (object) - Optional - Incoming Wire payment controls. - **counterparty_filter** (string) - Optional - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Optional - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Optional - Enum: us_domestic. - **account_number** (string) - Optional - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Optional - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. - **outgoing_wire** (object) - Optional - Outgoing Wire payment controls. - **counterparty_filter** (string) - Optional - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Optional - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Optional - Enum: us_domestic. - **account_number** (string) - Optional - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Optional - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. ### Request Example ```json { "internal_transfer": { "incoming": { "counterparty_filter": "allowlist_only", "counterparty_account_number_ids_allowlist": ["account_number_abc789"] } }, "originator_id": "originator_new123", "incoming_ach": { "accept_credit": false, "accept_debit": true, "counterparty_filter": "reject_all" } } ``` ### Response #### Success Response (200) - **internal_transfer** (object) - Controls for internal transfers. - **incoming** (object) - Controls for receiving internal transfers. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_number_ids_allowlist** (array) - Allowlist of account_number IDs that can send. Max length: 20. - items (string) - The ID of the Lead Bank Account Number object. - **outgoing** (object) - Controls for sending internal transfers. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_number_ids_allowlist** (array) - Allowlist of account_number IDs to send to. Max length: 20. - items (string) - The ID of the Lead Bank Account Number object. - **metadata** (object) - A set of key-value pairs for additional information. - **originator_id** (string) - The ID of the Originator object. Example: originator_xyz123. Pattern: ^originator_[^\s]{1,33}$ - **incoming_ach** (object) - Incoming ACH payment controls. - **accept_credit** (boolean) - Accept ACH credits. - **accept_debit** (boolean) - Accept ACH debits. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_company_ids_allowlist** (array) - Allowed Company IDs when mode is allowlist_only. Max length: 20. - items (string) - ACH Company Id. Example: 1234567890. Pattern: ^\d{10}$ - **outgoing_ach** (object) - Outgoing ACH payment controls. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Enum: us_domestic. - **account_number** (string) - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. - **incoming_wire** (object) - Incoming Wire payment controls. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Enum: us_domestic. - **account_number** (string) - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. - **outgoing_wire** (object) - Outgoing Wire payment controls. - **counterparty_filter** (string) - Control mode for counterparty filtering. Enum: accept_all, reject_all, allowlist_only. Default: accept_all. - **counterparty_account_numbers_allowlist** (array) - Allowed destinations when mode is allowlist_only. Max length: 20. - items (object) - Allowed counterparty account details. - **type** (string) - Enum: us_domestic. - **account_number** (string) - Example: 123412341234. Max length: 17. Min length: 8. Pattern: ^[a-zA-Z0-9]+$. - **routing_number** (string) - Example: 123412341234. Min length: 9. Max length: 9. Pattern: ^[0-9]+$. #### Response Example ```json { "internal_transfer": { "incoming": { "counterparty_filter": "allowlist_only", "counterparty_account_number_ids_allowlist": ["account_number_abc789"] }, "outgoing": { "counterparty_filter": "accept_all", "counterparty_account_number_ids_allowlist": [] } }, "metadata": {}, "originator_id": "originator_new123", "incoming_ach": { "accept_credit": false, "accept_debit": true, "counterparty_filter": "reject_all", "counterparty_company_ids_allowlist": [] }, "outgoing_ach": { "counterparty_filter": "accept_all", "counterparty_account_numbers_allowlist": [] }, "incoming_wire": { "counterparty_filter": "accept_all", "counterparty_account_numbers_allowlist": [] }, "outgoing_wire": { "counterparty_filter": "accept_all", "counterparty_account_numbers_allowlist": [] } } ``` ``` -------------------------------- ### Fixing SSH Private Key Permissions Source: https://docs.lead.bank/file-integrations/sftp-setup Resolves the 'Permissions 0777 for private key are too open' error by setting the correct file permissions for SSH private keys. This ensures that only the owner can read and write the key file, enhancing security. ```shell chmod 600 ~/.ssh/id_rsa ``` -------------------------------- ### Documentation Index Source: https://docs.lead.bank/api-reference/endpoint/funding/create-a-funding Fetch the complete documentation index to discover all available API pages. ```APIDOC ## GET /websites/lead_bank/documentation ### Description Fetches the complete documentation index, which can be used to discover all available API pages before exploring further. ### Method GET ### Endpoint /websites/lead_bank/documentation ### Parameters None ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **documentation_url** (string) - A URL pointing to the documentation index file. #### Response Example ```json { "documentation_url": "https://docs.lead.bank/llms.txt" } ``` ``` -------------------------------- ### GET /v0/fundings/{id} Source: https://docs.lead.bank/api-reference/endpoint/funding/retrieve-a-funding Retrieves a specific Funding object by its ID. This endpoint allows you to get detailed information about a funding, including its status, amounts, and associated balances. ```APIDOC ## GET /v0/fundings/{id} ### Description Retrieve a Funding object. ### Method GET ### Endpoint /v0/fundings/{id} #### Path Parameters - **id** (string) - Required - The ID of the funding object to be retrieved. ### Request Example ```json { "example": "No request body needed for GET request" } ``` ### Response #### Success Response (200) - **id** (string) - Unique ID of the funding object. - **subledger_balance_id** (string) - Unique ID of the credit subledger balance object that a funding object is being created for. - **currency_code** (string) - The currency code for the funding. - **principal** (object) - The total amount of funding that is part of the loan product's principal. - **external_disbursement_amount** (integer) - The portion of the principal amount that will be made available for external disbursement. - **withheld_amount** (integer) - The portion of the principal amount that will be withheld. - **merchant_origination_fee_amount** (integer) - The amount of origination fees charged to the merchant included in the principal. - **other_fees** (object) - Contains other fees associated with the funding. - **borrower_origination_fee_amount** (integer) - The amount of origination fees charged to the borrower. - **metadata** (object) - Additional metadata for the funding. - **client_draw_id** (string) - Client-specific draw identifier. - **status** (string) - The current status of the funding (e.g., 'posted'). - **rejection** (object) - Information about rejection, if applicable. - **reason** (string) - The reason for rejection. - **details** (string) - Detailed explanation of the rejection. - **created_at** (string) - Timestamp when the funding was created. - **updated_at** (string) - Timestamp when the funding was last updated. #### Response Example ```json { "id": "funding_0o5Fs0EELR0fUjHjbCnEtdUwQe3", "subledger_balance_id": "subledger_balance_1HCpXwx2EK9oYluWbacgeCnFcLf", "currency_code": "USD", "principal": { "external_disbursement_amount": 100000, "withheld_amount": 1000, "merchant_origination_fee_amount": 100 }, "other_fees": { "borrower_origination_fee_amount": 200 }, "metadata": { "client_draw_id": "X67BU" }, "status": "posted", "rejection": { "reason": "", "details": "" }, "created_at": "2025-09-02T11:01:36Z", "updated_at": "2025-09-02T11:05:00Z" } ``` #### Error Responses - **400**: Bad Request - The format of the funding ID passed in is invalid. - **403**: Forbidden - Valid access token was not used or lacks proper permissions. - **404**: Not Found - The funding_id passed in is not a valid Funding ID. - **429**: Too Many Requests - Rate limit exceeded. - **500**: Internal Server Error - An unexpected error occurred on the server. ``` -------------------------------- ### Lead Bank Project - /websites/lead_bank Source: https://docs.lead.bank/file-integrations/customer/customer-schema This section details the parameters available for the lead bank project, specifically focusing on currency for annual revenue. ```APIDOC ## GET /websites/lead_bank ### Description Retrieves lead bank information for a given website, including financial details like annual revenue currency. ### Method GET ### Endpoint /websites/lead_bank ### Parameters #### Query Parameters - **business_gross_annual_revenue_currency** (string) - Optional - A three-letter currency code as defined in ISO 4217. ### Response #### Success Response (200) - **business_gross_annual_revenue_currency** (string) - A three-letter currency code as defined in ISO 4217. ``` -------------------------------- ### POST /v1/simulate/ach/incoming_ach Source: https://docs.lead.bank/api-reference/endpoint/simulation/simulate-incoming-ach Simulates an incoming ACH transaction. This endpoint allows for the creation of simulated ACH credits or debits to test integration with Lead Bank's systems. ```APIDOC ## POST /v1/simulate/ach/incoming_ach ### Description Simulate an incoming ACH transaction. This endpoint allows for the creation of simulated ACH credits or debits to test integration with Lead Bank's systems. ### Method POST ### Endpoint https://api.lead.bank/v1/simulate/ach/incoming_ach ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **account_number_id** (string) - Required - The ID of the Lead Bank Account Number object. - **sec_code** (string) - Required - The Standard Entry Class (SEC) code for the ACH transaction (e.g., CCD, PPD, TEL, WEB, CIE). - **transaction_type** (string) - Required - The type of ACH transaction (credit or debit). - **amount** (integer) - Required - The amount of the transaction in cents. - **currency_code** (string) - Required - A three-letter currency code (e.g., USD). - **statement_descriptor** (string) - Required - The description to appear on the customer's statement (max 10 characters). - **sender_name** (string) - Required - The name of the sender (max 16 characters). - **sender_company_id** (string) - Required - The company ID of the sender (max 10 characters). - **sender_routing_number** (integer) - Required - The 9-digit routing number of the sender. ### Request Example ```json { "account_number_id": "account_number_xyz123", "sec_code": "WEB", "transaction_type": "credit", "amount": 5000, "currency_code": "USD", "statement_descriptor": "P2P Credit", "sender_name": "Lorum Inc.", "sender_company_id": "1234567890", "sender_routing_number": 111122222 } ``` ### Response #### Success Response (200) - **SimulateResponse** (object) - An object representing the simulated ACH transaction. #### Response Example ```json { "example": "response body" } ``` #### Error Response (400, 422) - **APIError** (object) - An object containing error details (code, title, detail). ``` -------------------------------- ### List Originators - GET /v0/originators (OpenAPI) Source: https://docs.lead.bank/api-reference/endpoint/originator/list-all-originators This snippet defines the OpenAPI specification for the GET /v0/originators endpoint. It allows listing all originators associated with a specific account, with options for filtering and pagination. The endpoint requires an 'account_id' and supports parameters like 'limit', 'starting_after', 'ending_before', and 'status'. Responses include a list of originators or API errors. ```yaml openapi: 3.0.1 info: title: Lead Bank description: Lead Bank's APIs version: v1.0 servers: - url: https://api.sandbox.lead.bank - url: https://api.lead.bank security: - bearerAuth: [] tags: - name: ACH - name: Account Number - name: OAuth - name: Events - name: Lending - name: Simulation - name: Internal Transfer - name: Disbursement - name: Entity - name: Wire - name: Originator - name: Funding - name: Balances - name: Compliance paths: /v0/originators: get: tags: - Originator summary: List all Originators description: List all Originators. operationId: list-all-originators parameters: - name: account_id in: query required: true example: account_xyz123 schema: type: string pattern: ^account_\w+$ description: The account ID to retrieve the originators for. - name: limit description: Maximum number of objects to be returned. in: query example: 10 schema: type: integer minimum: 1 maximum: 100 default: 10 - name: starting_after in: query example: originator_xyz123 schema: type: string pattern: ^originator_\w+$ description: The ID of the originator to start the list after. - name: ending_before in: query example: originator_xyz123 schema: type: string pattern: ^originator_\w+$ description: The ID of the originator to end the list before. - name: status in: query example: active schema: type: string description: The status of the originator. responses: '200': description: List of Originators content: application/json: schema: $ref: '#/components/schemas/ListOriginator' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/APIError' example: code: parameters_invalid title: Your request parameters did not validate. status: '400' '403': description: Operation Not Allowed content: application/json: schema: $ref: '#/components/schemas/APIError' example: code: operation_not_allowed title: Operation cannot be done on this object. status: '403' '422': description: Unprocessable request. content: application/json: schema: $ref: '#/components/schemas/APIError' '500': description: Server error. Please try your request again. content: application/json: schema: $ref: '#/components/schemas/APIError' components: schemas: ListOriginator: type: object required: - objects - has_more properties: objects: type: array items: $ref: '#/components/schemas/Originator' has_more: type: boolean description: Indicates if there are more originators to retrieve. APIError: type: object properties: code: type: string description: The error code. title: type: string description: The error title. detail: type: string description: A detailed error description. status: type: string description: The HTTP status code. invalid_parameters: type: array description: Invalid request parameters with reasons, if applicable. items: $ref: '#/components/schemas/InvalidParameterDetail' instance: type: string description: >- The object causing this specific occurrence of the error, if applicable. Originator: type: object properties: id: type: string description: The ID of the Originator. example: originator_xyz123 pattern: ^originator_\w+$ account_id: $ref: '#/components/schemas/AccountID' entity_id: $ref: '#/components/schemas/EntityID' status: $ref: '#/components/schemas/OriginatorStatus' company_name: type: string example: Acme Inc. maxLength: 16 company_id: $ref: '#/components/schemas/CompanyId' ach: $ref: '#/components/schemas/AchOriginatorParameters' metadata: $ref: '#/components/schemas/Metadata' ``` -------------------------------- ### Event Delivery and Handling Source: https://docs.lead.bank/api-integrations/webhooks Understand how Lead handles event delivery, retries, and how to ensure event idempotency and prevent missed events. ```APIDOC ## Replayed & Missed Events Lead will consider an event successfully delivered once we receive a 2XX HTTP response from your webhook endpoint. If an event delivery receives a non-2XX response, we will retry delivery every three hours until we receive a success response from your endpoint, or we've made 24 attempts. An event may be delivered multiple times to a webhook endpoint. To prevent processing the same event multiple times you can use the unique event `id` as an idempotency key. To ensure you haven't missed any events, use the [List all events API](/api-reference/endpoint/events/list-all-events) to retrieve previous events up to 90 days. Retrieving an event older than 90 days will result in a 404. ``` -------------------------------- ### Accounts File Schema: CSV Escaped JSON Example Source: https://docs.lead.bank/changelog This example demonstrates how to properly escape JSON strings when embedding them within CSV fields for the 'documents' field in the Accounts File Schema. It shows the original JSON and its CSV-escaped equivalent, highlighting the doubling of internal double quotes. This is essential for data integrity when processing CSV files containing complex JSON data. ```text Original: "[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]" CSV-escaped: "[\"{\"id\":1,\"name\":\"Alice\"},{\"id\":2,\"name\":\"Bob\"}]" ``` -------------------------------- ### Get Subledger Balance Source: https://docs.lead.bank/api-reference/endpoint/subledger-balance/retrieve-a-subledger-balance Retrieves an individual Subledger Balance object. This endpoint allows you to fetch specific balance details for a subledger. ```APIDOC ## GET /websites/lead_bank/subledger_balance ### Description Retrieves an individual Subledger Balance object. This endpoint allows you to fetch specific balance details for a subledger. ### Method GET ### Endpoint /websites/lead_bank/subledger_balance ### Parameters #### Query Parameters - **subledger_id** (string) - Required - The unique identifier for the subledger whose balance is to be fetched. ### Request Example ``` GET /websites/lead_bank/subledger_balance?subledger_id=your_subledger_id ``` ### Response #### Success Response (200) - **balance** (number) - The current balance of the subledger. - **currency** (string) - The currency of the balance (e.g., USD, EUR). - **last_updated** (string) - The timestamp when the balance was last updated. #### Response Example ```json { "balance": 1500.75, "currency": "USD", "last_updated": "2023-10-27T10:30:00Z" } ``` ``` -------------------------------- ### Customers File Document References Source: https://docs.lead.bank/file-integrations/file-guides/documents/overview This section outlines how to reference uploaded documents within the Customers File format. ```APIDOC ## Customers File Document References ### Description This section details how to reference uploaded documents within the Customers File format. ### Method File Upload (Implied) ### Endpoint (Customers File - Specific endpoint not provided) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **identification_documents[].client_document_id** (String) - Optional - Provided if a document upload rather than an approved eKYC workflow is used to support entity identification information. Populate with the filename of the file in the SFTP directory. - **additional_documents[].client_document_id** (String) - Optional - Provided if a document upload rather than an approved eKYC workflow is used to support entity identification information. Populate with the filename of the file in the SFTP directory. ### Request Example ```json { "identification_documents": [ { "client_document_id": "customer_id_doc.pdf" } ], "additional_documents": [ { "client_document_id": "customer_extra_info.png" } ] } ``` ### Response #### Success Response (200) (Success is implied by successful processing of the Customers File.) #### Response Example (No specific response example provided.) ``` -------------------------------- ### GET /v0/originators/{originator_id} Source: https://docs.lead.bank/api-reference/endpoint/originator/retrieve-an-originator Retrieves a specific originator's details using their unique ID. This endpoint is part of the Originator API. ```APIDOC ## GET /v0/originators/{originator_id} ### Description Retrieve an Originator. This endpoint allows you to fetch the details of a specific originator by providing their unique identifier. ### Method GET ### Endpoint /v0/originators/{originator_id} ### Parameters #### Path Parameters - **originator_id** (string) - Required - The ID of the originator to be retrieved. Example: originator_xyz123. Pattern: ^originator_\w+$ ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **id** (string) - The ID of the Originator. - **account_id** (string) - The ID of the Account object. - **entity_id** (string) - The ID of your entity. - **status** (string) - Originator Status (pending, active, inactive, rejected, canceled, suspended). - **company_name** (string) - The name of the company associated with the originator. - **company_id** (string) - ACH Company Id. - **ach** (object) - ACH controls for originators. - **metadata** (object) - Metadata associated with the originator. - **created_at** (string) - Timestamp of when the originator was created. - **updated_at** (string) - Timestamp of when the originator was last updated. #### Response Example ```json { "id": "originator_xyz123", "account_id": "account_xyz123", "entity_id": "entity_xyz123", "status": "active", "company_name": "Acme Inc.", "company_id": "1234567890", "ach": { "allowed_sec_codes": [ "PPD", "CCD" ] }, "metadata": {}, "created_at": "2022-06-27T11:22:33Z", "updated_at": "2022-06-27T11:22:33Z" } ``` #### Error Response (400) ```json { "code": "parameters_invalid", "title": "Your request parameters did not validate.", "status": "400" } ``` #### Error Response (403) ```json { "code": "operation_not_allowed", "title": "Operation cannot be done on this object.", "status": "403" } ``` #### Error Response (404) (Description: Originator ID not found.) #### Error Response (500) (Description: Server error. Please try your request again.) ``` -------------------------------- ### POST /v1/simulate/wires/incoming Source: https://docs.lead.bank/api-reference/endpoint/simulation/simulate-incoming-wire Simulates an incoming wire transaction. This endpoint allows you to test the functionality of receiving wires by providing all necessary details for a wire transfer. ```APIDOC ## POST /v1/simulate/wires/incoming ### Description Simulate an incoming Wire. This endpoint allows for the simulation of an incoming wire transfer, enabling testing of the system's ability to process such transactions. ### Method POST ### Endpoint https://api.lead.bank/v1/simulate/wires/incoming ### Parameters #### Header Parameters - **Idempotency-Key** (string) - Required - Idempotency key. Maximum length is 255 characters. #### Request Body - **amount** (integer) - Required - The amount of the wire transaction in cents. Minimum value is 1, maximum value is 990000000000. - **creditor_account_number_id** (string) - Required - The ID of the creditor account number associated with the wire. Example: `account_number_xyz123`. - **debtor** (object) - Required - Details of the debtor sending funds. - **name** (string) - Required - The name of the debtor. - **account_identifier** (string) - Required - The debtor's account number or IBAN. - **address** (object) - Required - The debtor's address. - **street_line1** (string) - Required - The first line of the street address. - **city** (string) - Required - The city of the address. - **postal_code** (string) - Required - The postal code of the address. - **country_code** (string) - Required - The ISO 3166-1 alpha-2 country code. - **debtor_agent** (object) - Required - Debtor Agent financial institution details. - **name** (string) - Required - The name of the debtor agent. - **bic** (string) - Required - The Business Identifier Code (BIC) of the debtor agent. - **remittance_details** (object) - Optional - Details of the remittance information for the wire. - **message_to_creditor** (string) - Optional - Information intended specifically for the creditor. Maximum length is 140 characters. Can contain alphanumeric characters and specific symbols. - **payment_identifiers** (object) - Optional - Payment identifiers for the wire. - **end_to_end_identification** (string) - Optional - Unique identification that the initiating party can use to unambiguously identify the transaction. Maximum length is 35 characters. Can contain alphanumeric characters and specific symbols. Example: `EndtoEnd12345`. ### Request Example ```json { "amount": 5000, "creditor_account_number_id": "account_number_xyz123", "debtor": { "name": "John Doe", "account_identifier": "1234567890", "address": { "street_line1": "123 Main St", "city": "Anytown", "postal_code": "12345", "country_code": "US" } }, "debtor_agent": { "name": "Example Bank", "bic": "EXAMUS33XXX" }, "remittance_details": { "message_to_creditor": "Payment for invoice 12345" }, "payment_identifiers": { "end_to_end_identification": "EndtoEnd12345" } } ``` ### Response #### Success Response (200) - **SimulateResponse** (object) - An object representing the result of the simulation. The exact structure is defined in the `SimulateResponse` schema. #### Response Example ```json { "wire_id": "wire_abc123", "status": "simulated" } ``` #### Error Response (400, 422) - **APIError** (object) - An object containing error details. - **code** (string) - The error code. - **title** (string) - The error title. - **detail** (string) - A detailed error description. - **status** (string) - The HTTP status code. - **invalid_parameters** (array) - Invalid request parameters with reasons, if applicable. - **instance** (string) - The object causing this specific occurrence of the error, if applicable. #### Error Response Example ```json { "code": "INVALID_PARAMETER", "title": "Invalid Request", "detail": "The provided amount is not valid.", "status": "400", "invalid_parameters": [ { "name": "amount", "reason": "Amount must be greater than 0." } ] } ``` ```