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

# Crea una cuenta (ACC-001)



## OpenAPI

````yaml /openapi/v1.json post /v1/accounts
openapi: 3.0.0
info:
  title: Finzaria API
  description: >-
    API REST de Finzaria — finanzas personales para México, dev-first y
    agent-first. Autentícate con tu API key bxm_ (o un token OAuth).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.finzaria.com/v1
    description: Producción
security: []
tags: []
paths:
  /v1/accounts:
    post:
      tags:
        - accounts
      summary: Crea una cuenta (ACC-001)
      operationId: AccountsController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountDto'
      security:
        - bearer: []
components:
  schemas:
    CreateAccountDto:
      type: object
      properties:
        name:
          type: string
          example: BBVA Nómina
        accountTypeId:
          type: string
          description: >-
            Tipo de cuenta del catálogo del workspace (ACC-012). Requerido salvo
            que envíes `type`.
        type:
          type: string
          enum:
            - checking
            - savings
            - credit_card
            - cash
            - investment
            - loan
            - real_estate
            - other
          description: >-
            Atajo: clave del tipo sembrado (checking, savings, …). Se resuelve
            al tipo del workspace; alternativa a accountTypeId.
        bank:
          type: string
          example: BBVA
        initialBalance:
          type: string
          example: '1500.00'
          description: Saldo inicial. Negativo sólo para loan y credit_card (pasivos).
        currency:
          type: string
          example: USD
          description: >-
            Moneda de la cuenta (ISO 4217). Default = moneda base del workspace
            (09).
        fxMode:
          type: string
          enum:
            - auto
            - fixed
          description: >-
            auto = tasa diaria; fixed = fixedRate. Solo aplica si la moneda ≠
            base (09).
        fixedRate:
          type: string
          example: '17.50000000'
          description: Tasa fija cuenta→base (solo fxMode=fixed).
        apy:
          type: string
          example: '7.5000'
          description: Tasa anual (APY) en %; la usa Forecast (R2).
        alertThreshold:
          type: string
          example: '500.00'
          description: Umbral de alerta de saldo bajo (R2).
      required:
        - name
    AccountDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          description: Tipo del catálogo (ACC-012).
          allOf:
            - $ref: '#/components/schemas/AccountTypeRefDto'
        bank:
          type: string
          nullable: true
        currency:
          type: string
          example: MXN
        balance:
          type: string
          example: '1500.00'
        fxMode:
          type: string
          enum:
            - auto
            - fixed
        fixedRate:
          type: string
          nullable: true
          example: '17.50000000'
        apy:
          type: string
          nullable: true
        alertThreshold:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - active
            - archived
            - closed
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - name
        - type
        - bank
        - currency
        - balance
        - fxMode
        - fixedRate
        - apy
        - alertThreshold
        - status
        - createdAt
        - updatedAt
    AccountTypeRefDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        systemKey:
          type: string
          nullable: true
      required:
        - id
        - name
        - systemKey
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT (Supabase Auth)
      type: http

````