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

# Add Bank Account (User)

Creates a new bank account for a user. Required fields vary by country — see the [Off-Ramp bank requirements](/reference/offramppartnerv2controller_createpartnerofframp#bank-account-requirements-by-country) for details.

***

## Error Codes

### Common Errors

| HTTP Status | Code                   | Message                            |
| ----------- | ---------------------- | ---------------------------------- |
| 401         | `UNAUTHORIZED`         | "API Key is missing"               |
| 401         | `UNAUTHORIZED`         | "Invalid API Key format"           |
| 401         | `UNAUTHORIZED`         | "Invalid API Key"                  |
| 403         | `INVALID_PARTNER_FLOW` | "The partner has an invalid flow." |

### User Ownership Errors

| HTTP Status | Code           | Message                                              |
| ----------- | -------------- | ---------------------------------------------------- |
| 401         | `UNAUTHORIZED` | "Partner information is required for this operation" |
| 401         | `UNAUTHORIZED` | "User is not associated with the partner"            |

### Endpoint-Specific Errors

| HTTP Status | Code                                      | Message                                                                          |
| ----------- | ----------------------------------------- | -------------------------------------------------------------------------------- |
| 400         | `INVALID_USER_INPUT_ERROR`                | "Invalid User Input"                                                             |
| 400         | `INVALID_USER_INPUT`                      | "Bank name is required for Dominican Republic users"                             |
| 400         | `OFF_RAMP_USER_BANK_INFO_CREATION_FAILED` | "The provided bank: {bankName} is not currently supported for this transaction." |
| 400         | `USER_BANK_INFO_CREATION_FAILED`          | "Failed to create user bank information."                                        |


## OpenAPI

````yaml reference/openapi/UserBankInfoPartnerV2Controller_createUserBankInfoByUserId.json POST /api/partner/v2/banks/users/{userId}/accounts
openapi: 3.0.0
info:
  title: Capa Partner API - V2
  description: >-
    Partner API for integrating cryptocurrency on-ramp and off-ramp services
    using Capa's infrastructure. Enable your users to seamlessly convert between
    fiat and crypto.
  version: v2
  contact: {}
servers:
  - url: https://staging-api.capa.fi
  - url: https://production-api.capa.fi
security: []
paths:
  /api/partner/v2/banks/users/{userId}/accounts:
    post:
      tags:
        - banks
      operationId: UserBankInfoPartnerV2Controller_createUserBankInfoByUserId
      parameters:
        - name: userId
          required: true
          in: path
          description: The user ID to create bank info for
          schema:
            example: 8374f327-38bd-4b0b-b8a7-2524599eb903
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                accountIdentifier:
                  type: string
                  description: Unique identifier for bank account. CLABE if country=MX.
                  example: '014680260346007120'
                country:
                  description: Country code. Determines validation rules.
                  example: MX
                  enum:
                    - MX
                    - DO
                    - US
                    - AT
                    - BE
                    - BG
                    - HR
                    - CY
                    - CZ
                    - DK
                    - EE
                    - FI
                    - FR
                    - DE
                    - GR
                    - HU
                    - IE
                    - IT
                    - LV
                    - LT
                    - LU
                    - MT
                    - NL
                    - PL
                    - PT
                    - RO
                    - SK
                    - SI
                    - ES
                    - SE
                    - IS
                    - LI
                    - 'NO'
                    - CH
                    - GB
                    - MC
                    - SM
                    - AD
                    - VA
                    - CN
                  type: string
                accountType:
                  description: Account type. Required for DO.
                  enum:
                    - SAVINGS
                    - CHECKING
                  type: string
                bankName:
                  type: string
                  description: Bank name. Required for DO / US / SEPA. Not allowed for MX.
                documentIdentifier:
                  type: string
                  description: Document identifier. Required for DO, optional for MX.
                documentType:
                  description: Document type. Required for DO.
                  enum:
                    - PASSPORT
                    - CEDULA
                    - RNC
                  type: string
                routingNumber:
                  type: string
                  description: ABA routing number. Required for US.
                address:
                  type: object
                  description: Address. Required for US.
                  properties:
                    streetLine1:
                      type: string
                      description: Street address line 1. Required.
                      example: 123 Main St
                    streetLine2:
                      type: string
                      description: Street address line 2. Optional.
                    city:
                      type: string
                      description: City. Required.
                      example: New York
                    state:
                      type: string
                      description: State/Province. Optional.
                    postalCode:
                      type: string
                      description: Postal/ZIP code. Required.
                      example: '10001'
                    country:
                      type: string
                      description: ISO 3166-1 alpha-2 country code. Required. Must be US.
                      enum:
                        - US
                      example: US
                  required:
                    - streetLine1
                    - city
                    - postalCode
                    - country
                accountHolder:
                  type: object
                  description: Account holder info. Required for US & SEPA.
                  properties:
                    type:
                      type: string
                      enum:
                        - INDIVIDUAL
                        - BUSINESS
                      description: Type of account holder. Required.
                      example: INDIVIDUAL
                    firstName:
                      type: string
                      description: First name. Required when type=INDIVIDUAL.
                    lastName:
                      type: string
                      description: Last name. Required when type=INDIVIDUAL.
                    businessName:
                      type: string
                      description: Business name. Required when type=BUSINESS.
                  required:
                    - type
                bic:
                  type: string
                  description: BIC code. Required for SEPA.
                iban:
                  type: string
                  description: IBAN. Required for SEPA.
                alias:
                  type: string
                  description: Optional friendly label for the bank account.
                  example: My savings
              required:
                - accountIdentifier
                - country
      responses:
        '201':
          description: Creates a new bank account for a user by userId.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      userId:
                        type: string
                        description: The id of the user that owns this bank information
                      partnerId:
                        type: string
                        description: The id of the partner that owns this bank information
                      bankName:
                        type: string
                        description: The name of the bank in case the bank is not supported
                      accountNumber:
                        type: string
                      accountType:
                        enum:
                          - SAVINGS
                          - CHECKING
                        type: string
                      clabe:
                        type: string
                        nullable: true
                        description: The CLABE number only for Mexican banks
                      country:
                        enum:
                          - MX
                          - DO
                          - US
                          - AT
                          - BE
                          - BG
                          - HR
                          - CY
                          - CZ
                          - DK
                          - EE
                          - FI
                          - FR
                          - DE
                          - GR
                          - HU
                          - IE
                          - IT
                          - LV
                          - LT
                          - LU
                          - MT
                          - NL
                          - PL
                          - PT
                          - RO
                          - SK
                          - SI
                          - ES
                          - SE
                          - IS
                          - LI
                          - 'NO'
                          - CH
                          - GB
                          - MC
                          - SM
                          - AD
                          - VA
                          - CN
                        type: string
                      rampType:
                        enum:
                          - ON_RAMP
                          - OFF_RAMP
                          - CROSS_RAMP
                        type: string
                      documentNumber:
                        type: string
                      documentType:
                        enum:
                          - PASSPORT
                          - CEDULA
                          - RNC
                        type: string
                      alias:
                        type: string
                        description: Optional friendly label for the bank account
                      isVerified:
                        type: boolean
                        description: Whether the bank account is verified
                      verificationStatus:
                        description: The verification status of the bank account
                        enum:
                          - PENDING
                          - VERIFIED
                          - REJECTED
                          - CEP_FAILURE
                        type: string
                      verifiedAt:
                        format: date-time
                        type: string
                        description: The date when the bank account was verified
                      createdAt:
                        format: date-time
                        type: string
                      updatedAt:
                        format: date-time
                        type: string
                    required:
                      - id
                      - userId
                      - accountNumber
                      - accountType
                      - clabe
                      - country
                      - rampType
                      - isVerified
                      - createdAt
                      - updatedAt
              example:
                success: true
                data:
                  id: string
                  userId: string
                  partnerId: string
                  bankName: string
                  accountNumber: string
                  accountType: SAVINGS
                  clabe: string
                  country: MX
                  rampType: ON_RAMP
                  documentNumber: string
                  documentType: PASSPORT
                  alias: string
                  isVerified: true
                  verificationStatus: PENDING
                  verifiedAt: null
                  createdAt: string
                  updatedAt: string
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                INVALID_USER_INPUT_ERROR:
                  value:
                    success: false
                    code: INVALID_USER_INPUT_ERROR
                    message: Invalid User Input
                INVALID_USER_INPUT_ERROR_2:
                  value:
                    success: false
                    code: INVALID_USER_INPUT_ERROR
                    message: Bank name is required for Dominican Republic users
                INVALID_USER_INPUT_ERROR_3:
                  value:
                    success: false
                    code: INVALID_USER_INPUT_ERROR
                    message: >-
                      The bank "{bankName}" is not supported for {country}.
                      Allowed banks: {list}
                UNSUPPORTED_BANK:
                  value:
                    success: false
                    code: UNSUPPORTED_BANK
                    message: >-
                      The provided bank: {bankName} is not currently supported
                      for this transaction.
                USER_BANK_INFO_CREATION_FAILED:
                  value:
                    success: false
                    code: USER_BANK_INFO_CREATION_FAILED
                    message: Failed to create user bank information.
                BAD_REQUEST:
                  value:
                    success: false
                    code: BAD_REQUEST
                    message: >-
                      Bank account verification is already pending. Please wait
                      before retrying.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                UNAUTHORIZED:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: API Key is missing
                UNAUTHORIZED_2:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: Invalid API Key format
                UNAUTHORIZED_3:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: Invalid API Key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                code: USER_NOT_VERIFIED_ERROR
                message: User legal entity could not be resolved for the provided user.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                code: INTERNAL_SERVER_ERROR
                message: Internal server error
      security:
        - PartnerApiKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          description: Optional per-field validation details.
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
      required:
        - success
        - code
        - message
  securitySchemes:
    PartnerApiKey:
      type: apiKey
      in: header
      name: partner-api-key
      description: API key for the affiliated partner performing the request.

````