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

# Register Bank Account

> Registers an external bank account for your company or for one of your users. The account is created with status `in_review` and can be used once Kravata approves it (`accepted`).

#### Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| Authorization | Header | Yes | `Bearer <access>` obtained from **POST /api/token**. |
| clientId | Query | Yes | Your client ID, from **GET /api/infoClient**. Requests without it are rejected with 401. |
| userId | Query | No | Register the account for one of your users instead of your company. |

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| accountNickname | string | Yes | Alias to identify the account (max 50 characters). |
| accountNumber | string | Yes | Account number (max 50 characters). For `breb`, the Bre-B key. |
| accountType | string | Yes | `ahorros` (savings), `corriente` (checking) or `breb` (Colombia's Bre-B instant payment key). |
| accountHolderName | string | No | Name of the account holder. Defaults to `accountNickname`. |
| bankId | integer | Yes, except for `breb` | Bank ID from **GET /api/parameters/banks**. For `breb` it is resolved automatically from the key. |
| currencyId | string | Only if the currency is not COP | 3-letter currency code, e.g. `MXN` or `USD`. Send it together with `countryId`. |
| countryId | integer | Only if the currency is not COP | Country of the account. Send it together with `currencyId`. |
| metadata | array | Depends on the currency | List of `('metadataName', 'metadataValue')`. MXN accounts require `CABLE` (CLABE number) and USD accounts require `ABBA` (ABA routing number). You can add `MEMO` as a transfer reference. |

#### Response

The registered account: `id`, `status` (`in_review`), `accountNickname`, `accountHolderName`, `accountType`, `accountNumber`, `bankId`, `bank`, `countryFiatId`, `metadata`, `isCustodial` and `registerDate`.

#### Errors

| Status | When |
| --- | --- |
| 400 | Invalid body, account already registered, or invalid country/currency combination. |
| 401 | Missing token or `clientId`. |



## OpenAPI

````yaml /business/openapi.json post /api/accounts
openapi: 3.1.0
info:
  title: Kravata Business API
  version: '1.0'
  description: >-
    Kravata Business API: on-ramp and off-ramp orders, accounts and wallets,
    users, custody wallets and transfers.
servers:
  - url: https://testapi.kravata.co
    description: Test
  - url: https://apiv2.kravata.co
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Accounts
  - name: Wallets
  - name: Users
  - name: Ramp Orders
  - name: Custody
  - name: Webhooks
paths:
  /api/accounts:
    post:
      tags:
        - Accounts
      summary: Register Bank Account
      description: >-
        Registers an external bank account for your company or for one of your
        users. The account is created with status `in_review` and can be used
        once Kravata approves it (`accepted`).


        #### Request


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | Authorization | Header | Yes | `Bearer <access>` obtained from **POST
        /api/token**. |

        | clientId | Query | Yes | Your client ID, from **GET /api/infoClient**.
        Requests without it are rejected with 401. |

        | userId | Query | No | Register the account for one of your users
        instead of your company. |


        #### Request Body


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | accountNickname | string | Yes | Alias to identify the account (max 50
        characters). |

        | accountNumber | string | Yes | Account number (max 50 characters). For
        `breb`, the Bre-B key. |

        | accountType | string | Yes | `ahorros` (savings), `corriente`
        (checking) or `breb` (Colombia's Bre-B instant payment key). |

        | accountHolderName | string | No | Name of the account holder. Defaults
        to `accountNickname`. |

        | bankId | integer | Yes, except for `breb` | Bank ID from **GET
        /api/parameters/banks**. For `breb` it is resolved automatically from
        the key. |

        | currencyId | string | Only if the currency is not COP | 3-letter
        currency code, e.g. `MXN` or `USD`. Send it together with `countryId`. |

        | countryId | integer | Only if the currency is not COP | Country of the
        account. Send it together with `currencyId`. |

        | metadata | array | Depends on the currency | List of `('metadataName',
        'metadataValue')`. MXN accounts require `CABLE` (CLABE number) and USD
        accounts require `ABBA` (ABA routing number). You can add `MEMO` as a
        transfer reference. |


        #### Response


        The registered account: `id`, `status` (`in_review`), `accountNickname`,
        `accountHolderName`, `accountType`, `accountNumber`, `bankId`, `bank`,
        `countryFiatId`, `metadata`, `isCustodial` and `registerDate`.


        #### Errors


        | Status | When |

        | --- | --- |

        | 400 | Invalid body, account already registered, or invalid
        country/currency combination. |

        | 401 | Missing token or `clientId`. |
      operationId: register-bank-account
      parameters:
        - name: clientId
          in: query
          required: true
          description: ''
          schema:
            type: string
        - name: userId
          in: query
          required: false
          description: 'Optional: register it for one of your users.'
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accountHolderName:
                  type: string
                accountNickname:
                  type: string
                accountNumber:
                  type: string
                accountType:
                  type: string
                bankId:
                  type: integer
                currencyId:
                  type: string
                countryId:
                  type: integer
                metadata:
                  type: array
                  items:
                    type: object
                    properties:
                      metadataName:
                        type: string
                      metadataValue:
                        type: string
            example:
              accountHolderName: ACME MEXICO SA DE CV
              accountNickname: Main MXN account
              accountNumber: '1234567999'
              accountType: ahorros
              bankId: 1
              currencyId: MXN
              countryId: 21
              metadata:
                - metadataName: CABLE
                  metadataValue: '100011010'
                - metadataName: MEMO
                  metadataValue: cuenta1234
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  accountHolderName:
                    type: string
                  accountNickname:
                    type: string
                  accountNumber:
                    type: string
                  accountType:
                    type: string
                  bankId:
                    type: integer
                  clientId:
                    type: string
                  id:
                    type: string
                  metadata:
                    type: array
                    items:
                      type: object
                      properties:
                        bankAccountId:
                          type: string
                        metadataName:
                          type: string
                        metadataValue:
                          type: string
                  status:
                    type: string
              examples:
                mxn:
                  summary: MXN
                  value:
                    accountHolderName: MXN ACCOUUNTS
                    accountNickname: MXN ACCOUNT
                    accountNumber: '1234567999'
                    accountType: ahorros
                    bankId: 1
                    clientId: 08597c65-c25b-4a7c-8c68-f1180bce65f4
                    id: 181e4661-30bb-4c39-86f3-dd6fe98e4302
                    metadata:
                      - bankAccountId: 181e4661-30bb-4c39-86f3-dd6fe98e4302
                        metadataName: CABLE
                        metadataValue: '100011010'
                      - bankAccountId: 181e4661-30bb-4c39-86f3-dd6fe98e4302
                        metadataName: MEMO
                        metadataValue: cuenta1234
                    status: in_review
                usd:
                  summary: USD
                  value:
                    accountHolderName: USD ACCOUUNTS
                    accountNickname: USD ACCOUNT
                    accountNumber: '1234567222999'
                    accountType: ahorros
                    bankId: 1
                    clientId: 08597c65-c25b-4a7c-8c68-f1180bce65f4
                    id: 1cdf5764-3f91-4883-a17d-a2c73f9da1b2
                    metadata:
                      - bankAccountId: 1cdf5764-3f91-4883-a17d-a2c73f9da1b2
                        metadataName: ABA
                        metadataValue: '100011010'
                      - bankAccountId: 1cdf5764-3f91-4883-a17d-a2c73f9da1b2
                        metadataName: MEMO
                        metadataValue: cuenta1234
                    status: in_review
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /api/token (valid 5 minutes).

````