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

# Obtener mayor de cuenta

> Devuelve líneas del mayor para una cuenta, con saldo inicial, saldo final y saldo corriente por línea dentro de la ventana filtrada.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/accounting/accounts/{account_id}/ledger
openapi: 3.1.0
info:
  title: La Pyme API
  description: >-
    Resources and workflows for purchases, sales, inventory, contacts, products,
    reports, and settings.
  version: 1.0.0
  contact:
    name: La Pyme Support
    email: hola@lapyme.com.ar
  license:
    name: Proprietary
    url: https://lapyme.com.ar/terminos
servers:
  - url: https://api.lapyme.com.ar
    description: Servidor de producción
security:
  - bearerAuth: []
tags:
  - name: API
    description: Public API operations for La Pyme integrations.
paths:
  /api/v1/accounting/accounts/{account_id}/ledger:
    get:
      tags:
        - API
      summary: Obtener mayor de cuenta
      description: >-
        Devuelve líneas del mayor para una cuenta, con saldo inicial, saldo
        final y saldo corriente por línea dentro de la ventana filtrada.
      operationId: getApiAccountLedger
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: cursor
          in: query
          required: false
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: date_from
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: date_to
          in: query
          required: false
          schema:
            type: string
            format: date
        - name: source_type
          in: query
          required: false
          schema:
            type: string
        - name: contact_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: cost_center_1_ids
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: cost_center_2_ids
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: cost_center_3_ids
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
      responses:
        '200':
          description: Mayor de cuenta encontrado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAccountLedgerResponse'
              examples:
                default:
                  summary: Mayor de clientes por cobrar
                  value:
                    request_id: req_ledger_1
                    data:
                      object: account_ledger
                      account:
                        object: account
                        id: 550e8400-e29b-41d4-a716-446655440303
                        code: 1.1.2
                        name: Clientes por cobrar
                      opening_balance: 0
                      currency: PES
                      lines: []
                      closing_balance: 0
                      has_more: false
                      next_cursor: null
        '400':
          description: Solicitud inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Solicitud inválida
                      retryable: false
                      details: []
        '401':
          description: API key faltante o inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: API key faltante o inválida
                      retryable: false
                      details: []
        '403':
          description: Scope insuficiente o contabilidad no habilitada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Scope insuficiente o contabilidad no habilitada
                      retryable: false
                      details: []
        '404':
          description: Cuenta no encontrada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Cuenta no encontrada
                      retryable: false
                      details: []
        '429':
          description: Límite de solicitudes excedido para la organización
          headers:
            Retry-After:
              description: Segundos a esperar antes de volver a intentar la solicitud.
              schema:
                type: string
                example: '30'
            X-RateLimit-Limit:
              description: Límite de la ventana activa.
              schema:
                type: string
                example: '5000'
            X-RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa.
              schema:
                type: string
                example: '0'
            X-RateLimit-Reset:
              description: Segundos restantes hasta el reset de la ventana activa.
              schema:
                type: string
                example: '30'
            RateLimit-Limit:
              description: Límite de la ventana activa en formato estándar.
              schema:
                type: string
                example: '5000'
            RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa en formato estándar.
              schema:
                type: string
                example: '0'
            RateLimit-Reset:
              description: >-
                Segundos hasta el reset de la ventana activa en formato
                estándar.
              schema:
                type: string
                example: '30'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: RATE_LIMITED
                  value:
                    request_id: req_rate_limit_1
                    error:
                      type: rate_limit_error
                      code: RATE_LIMITED
                      message: >-
                        The organization request limit was reached. Try again
                        later.
                      retryable: true
                      details: []
        '500':
          description: Error interno del servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_error_1
                    error:
                      type: invalid_request_error
                      code: INVALID_REQUEST
                      message: Error interno del servidor
                      retryable: false
                      details: []
components:
  schemas:
    ApiAccountLedgerResponse:
      type: object
      properties:
        request_id:
          type: string
        data:
          type: object
          properties:
            object:
              type: string
              const: account_ledger
            account:
              $ref: '#/components/schemas/ApiSharedObject6f6a8f3873'
            opening_balance:
              type: integer
            currency:
              type: string
            lines:
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObject263c44dc2c'
            closing_balance:
              type: integer
            has_more:
              type: boolean
            next_cursor:
              anyOf:
                - type: string
                - type: 'null'
          required:
            - object
            - account
            - opening_balance
            - currency
            - lines
            - closing_balance
            - has_more
            - next_cursor
          additionalProperties: false
      required:
        - request_id
        - data
      additionalProperties: false
    ApiErrorEnvelope:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - authorization_error
                - business_error
                - external_dependency_error
                - idempotency_error
                - invalid_request_error
                - rate_limit_error
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObjectc671832641'
          required:
            - type
            - code
            - message
            - retryable
            - details
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
    ApiSharedObject6f6a8f3873:
      type: object
      properties:
        object:
          type: string
          const: account
        id:
          type: string
          format: uuid
        code:
          anyOf:
            - type: string
            - type: 'null'
        name:
          type: string
      required:
        - object
        - id
        - code
        - name
      additionalProperties: false
    ApiSharedObject263c44dc2c:
      type: object
      properties:
        object:
          type: string
          const: account_ledger_line
        id:
          type: string
          format: uuid
        date:
          type: string
          format: date
        journal_entry_id:
          type: string
          format: uuid
        account_id:
          type: string
          format: uuid
        source_type:
          anyOf:
            - type: string
            - type: 'null'
        source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        description:
          type: string
        reference:
          anyOf:
            - type: string
            - type: 'null'
        counterparty_name:
          anyOf:
            - type: string
            - type: 'null'
        contact_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        cost_center1_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        cost_center2_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        cost_center3_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        debit:
          type: integer
        credit:
          type: integer
        currency:
          type: string
        balance:
          type: integer
      required:
        - object
        - id
        - date
        - journal_entry_id
        - account_id
        - source_type
        - source_id
        - description
        - reference
        - counterparty_name
        - contact_id
        - cost_center1_id
        - cost_center2_id
        - cost_center3_id
        - debit
        - credit
        - currency
        - balance
      additionalProperties: false
    ApiSharedObjectc671832641:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
      required:
        - code
        - message
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Incluí tu API key en el header Authorization con el prefijo Bearer.

````