# Register a customer's bank account

Registers the bank account a customer sends money from.

A customer holds one bank account at a time. Registering another one replaces the existing account, so use this endpoint to correct an account or to move a customer to a new bank.

Endpoint: POST /customer/{id}/bank-accounts
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):

  - `account_number` (string)
    The customer's bank account number or IBAN. Masked in every response, showing only the last four characters.
    Example: 50100123456789

  - `bank_name` (string)
    Name of the bank holding the account.
    Example: HDFC bank

  - `bic_primary` (string)
    SWIFT/BIC code of the bank. Provide this or `bic_secondary`.
    Example: HDFCINBBXXX

  - `bic_secondary` (string)
    Local routing code of the bank — IFSC in India, sort code in the United Kingdom, ABA routing number in the United States. Provide this or `bic_primary`.
    Example: HDFC0000123

## Response 201:

  - `201` (unknown)
    Bank account registered. Any account previously registered against this customer is no longer in use.

## Response 201 fields (application/json):

  - `id` (string)
    Unique identifier of the bank account.
    Example: acccus_6a5f1c92Xq4Wd

  - `account_number` (string)
    The customer's bank account number or IBAN. Masked in every response, showing only the last four characters.
    Example: 50100123456789

  - `bank_name` (string)
    Name of the bank holding the account.
    Example: HDFC bank

  - `bic_primary` (string)
    SWIFT/BIC code of the bank. Provide this or `bic_secondary`.
    Example: HDFCINBBXXX

  - `bic_secondary` (string)
    Local routing code of the bank — IFSC in India, sort code in the United Kingdom, ABA routing number in the United States. Provide this or `bic_primary`.
    Example: HDFC0000123

  - `holder_name` (string)
    Name on the account. Always the customer's own name, so it is derived from the customer and cannot be set on the request.
    Example: Priya Raghunathan

## Response 400:

  - `400` (unknown)
    The request is missing an account number or a bank name, or carries neither `bic_primary` nor `bic_secondary`.

## Response 404:

  - `404` (unknown)
    Customer not found

## Response 404 fields (application/json):

  - `error` (string)
    Enum: "Not found"

  - `message` (string)
    Entity not found
    Enum: "Entity not found"

