# Register a customer's LRS bank account

Registers the Indian bank account an LRS remittance is debited from. Pass the returned `id` (`acclrs_...`) as `lrs.bank_account_id` when you create an LRS order.
This is not the same endpoint as `POST /customer/{id}/bank-accounts` (`createCustomerBankAccount`), and the two sets of accounts are kept apart:
- A customer can hold several LRS bank accounts. Registering another one adds to the list, whereas
`createCustomerBankAccount` keeps one account per customer and replaces it. Registering the same
account number at the same bank twice is rejected here.
- LRS bank accounts are not returned by `GET /customer/{id}/bank-accounts`, and a bank account from
`POST /customer/{id}/bank-accounts` cannot be used as `lrs.bank_account_id`.
- The account number is returned in full, as sent.

Endpoint: POST /customer/{id}/bank_account
Version: 1.0.0
Security: JWT

## Security:

  - `JWT` (unknown)
    http bearer JWT

## Path parameters:

  - `id` (string, required)
    The ID of the customer

## Request fields (application/json):

  - `bank_code` (string)
    Code of the customer's bank. Must be a `bank_code` returned by `GET /lrs/banks` for your account, matched exactly and case-sensitively. An LRS order that uses this account must use a quote created for the same `bank_code`, or the order is rejected.
    Example: hdfc

  - `account_number` (string)
    The customer's account number at that bank. Digits only, with a length inside the range that bank accepts. Returned in full, as sent, in the response.
    Example: 12345678901234

  - `bank_customer_id` (string)
    Optional. The customer's identifier at their bank. For banks that use one, it must contain only digits, with a length inside the range that bank accepts; an invalid value is rejected with `400`.
    Example: 12345678

## Response 201:

  - `201` (unknown)
    LRS bank account registered

## Response 201 fields (application/json):

  - `id` (string)
    Unique identifier of the LRS bank account. It starts with `acclrs_`.
    Example: acclrs_68468c03g9xt7

  - `bank_code` (string)
    Code of the customer's bank. Must be a `bank_code` returned by `GET /lrs/banks` for your account, matched exactly and case-sensitively. An LRS order that uses this account must use a quote created for the same `bank_code`, or the order is rejected.
    Example: hdfc

  - `account_number` (string)
    The customer's account number at that bank. Digits only, with a length inside the range that bank accepts. Returned in full, as sent, in the response.
    Example: 12345678901234

  - `bank_customer_id` (string)
    Optional. The customer's identifier at their bank. For banks that use one, it must contain only digits, with a length inside the range that bank accepts; an invalid value is rejected with `400`.
    Example: 12345678

## Response 400:

  - `400` (unknown)
    Bad Request — `bank_code` or `account_number` is missing, `bank_code` is not a value returned by `GET /lrs/banks` for your account, `account_number` is not all digits or its length is outside the range the bank accepts, `bank_customer_id` is not all digits or its length is outside the range the bank accepts, the customer does not exist on your account, or the same account number is already registered for this customer at the same bank.

## Response 400 fields (application/json):

  - `error` (string)
    Example: Bad Request

  - `message` (string)
    Example: Bank account already exists

## Response 401:

  - `401` (unknown)
    Unauthorized — invalid or missing authentication token

## Response 401 fields (application/json):

  - `error` (string)
    Example: Unauthorized

  - `message` (string)
    Example: Missing token

## Response 400 examples:

  - `account_number missing` (unknown)

  - `bank_code is not a supported bank` (unknown)

  - `Bank not enabled for your account` (unknown)

  - `bank_customer_id contains a non-digit` (unknown)

  - `Customer does not exist on your account` (unknown)

  - `Account already registered at the same bank` (unknown)

