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

# Resolve payment routing

> Resolves the routing path for a payment based on the sender's ISPB and amount.



## OpenAPI

````yaml /pt/openapi/v3-current/spi-core.yaml post /api/v1/core/routing/resolve
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Core service of Lerian SPI: PIX participant lifecycle by ISPB, payment
    routing resolution, and cross-context Core operation orchestration over the
    Brazilian Instant Payment System (SPI/Pix).
  license:
    name: Lerian Studio General License
  title: Lerian SPI — Core API
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security: []
tags:
  - description: >-
      PIX participant lifecycle: register, list, retrieve, suspend, activate,
      and offboard by ISPB.
    name: Participants
  - description: Payment routing resolution across participants.
    name: Routing
  - description: Core operation orchestration across the rail's bounded contexts.
    name: Operations
paths:
  /api/v1/core/routing/resolve:
    post:
      tags:
        - Routing
      summary: Resolve payment routing
      description: >-
        Resolves the routing path for a payment based on the sender's ISPB and
        amount.
      operationId: resolveRouting
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResolveRoutingRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingDecisionResponse'
          description: OK
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Not Found
        '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
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    ResolveRoutingRequest:
      additionalProperties: false
      properties:
        amount:
          description: >-
            Transaction amount in centavos (BRL minor units) to validate against
            quota; must be greater than zero.
          examples:
            - 15000
          format: int64
          minimum: 1
          type: integer
        senderISPB:
          description: >-
            ISPB of the sending participant whose routing is being resolved,
            exactly 8 digits or uppercase letters.
          examples:
            - '12345678'
          pattern: ^[0-9A-Z]{8}$
          type: string
      required:
        - senderISPB
        - amount
      type: object
    RoutingDecisionResponse:
      additionalProperties: false
      properties:
        indirectISPB:
          description: >-
            ISPB of the indirect participant being routed through the sponsor (8
            digits or uppercase letters); empty for direct participants.
          examples:
            - '12345678'
          type: string
        isDirect:
          description: >-
            True when the sender connects directly to BACEN; false when routed
            through a sponsor.
          examples:
            - false
          type: boolean
        quotaValidatedAmount:
          description: >-
            Amount in centavos (BRL minor units) validated against the indirect
            participant's quota.
          examples:
            - 15000
          format: int64
          type: integer
        sponsorISPB:
          description: >-
            ISPB of the sponsor participant routing the payment (8 digits or
            uppercase letters); empty for direct participants.
          examples:
            - '87654321'
          type: string
      required:
        - quotaValidatedAmount
        - isDirect
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        correlationId:
          description: Request-scoped correlation identifier echoing X-Request-ID.
          examples:
            - req-7a3f9c2e
          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.
      required:
        - correlationId
      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.