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

# Crear el perfil contable del producto de préstamo

> Configura el perfil contable de una versión de producto de préstamo que pertenece al producto de préstamo de la ruta.



## OpenAPI

````yaml es/openapi/v3-current/lender.yaml post /api/v1/loan-products/{id}/accounting-profiles
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: Superficie OpenAPI 3.1 code-first del servicio Lender.
  license:
    name: Lerian Studio General License
  title: Lender API
  version: 1.0.0
servers:
  - url: https://lender.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - description: >-
      Operaciones de contabilidad del ledger: entradas de journal y asientos de
      accrual para cuentas de préstamo.
    name: Accounting
  - description: >-
      Recepción y ciclo de vida de la solicitud de préstamo: envío, decisión y
      estado.
    name: LoanApplications
  - description: >-
      Catálogo de productos de préstamo: definición, versionado y activación de
      productos de crédito.
    name: LoanProducts
  - description: >-
      Operaciones de servicing de cuentas de préstamo: saldos, cronogramas y
      acciones a nivel de cuenta.
    name: Loan Accounts
  - description: >-
      Operaciones de lectura de servicing: cronogramas de reembolso y estado de
      servicing para cuentas de préstamo.
    name: Servicings
  - description: >-
      Operaciones de lectura del panel de cartera: vistas agregadas de cartera y
      de rendimiento.
    name: Dashboard
  - description: >-
      Registro de jurisdicciones: perfiles de jurisdicción soportados y sus
      capacidades.
    name: Jurisdictions
  - description: >-
      Operaciones de solicitud de préstamo específicas por jurisdicción
      (superficie de originación de Brasil).
    name: Loan Applications
  - description: >-
      Operaciones de cálculo de impuestos para crédito específico por
      jurisdicción (por ejemplo, IOF de Brasil).
    name: Tax
  - description: >-
      Operaciones de consignado privado de Brasil: originación de contrato
      (contratación activa) y ciclo de vida.
    name: Consignado
paths:
  /api/v1/loan-products/{id}/accounting-profiles:
    post:
      tags:
        - LoanProducts
      summary: Crear el perfil contable del producto de préstamo
      description: >-
        Configura el perfil contable de una versión de producto de préstamo que
        pertenece al producto de préstamo de la ruta.
      operationId: createLoanProductAccountingProfile
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigureAccountingProfileHumaInputBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingProfileHumaBody'
          description: Created
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    ConfigureAccountingProfileHumaInputBody:
      additionalProperties: false
      properties:
        accountingMode:
          description: Accounting recognition mode.
          enum:
            - accrual
            - cash
          examples:
            - accrual
          type: string
        loanProductVersionId:
          description: Loan product version identifier.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          format: uuid
          type: string
        midazLedgerId:
          description: >-
            Optional per-product Midaz ledger the profile's postings route into;
            both-or-neither with midazOrganizationId. Required under
            multi-tenant mode; empty single-tenant profiles fall back to the env
            default.
          examples:
            - ledger-def
          maxLength: 128
          type: string
        midazOrganizationId:
          description: >-
            Optional per-product Midaz organization the profile's postings route
            into; both-or-neither with midazLedgerId. Required under
            multi-tenant mode; empty single-tenant profiles fall back to the env
            default.
          examples:
            - org-abc
          maxLength: 128
          type: string
        postingRules:
          description: >-
            Non-null GL account mappings per accounting event. New profiles
            require disbursement, repayment, prepayment, and accrual;
            accrual_tax is optional.
          items:
            $ref: '#/components/schemas/PostingRuleHumaInputBody'
          maxItems: 5
          minItems: 4
          type: array
      required:
        - loanProductVersionId
        - accountingMode
        - postingRules
      type: object
    AccountingProfileHumaBody:
      additionalProperties: false
      properties:
        accountingMode:
          description: Accounting recognition mode (accrual|cash).
          examples:
            - accrual
          type: string
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          examples:
            - '2026-06-14T12:00:00Z'
          type: string
        id:
          description: Server-assigned accounting profile identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440003
          type: string
        loanProductVersionId:
          description: Loan product version this profile is configured for (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        postingRules:
          description: Persisted GL account mappings, one per accounting event.
          items:
            $ref: '#/components/schemas/AccountingPostingRuleHumaBody'
          type:
            - array
            - 'null'
      required:
        - id
        - loanProductVersionId
        - accountingMode
        - postingRules
        - createdAt
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    PostingRuleHumaInputBody:
      additionalProperties: false
      properties:
        eventType:
          description: Accounting event type.
          enum:
            - disbursement
            - repayment
            - prepayment
            - accrual
            - accrual_tax
          examples:
            - disbursement
          type: string
        legs:
          description: >-
            Non-null ordered posting legs. Prepayment requires exactly five legs
            in this component order: cash, charge_rebate, iof_refund, principal,
            iof_due; cash is a required debit, principal is a required credit,
            and the three component legs are optional with the corresponding
            sides. Other events require at least one debit and one credit.
          items:
            $ref: '#/components/schemas/PostingLegHumaInputBody'
          maxItems: 16
          minItems: 2
          type: array
        metadata:
          additionalProperties:
            type: string
          description: Optional metadata.
          type: object
      required:
        - eventType
        - legs
      type: object
    AccountingPostingRuleHumaBody:
      additionalProperties: false
      properties:
        eventType:
          description: >-
            Accounting event type
            (disbursement|repayment|prepayment|accrual|accrual_tax).
          examples:
            - disbursement
          type: string
        legs:
          description: Persisted ordered posting legs.
          items:
            $ref: '#/components/schemas/AccountingPostingLegBody'
          type: array
        metadata:
          additionalProperties:
            type: string
          description: Optional metadata carried with the rule.
          type: object
      required:
        - eventType
        - legs
        - metadata
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    PostingLegHumaInputBody:
      additionalProperties: false
      properties:
        account:
          description: GL account for this leg.
          examples:
            - 1100.10.001
          maxLength: 128
          type: string
        component:
          description: Open withholding component code (e.g. "iof"); set this XOR role.
          examples:
            - iof
          maxLength: 64
          type: string
        optional:
          description: >-
            Whether a component amount may be omitted or zero at posting time.
            Permitted only on component legs; omitted defaults to false.
          type: boolean
        role:
          description: Reserved economic role of this leg; set this XOR component.
          enum:
            - principal
            - interest
            - iof
            - tax
            - cash
            - counterparty
          examples:
            - principal
          type: string
        side:
          description: Whether this leg debits or credits the account.
          enum:
            - debit
            - credit
          examples:
            - debit
          type: string
      required:
        - account
        - side
      type: object
    AccountingPostingLegBody:
      additionalProperties: false
      properties:
        account:
          description: GL account for this leg.
          examples:
            - 1100.10.001
          type: string
        component:
          description: Open withholding component code (set XOR role).
          examples:
            - iof
          type: string
        optional:
          description: >-
            Whether the component amount may be absent or zero for a generated
            posting.
          type: boolean
        role:
          description: Reserved economic role of this leg (set XOR component).
          enum:
            - principal
            - interest
            - iof
            - tax
            - cash
            - counterparty
          examples:
            - principal
          type: string
        side:
          description: Whether this leg debits or credits the account.
          enum:
            - debit
            - credit
          examples:
            - debit
          type: string
      required:
        - account
        - side
        - optional
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````