> ## 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.

# Resolve statement line

> Link existing records first, else create a manual movement or own-account transfer, or exclude with a reason. Undo restores pending and removes records created by this resolution atomically. Does not learn rules.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/statements/lines/{statement_line_id}/resolve
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/statements/lines/{statement_line_id}/resolve:
    post:
      tags:
        - API
      summary: Resolve statement line
      description: >-
        Link existing records first, else create a manual movement or
        own-account transfer, or exclude with a reason. Undo restores pending
        and removes records created by this resolution atomically. Does not
        learn rules.
      operationId: resolveApiStatementLine
      parameters:
        - name: Idempotency-Key
          in: header
          description: Clave estable para deduplicar reintentos de la misma operación.
          required: true
          schema:
            type: string
        - name: statement_line_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    action:
                      type: string
                      const: link
                    targets:
                      minItems: 1
                      maxItems: 100
                      type: array
                      items:
                        oneOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                const: payment
                              payment_id:
                                type: string
                                format: uuid
                              amount:
                                type: integer
                            required:
                              - type
                              - payment_id
                              - amount
                            additionalProperties: false
                          - type: object
                            properties:
                              type:
                                type: string
                                const: journal_entry
                              journal_entry_id:
                                type: string
                                format: uuid
                              amount:
                                type: integer
                            required:
                              - type
                              - journal_entry_id
                              - amount
                            additionalProperties: false
                  required:
                    - action
                    - targets
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      type: string
                      const: movement
                    account_id:
                      type: string
                      format: uuid
                    contact_id:
                      type: string
                      format: uuid
                    cost_center1_id:
                      type: string
                      format: uuid
                    cost_center2_id:
                      type: string
                      format: uuid
                    cost_center3_id:
                      type: string
                      format: uuid
                    note:
                      type: string
                      maxLength: 2000
                  required:
                    - action
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      type: string
                      const: transfer
                    counterpart_type:
                      $ref: '#/components/schemas/ApiSharedEnum53162db3eb'
                    counterpart_id:
                      type: string
                      format: uuid
                  required:
                    - action
                    - counterpart_type
                    - counterpart_id
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      type: string
                      const: exclude
                    reason:
                      type: string
                      minLength: 1
                      maxLength: 500
                  required:
                    - action
                    - reason
                  additionalProperties: false
                - type: object
                  properties:
                    action:
                      type: string
                      const: undo
                    reason:
                      type: string
                      minLength: 1
                      maxLength: 500
                  required:
                    - action
                    - reason
                  additionalProperties: false
      responses:
        '200':
          description: Statement result or immutable replay
          content:
            application/json:
              schema:
                type: object
                required:
                  - request_id
                  - data
                properties:
                  request_id:
                    type: string
                  data:
                    type: object
                    properties:
                      object:
                        type: string
                        const: statement_line_resolution
                      statement_line_id:
                        type: string
                        format: uuid
                      statement_id:
                        type: string
                        format: uuid
                      status:
                        $ref: '#/components/schemas/ApiSharedEnume7b34c7d75'
                      reconciliation_id:
                        anyOf:
                          - type: string
                            format: uuid
                          - type: 'null'
                      created_record_id:
                        anyOf:
                          - type: string
                            format: uuid
                          - type: 'null'
                    required:
                      - object
                      - statement_line_id
                      - statement_id
                      - status
                      - reconciliation_id
                      - created_record_id
                    additionalProperties: false
        '400':
          description: Statement request could not be completed
          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: Statement request could not be completed
                      retryable: false
                      details: []
        '401':
          description: Statement request could not be completed
          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: Statement request could not be completed
                      retryable: false
                      details: []
        '403':
          description: Statement request could not be completed
          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: Statement request could not be completed
                      retryable: false
                      details: []
        '404':
          description: Statement request could not be completed
          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: Statement request could not be completed
                      retryable: false
                      details: []
        '409':
          description: Idempotency or statement state conflict
          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: Idempotency or statement state conflict
                      retryable: false
                      details: []
        '422':
          description: Statement request could not be completed
          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: Statement request could not be completed
                      retryable: false
                      details: []
        '429':
          description: Statement request could not be completed
          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: Statement request could not be completed
                      retryable: false
                      details: []
        '503':
          description: >-
            Statement request could not be completed Verificación de
            credenciales temporalmente ocupada; reintentá sin cambiar la
            operación ni su Idempotency-Key.
          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: Statement request could not be completed
                      retryable: false
                      details: []
                authentication_capacity:
                  summary: Verificación temporalmente ocupada
                  value:
                    request_id: req_auth_capacity_1
                    error:
                      type: api_error
                      code: INTERNAL_ERROR
                      message: >-
                        La verificación de credenciales está ocupada. Reintentá
                        más tarde.
                      retryable: true
                      details: []
          headers:
            Retry-After:
              description: >-
                Segundos de espera. La verificación de credenciales indica 1;
                otras dependencias pueden indicar otro valor.
              schema:
                type: string
                example: '1'
            Cache-Control:
              description: La verificación de credenciales indica no-store.
              schema:
                type: string
                example: no-store
components:
  schemas:
    ApiSharedEnum53162db3eb:
      type: string
      enum:
        - bank_account
        - register
        - safe
    ApiSharedEnume7b34c7d75:
      type: string
      enum:
        - pending
        - linked
        - excluded
    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:
                type: object
                properties:
                  field:
                    type: string
                  code:
                    type: string
                  message:
                    type: string
                  metadata:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type:
                        - string
                        - number
                        - boolean
                        - 'null'
                required:
                  - code
                  - message
                additionalProperties: false
          required:
            - type
            - code
            - message
            - retryable
            - details
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Incluí tu API key en el header Authorization con el prefijo Bearer.

````

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