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

# Preview jurisdiction tax amounts (partner)

> Answers as POST /api/v1/br/tax/preview to a partner credential bound to the loan product. A loanProductVersionId that is not a version of that product is answered 404, as an unknown product is.



## OpenAPI

````yaml /en/openapi/v3-current/lender.yaml post /api/v1/br/partner/loan-products/{loanProductId}/tax/preview
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Code-first OpenAPI 3.1 surface for the Lender service. Routes that move
    money are at-most-once per X-Idempotency: when one answers 5xx, the
    X-Idempotency-Fenced response header says whether that key is now refusing
    resends (true) or free to retry (false or absent).
  license:
    name: Lerian Studio General License
  title: Lender API
  version: 1.0.0
servers:
  - url: https://lender.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - description: >-
      Caller session projection: validated subject and effective permissions for
      the presented token.
    name: Session
  - description: >-
      Ledger accounting operations: journal entries and accrual postings for
      loan accounts. Operations under /api/v1/internal are back-office
      operations for the client's operators: they require a person's login, and
      a service credential gets 403.
    name: Accounting
  - description: >-
      Loan application intake and lifecycle: submission, decisioning, and
      status.
    name: LoanApplications
  - description: >-
      Loan product catalog: definition, versioning, and activation of lending
      products.
    name: LoanProducts
  - description: >-
      Loan account servicing operations: balances, schedules, and account-level
      actions.
    name: Loan Accounts
  - description: >-
      Portfolio dashboard read operations: aggregated portfolio and performance
      views.
    name: Dashboard
  - description: >-
      Jurisdiction registry: supported jurisdiction profiles and their
      capabilities.
    name: Jurisdictions
  - description: >-
      Jurisdiction-specific loan application operations (Brazil origination
      surface).
    name: Loan Applications
  - description: >-
      Tax computation operations for jurisdiction-specific lending (e.g. Brazil
      IOF).
    name: Tax
  - description: >-
      Brazil consignado privado operations: contract lifecycle, exclusion
      repair, and compensating adjustments. Operations under /api/v1/internal
      are back-office operations for the client's operators: they require a
      person's login, and a service credential gets 403.
    name: Consignado
  - description: >-
      Inbound record quarantine. Operations under /api/v1/internal are
      back-office operations for the client's operators: they require a person's
      login, and a service credential gets 403.
    name: Streaming
  - description: >-
      Credit-instrument document template registry: versioned drafting and
      publication of CCB clausulado.
    name: DocumentTemplates
paths:
  /api/v1/br/partner/loan-products/{loanProductId}/tax/preview:
    post:
      tags:
        - Tax
      summary: Preview jurisdiction tax amounts (partner)
      description: >-
        Answers as POST /api/v1/br/tax/preview to a partner credential bound to
        the loan product. A loanProductVersionId that is not a version of that
        product is answered 404, as an unknown product is.
      operationId: previewPartnerTax
      parameters:
        - description: >-
            Loan product the quote is for. A loanProductVersionId in the body
            must be one of its versions.
          in: path
          name: loanProductId
          required: true
          schema:
            description: >-
              Loan product the quote is for. A loanProductVersionId in the body
              must be one of its versions.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxPreviewHumaBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxPreviewEnvelopeResponse'
          description: OK
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Not Found
        '413':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Request Entity Too Large
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Service Unavailable
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Gateway Timeout
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Any other status this operation may carry, rendered as a problem
            document — including a refusal produced ahead of the service, such
            as a gateway or ingress answering on its behalf.
