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

# Process an inbound upstream cash-in

> Processes an inbound upstream cash-in: resolves the credit account by the receiver document, applies the Bacen (ISPB 99999) special-case handling, dedups on the end-to-end id, and credits the customer exactly-once (Midaz idempotency keyed on the end-to-end id). An unresolved account or a Bacen payer returns a success-shaped account-not-found acknowledgement with no credit.



## OpenAPI

````yaml en/openapi/v3-current/pix.yaml POST /v1/webhooks/cash-ins
openapi: 3.0.3
info:
  title: Plugin BR Pix Direct - Complete API
  description: |
    Complete API for Brazilian Pix instant payment system including
    Pix key dictionary operations, QR code generation/decoding, transactions and
    transaction limits.
  version: 1.0.0
servers:
  - url: https://plugin-pix-direct.api.lerian.net
  - url: https://plugin-pix-direct-qrcode.api.lerian.net
security:
  - bearerAuth: []
paths:
  /v1/webhooks/cash-ins:
    post:
      tags:
        - Webhooks API
      summary: Process an inbound upstream cash-in
      description: >-
        Processes an inbound upstream cash-in: resolves the credit account by
        the receiver document, applies the Bacen (ISPB 99999) special-case
        handling, dedups on the end-to-end id, and credits the customer
        exactly-once (Midaz idempotency keyed on the end-to-end id). An
        unresolved account or a Bacen payer returns a success-shaped
        account-not-found acknowledgement with no credit.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CashInBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CashInResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    CashInBody:
      additionalProperties: false
      properties:
        bankIdPss:
          description: Saque/troco PSS participant ISPB (a v5.5.0 string).
          type: string
        chave:
          description: The Pix key (present for key-initiated cash-ins).
          type: string
        cnpjIniciadorPagamento:
          description: Payment initiator CNPJ (a v5.5.0 string).
          type: string
        dtContabil:
          description: Accounting date (optional).
          type: string
        dtHrLiquidacao:
          description: Settlement timestamp (optional).
          type: string
        dtHrOp:
          description: Operation timestamp (ISO-8601).
          type: string
        endToEndId:
          description: SPI end-to-end id (idempotency + dedup key).
          type: string
        finalidade:
          description: Finality (eFinality).
          format: int64
          type: integer
        idConciliacaoRecebedor:
          description: Recipient conciliation id (stamped on the row + the 24h marker).
          type: string
        idReqJdPi:
          description: Upstream request id (becomes the local row id when a UUID).
          type: string
        infEntreClientes:
          description: Free-text inter-client info.
          type: string
        modalidadeAgente:
          description: Agent modality (eModalityAgent).
          format: int64
          type: integer
        pagador:
          $ref: '#/components/schemas/PartyBlock'
        prioridadePagamento:
          description: Payment priority (ePaymentPriority).
          format: int64
          type: integer
        recebedor:
          $ref: '#/components/schemas/PartyBlock'
        tpIniciacao:
          description: >-
            Initiation type (eStartupType: Chave -> in route, QR -> inQrCode
            route).
          format: int64
          type: integer
        tpPrioridadePagamento:
          description: Payment priority type.
          format: int64
          type: integer
        valor:
          description: Amount in reais (a JSON number).
          format: double
          type: number
        vlrDetalhe:
          description: Optional value-detail entries.
          items:
            $ref: '#/components/schemas/ValueDetailBlock'
          type: array
          nullable: true
      required:
        - idReqJdPi
        - endToEndId
        - tpIniciacao
        - pagador
        - recebedor
        - dtHrOp
        - valor
      type: object
    CashInResponse:
      additionalProperties: false
      properties:
        dtHrCreditoSgct:
          description: >-
            settlement-gateway credit timestamp (ISO-8601), on a credited
            result.
          type: string
        dtHrReqJdPi:
          description: Request timestamp (ISO-8601).
          type: string
        endToEndIdDevolucao:
          description: Echoed return end-to-end id.
          type: string
        endToEndIdOriginal:
          description: Echoed original end-to-end id.
          type: string
        idCreditoSgct:
          description: >-
            settlement-gateway credit lançamento id (GUID), on a credited
            result.
          type: string
        idReqJdPi:
          description: Echoed upstream request id.
          type: string
        idReqSistemaCliente:
          description: Echoed client-system request id.
          type: string
      type: object
    Detail:
      additionalProperties: false
      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.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          nullable: true
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          format: uri
          type: string
        status:
          description: HTTP status code
          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.
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          format: uri
          type: string
      type: object
    PartyBlock:
      additionalProperties: false
      properties:
        cpfCnpj:
          description: Holder document CPF/CNPJ (a v5.5.0 string).
          type: string
        ispb:
          description: Participant ISPB (a v5.5.0 string).
          type: string
        nome:
          description: Holder name.
          type: string
        nrAgencia:
          description: Agency/branch number (the participant branch source).
          type: string
        nrConta:
          description: Account number (NEVER used as the branch).
          type: string
        tpConta:
          description: 'Account type (eAccountType: 0=checking).'
          format: int64
          type: integer
        tpPessoa:
          description: 'Person type (ePersonType: 0=natural, 1=legal).'
          format: int64
          type: integer
      required:
        - ispb
        - tpPessoa
        - cpfCnpj
        - nrAgencia
        - tpConta
        - nrConta
        - nome
      type: object
    ValueDetailBlock:
      additionalProperties: false
      properties:
        tipo:
          description: Value-detail type.
          format: int64
          type: integer
        vlrTarifaDinheiroCompra:
          description: Cash-purchase fee amount (reais).
          format: double
          type: number
      required:
        - vlrTarifaDinheiroCompra
        - tipo
      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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        JWT Bearer token authentication. Obtain token from
        `/v1/login/oauth/access_token` endpoint

        using client credentials (clientId and clientSecret).


        Include token in Authorization header:

        `Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`


        Token expires after 3600 seconds (1 hour).

````