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

# Obtener una cuenta bancaria

> Una cuenta por su id. Una cuenta de otra empresa es `404`.

Una cuenta por su id (`bacc_…`), con la misma forma que en
[el listado](https://docs.tupana.ai/api-reference/v2/bank-accounts/list.md).

```bash theme={null}
curl https://api.tupana.ai/v2/bank-accounts/bacc_7Hk2938475610293/ \
  -H "Authorization: Api-Key TU_API_KEY"
```

Si la cuenta es de una empresa que no está conectada a tu integración, o no
existe, responde `404`: para tu API key esa cuenta no existe.

> [!NOTE]
>
> Los ids de cuenta que la plataforma entregaba con prefijo `liac_…` siguen
> funcionando en esta ruta. Guarda siempre el `id` que devuelve la API, que es
> `bacc_…`.


## OpenAPI

````yaml api-reference/openapi-v2.json GET /bank-accounts/{account_id}/
openapi: 3.0.0
info:
  title: Tupana API — v2
  description: >-
    API v2 de Tupana: facturación electrónica, cesiones, recaudación, consultas,
    boleta de honorarios y nómina. Los identificadores de recursos son public
    IDs opacos con prefijo (docu_, ment_, cred_, doce_, empl_…).
  version: 2.0.0
servers:
  - url: https://api.tupana.ai/v2
    description: Producción (v2)
security:
  - apiKeyAuth: []
paths:
  /bank-accounts/{account_id}/:
    get:
      tags:
        - Cuentas bancarias
      summary: Obtener una cuenta bancaria
      description: Una cuenta por su id. Una cuenta de otra empresa es `404`.
      operationId: getBankAccount_v2
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
            example: bacc_7Hk2938475610293
      responses:
        '200':
          description: Cuenta bancaria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankAccount'
        '403':
          description: >-
            La API key no tiene `banking:read` explícito (`code:
            banking_permission_required`)
        '404':
          description: La cuenta no existe para esta API key
      security:
        - apiKeyAuth: []
components:
  schemas:
    BankAccount:
      type: object
      properties:
        id:
          type: string
          example: bacc_7Hk2938475610293
        connection_id:
          type: string
          nullable: true
          example: cred_9Pq5028174639201
          description: La conexión (`cred_…`) que alimenta esta cuenta.
        company_id:
          type: string
          example: ment_3672486436546233854
        institution:
          type: object
          properties:
            code:
              type: string
              example: cl_banco_santander
            name:
              type: string
              example: Banco Santander
        type:
          type: string
          enum:
            - depository
            - credit
        subtype:
          type: string
          nullable: true
          enum:
            - checking
            - savings
            - sight
            - credit_card
            - line_of_credit
          description: '`null` cuando Tupana no reconoce el producto del banco.'
        name:
          type: string
          example: Cuenta Corriente
        number_mask:
          type: string
          nullable: true
          example: '5678'
          description: Últimos 4 dígitos. El número completo nunca sale.
        currency:
          type: string
          example: CLP
        balances:
          type: object
          properties:
            current:
              type: number
              nullable: true
              example: 1250000
              description: Saldo contable. En una tarjeta, lo adeudado.
            available:
              type: number
              nullable: true
              example: 1200000
            limit:
              type: number
              nullable: true
              description: Cupo (tarjetas y líneas).
            refreshed_at:
              type: string
              format: date-time
              nullable: true
              description: Última lectura del banco. El GET nunca toca al banco.
        credit:
          type: object
          nullable: true
          description: Solo en cuentas de crédito; `null` en el resto.
          properties:
            billing_period_end:
              type: string
              format: date
              nullable: true
            payment_due_date:
              type: string
              format: date
              nullable: true
              description: '`null` hasta que la fuente lo entregue.'
            minimum_payment:
              type: number
              nullable: true
              description: '`null` hasta que la fuente lo entregue.'
            total_billed:
              type: number
              nullable: true
            statement_id:
              type: string
              nullable: true
              example: ccs_7382910465728
        status:
          type: string
          enum:
            - open
            - closed
            - removed_from_connection
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API Key para autenticación. Debe proporcionarse en el header
        Authorization con el formato: 'Api-Key YOUR-API-KEY' (incluye el prefijo
        'Api-Key ' seguido de tu API key)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.