components:
  schemas:
    TaxPreviewHumaBody:
      additionalProperties: false
      properties:
        borrowerKind:
          description: >-
            Kind of taxpayer the credit is granted to. Brazil sets a different
            daily IOF aliquota per kind (Decreto 6.306/2007, art. 7, I, "b"), so
            the preview quotes the rate priced for the kind named here. The
            deployment ships pricing pessoaFisica, which is also what an omitted
            value previews; every kind is priced with PUT
            /api/v1/br/tax/iof-rates/{borrowerKind}, and the rate table's keys
            are not a closed list. Simples Nacional, MEI included, is a regime
            and not a kind: send taxRegime brazilSimplesNacional with
            pessoaJuridica. A kind, or a declared Simples Nacional, the
            deployment does not price is refused 422 LENDER-0900 rather than
            previewed at another kind's rate.
          examples:
            - pessoaFisica
          type: string
        disbursementDate:
          description: Disbursement date (RFC3339).
          examples:
            - '2026-06-14T12:00:00Z'
          format: date-time
          type: string
        finalDueDate:
          description: Final due date (RFC3339).
          examples:
            - '2026-06-14T12:00:00Z'
          format: date-time
          type: string
        firstDueDate:
          description: >-
            Day the first instalment falls due (RFC3339 or YYYY-MM-DD). Omit it
            and the first instalment falls one month after the disbursement
            date, clamped to the month's last day; a quote naming
            loanProductVersionId instead hangs every instalment on the schedule
            generator's first date for that day, rolled to a business day. To
            quote an application's release, send the application's firstDueDate.
            Supply it and it becomes the ladder's anchor: the first period runs
            from the disbursement date to this day, longer or shorter than a
            month. Its interest is its whole months plus its extra days over 30
            at the monthly rate; the IOF quoted here counts its real days, so it
            moves with it. Ignored without requestedInstallments and
            requestedInterestRate, because there is no ladder to anchor.
          examples:
            - '2026-03-10'
          type: string
        grossAmount:
          description: >-
            Gross disbursement amount in major currency units (e.g.
            "100000.00").
          examples:
            - '100000.00'
          type: string
        installmentAmount:
          description: >-
            Instalment the payroll deducts, in major currency units (e.g.
            "112.19"), as a consignado contract declares it. Supply it together
            with firstDueDate, requestedInstallments and requestedInterestRate
            and the quote strikes the ladder booking strikes for a payroll
            contract: every instalment but the last is exactly this amount, the
            first period's interest beyond what the instalment covers is
            carried, and the last instalment closes the balance. The IOF quoted
            is then the IOF booking withholds. Omit it and the ladder is the
            generator's own level instalment. Ignored without all three, because
            there is no payroll ladder to strike. Refused 422 when it is not a
            positive amount, when after the first period it does not cover a
            month's interest, or when it repays the loan before the last
            instalment: the same refusals booking gives.
          examples:
            - '112.19'
          type: string
        jurisdictionCode:
          description: >-
            Jurisdiction the quote is for. This route quotes Brazilian taxes
            only: "BR", in either letter case. Any other two-letter code is
            refused 422 LENDER-0925.
          examples:
            - BR
          maxLength: 2
          minLength: 2
          type: string
        loanProductVersionId:
          description: >-
            Loan product version this quote is for. Supply it and the quote
            prices the tax regime this version declares, the one the
            disbursement withholds under, unless taxRegime names another regime
            the version admits; a version whose tax profile cannot be resolved
            is refused 422 LENDER-0207, as the disbursement refuses it. Omit it
            and taxRegime is required, and the quote prices whatever the
            arithmetic allows, which is what a quote made before a product is
            picked needs. The version also bounds the first due date: supply it
            together with firstDueDate, requestedInstallments and
            requestedInterestRate and the quote answers the same refusal booking
            will, rather than quoting a tax on a ladder the door will not take.
            The window is read only on a quote that strikes a ladder: without
            both ladder inputs there is no first due date to bound, so no window
            refusal can come back.
          examples:
            - 018f4e4e-7a3f-7c2e-9a1b-2c3d4e5f6071
          format: uuid
          type: string
        netDeliveredAmount:
          description: Optional net delivered amount in major currency units.
          examples:
            - '99949.66'
          type: string
        requestedInstallments:
          description: >-
            Number of monthly instalments the contract amortises over. Supply it
            together with requestedInterestRate and the quote is computed on the
            instalment ladder the schedule generator strikes, which is the
            ladder the disbursement door withholds against. Omit either and the
            quote values the operation as a single window from the disbursement
            date to the final due date, which is what a bullet operation is.
          examples:
            - 12
          format: int64
          maximum: 600
          minimum: 0
          type: integer
        requestedInterestRate:
          description: >-
            Monthly interest rate as a decimal FRACTION, not a percentage:
            "0.02" is 2% a month. Required together with requestedInstallments
            to quote on the instalment ladder.
          examples:
            - '0.02'
          type: string
        taxRegime:
          description: >-
            Tax regime selector understood by the jurisdiction tax engine.
            Required when loanProductVersionId is omitted, and then quoted as
            declared. With loanProductVersionId, a regime the version admits
            (GET /api/v1/br/loan-product-versions/{id}/tax-regimes) is quoted as
            declared, as the release of an application declaring it is; any
            other is ignored and the version's own regime is quoted. A
            brazilSimplesNacional regime in force, sent or the version's own,
            with pessoaJuridica quotes Decreto 6.306/2007, art. 7, VI while
            grossAmount is R$ 30.000,00 or less, and the pessoaJuridica rate
            above it. The release compares the operation's contracted principal,
            so a tranche is quoted here on its own amount.
          type: string
      required:
        - grossAmount
        - disbursementDate
        - finalDueDate
        - jurisdictionCode
      type: object
    TaxPreviewEnvelopeResponse:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/TaxPreviewResponse'
          description: >-
            The computed tax-preview result (IOF, PIS, COFINS, and net delivered
            amount) for the requested disbursement.
      required:
        - data
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          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
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    TaxPreviewResponse:
      additionalProperties: false
      properties:
        cofins:
          description: >-
            COFINS contribution amount, decimal string in major currency units
            (scale 2).
          examples:
            - '0.00'
          type: string
        grossAmount:
          description: >-
            Gross disbursement amount before tax, decimal string in major
            currency units (scale 2).
          examples:
            - '100000.00'
          type: string
        iofAdditional:
          description: >-
            Additional fixed-rate IOF component, decimal string in major
            currency units (scale 2).
          examples:
            - '38.00'
          type: string
        iofDaily:
          description: >-
            Daily IOF component, decimal string in major currency units (scale
            2).
          examples:
            - '12.34'
          type: string
        jurisdictionCode:
          description: ISO 3166-1 alpha-2 jurisdiction code (e.g. "BR").
          examples:
            - BR
          type: string
        netDeliveredAmount:
          description: >-
            Net amount delivered to the borrower after tax and origination fee
            deduction, decimal string in major currency units (scale 2).
          examples:
            - '99949.66'
          type: string
        originationFeeAmount:
          description: >-
            Origination fee the named product version retains from this release,
            scale 2; 0.00 when no version is named or the version declares none.
          examples:
            - '0.00'
          type: string
        pis:
          description: >-
            PIS contribution amount, decimal string in major currency units
            (scale 2).
          examples:
            - '0.00'
          type: string
        profileVersion:
          description: >-
            Compiled jurisdiction profile version used to compute the preview
            (e.g. "1.0.0").
          examples:
            - 1.0.0
          type: string
        rateTableSnapshotId:
          description: >-
            Identifier of the rate-table snapshot whose rates produced these
            amounts.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        taxRegime:
          description: Tax regime selector applied by the jurisdiction tax engine.
          type: string
        totalIof:
          description: >-
            Sum of daily and additional IOF, decimal string in major currency
            units (scale 2).
          examples:
            - '50.34'
          type: string
        totalTax:
          description: >-
            Total tax (IOF + PIS + COFINS), decimal string in major currency
            units (scale 2).
          examples:
            - '50.34'
          type: string
      required:
        - iofDaily
        - iofAdditional
        - totalIof
        - pis
        - cofins
        - totalTax
        - grossAmount
        - originationFeeAmount
        - netDeliveredAmount
        - taxRegime
        - jurisdictionCode
        - profileVersion
        - rateTableSnapshotId
      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
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

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