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

# Decide a Pix held in fraud analysis or blocked on receipt

> The final decision on a sent Pix held in analysis (status FRAUD_ANALYSIS). The antifraud partner calls it with its application token; a person of the client with the editor or operator role calls it too, with a justification of 10 to 500 characters in the body. ALLOW releases the Pix to BTG; DENY reverses the debit and rejects it with FRAUD_DENIED. The first decision wins: the same decision again returns the current transfer and moves no money, and a different one, a decision after the deadline (fraudCheck.decideBy) or one with another analysisId is refused with 409 PIX-0472. A repeated DENY finishes a closing that failed with 502 PIX-0475. A decision that arrives before the transfer's analysis is recorded is refused with 503 PIX-0474 and a Retry-After header. An unknown key is 404. With the pix-cashin: prefix it decides the cautelar block of a received Pix instead: ALLOW frees the held money in the same call (or within a minute if Midaz fails), DENY is recorded and announced while the money stays held, and a person's ALLOW after the partner's DENY releases it with a justification, keeping the DENY (fraudCheck.releasedAt). A block that ended or reached its expiry, another decision recorded or an ALLOW on a block that could not be placed is 409 PIX-0472; a key of a received Pix without a block is 404 PIX-0425; a decision before the block is recorded is 503 PIX-0474. The body is the partner contract: decision (ALLOW or DENY) and analysisId are strict, a malformed reasons list is dropped and the decision still applies; anything else wrong is 422 PIX-0473. The X-Idempotency header is accepted and ignored.



## OpenAPI

````yaml /es/openapi/v3-current/indirect-pix.yaml post /v1/transfers/{evaluation_key}/resolve
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    API for Pix Indirect via BTG. It covers DICT keys and claims; MED infraction
    reports, fraud markers, refund requests, and funds recoveries; DICT
    statistics and reconciliation; Pix transfers, refunds, and schedules; static
    QR codes and QR code decoding; immediate and due-date collections; Pix
    Automático for the payer; transaction reports and TemposTransacoes
    statistics; and inbound and outbound webhook records.
  license:
    name: Lerian Studio General License
  title: Pix BTG API
  version: 2.0.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
paths:
  /v1/transfers/{evaluation_key}/resolve:
    post:
      tags:
        - Transfers
      summary: Decide a Pix held in fraud analysis or blocked on receipt
      description: >-
        The final decision on a sent Pix held in analysis (status
        FRAUD_ANALYSIS). The antifraud partner calls it with its application
        token; a person of the client with the editor or operator role calls it
        too, with a justification of 10 to 500 characters in the body. ALLOW
        releases the Pix to BTG; DENY reverses the debit and rejects it with
        FRAUD_DENIED. The first decision wins: the same decision again returns
        the current transfer and moves no money, and a different one, a decision
        after the deadline (fraudCheck.decideBy) or one with another analysisId
        is refused with 409 PIX-0472. A repeated DENY finishes a closing that
        failed with 502 PIX-0475. A decision that arrives before the transfer's
        analysis is recorded is refused with 503 PIX-0474 and a Retry-After
        header. An unknown key is 404. With the pix-cashin: prefix it decides
        the cautelar block of a received Pix instead: ALLOW frees the held money
        in the same call (or within a minute if Midaz fails), DENY is recorded
        and announced while the money stays held, and a person's ALLOW after the
        partner's DENY releases it with a justification, keeping the DENY
        (fraudCheck.releasedAt). A block that ended or reached its expiry,
        another decision recorded or an ALLOW on a block that could not be
        placed is 409 PIX-0472; a key of a received Pix without a block is 404
        PIX-0425; a decision before the block is recorded is 503 PIX-0474. The
        body is the partner contract: decision (ALLOW or DENY) and analysisId
        are strict, a malformed reasons list is dropped and the decision still
        applies; anything else wrong is 422 PIX-0473. The X-Idempotency header
        is accepted and ignored.
      operationId: payment-resolve-fraud-analysis
      parameters:
        - description: >-
            The key the partner evaluated: pix-out: followed by the end-to-end
            id of the held Pix
          in: path
          name: evaluation_key
          required: true
          schema:
            description: >-
              The key the partner evaluated: pix-out: followed by the end-to-end
              id of the held Pix
            type: string
        - description: >-
            Accepted and ignored: repeating the same decision returns the
            current state without moving money
          in: header
          name: X-Idempotency
          schema:
            description: >-
              Accepted and ignored: repeating the same decision returns the
              current state without moving money
            type: string
      requestBody:
        content:
          application/octet-stream:
            schema:
              contentMediaType: application/octet-stream
              format: binary
              type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Bad Request
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Internal Server Error
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorBody'
          description: Error
components:
  schemas:
    TransferResponse:
      additionalProperties: false
      properties:
        accountId:
          examples:
            - 01989f9e-6508-79f8-9540-835be49fbd0d
          type: string
        aliasId:
          examples:
            - 01989f9e-6508-79f8-9540-835be49fbd0e
          type: string
        amount:
          examples:
            - '100.50'
          type: string
        createdAt:
          examples:
            - '2024-01-15T10:30:15Z'
          type: string
        deletedAt:
          type: string
        description:
          examples:
            - Pix Cashin Transfer
          type: string
        destination:
          $ref: '#/components/schemas/SourceDestination'
        endToEndId:
          examples:
            - E1234567820240101000001234567890
          type: string
        feeCharge:
          $ref: '#/components/schemas/FeeChargeResponse'
        fraudCheck:
          $ref: '#/components/schemas/FraudCheck'
        id:
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
          type: string
        initiatedAt:
          examples:
            - '2024-01-15T10:30:00Z'
          type: string
        initiationType:
          enum:
            - MANUAL
            - KEY
            - QR_CODE
          examples:
            - KEY
          type: string
        ledger:
          $ref: '#/components/schemas/LedgerInfo'
        metadata:
          additionalProperties: {}
          type: object
        paymentType:
          enum:
            - IMMEDIATE
            - SCHEDULED
          examples:
            - IMMEDIATE
          type: string
        purpose:
          enum:
            - TRANSFER
            - INSTANT_PAYMENT_REFUND
            - CHANGE
            - WITHDRAWAL
          examples:
            - TRANSFER
          type: string
        source:
          $ref: '#/components/schemas/SourceDestination'
        status:
          enum:
            - CREATED
            - PENDING
            - PROCESSING
            - COMPLETED
            - FAILED
            - REJECTED
            - REVERSED
            - FRAUD_ANALYSIS
            - CANCELLED
          examples:
            - COMPLETED
          type: string
        txId:
          description: >-
            Transaction ID (txId) declared by the QR Code this cash-in paid. For
            a dynamic QR Code it is the charge's own txId, proven against that
            charge before the cash-in was accepted. For a static BR Code it is
            whatever reference label the code declared, which may match no
            charge. initiationType answers QR_CODE for both, so treat this as a
            correlation hint rather than proof a charge was paid. Absent for a
            payment with no QR Code and for every cash-out.
          examples:
            - cob7f3a9c2e4b118d
          type: string
        type:
          enum:
            - CASHIN
            - CASHOUT
          examples:
            - CASHIN
          type: string
        updatedAt:
          examples:
            - '2024-01-15T10:35:00Z'
          type: string
        urgency:
          enum:
            - HIGH
            - NORMAL
          examples:
            - HIGH
          type: string
        withdrawal:
          $ref: '#/components/schemas/WithdrawalBreakdownResponse'
      required:
        - id
        - amount
        - endToEndId
        - status
        - type
        - paymentType
        - initiationType
        - urgency
        - purpose
        - accountId
        - createdAt
        - updatedAt
      type: object
    LegacyErrorBody:
      additionalProperties: false
      properties:
        code:
          type: string
        fields:
          additionalProperties:
            type: string
          type: object
        headers:
          additionalProperties:
            type: string
          type: object
        message:
          type: string
        paths:
          additionalProperties:
            type: string
          type: object
        queryParams:
          additionalProperties:
            type: string
          type: object
        raw:
          type: string
        title:
          type: string
      required:
        - code
        - title
        - message
      type: object
    SourceDestination:
      additionalProperties: false
      properties:
        account:
          $ref: '#/components/schemas/AccountDetails'
        key:
          examples:
            - chave@pix.com
          type: string
        owner:
          $ref: '#/components/schemas/OwnerDetails'
      type: object
    FeeChargeResponse:
      additionalProperties: false
      properties:
        applied:
          examples:
            - true
          type: boolean
        calculationType:
          examples:
            - segment
          type: string
        fees:
          items:
            $ref: '#/components/schemas/FeeEntryResponse'
          type: array
        netAmount:
          examples:
            - '97.50'
          type: string
        totalAmount:
          examples:
            - '2.50'
          type: string
      required:
        - applied
        - calculationType
        - totalAmount
        - netAmount
        - fees
      type: object
    FraudCheck:
      additionalProperties: false
      properties:
        analysisId:
          examples:
            - an-1
          type: string
        cause:
          examples:
            - TIMEOUT
          type: string
        decideBy:
          format: date-time
          type: string
        decision:
          enum:
            - ALLOW
            - REVIEW
            - DENY
          examples:
            - DENY
          type: string
        origin:
          enum:
            - PROVIDER
            - FALLBACK
          examples:
            - PROVIDER
          type: string
        reasons:
          items:
            $ref: '#/components/schemas/FraudCheckReason'
          type: array
        releasedAt:
          format: date-time
          type: string
        resolution:
          enum:
            - EXPIRED
            - ALLOW
            - DENY
            - CANCELLED
          examples:
            - EXPIRED
          type: string
        resolvedAt:
          format: date-time
          type: string
        resolvedBy:
          enum:
            - PARTNER
            - OPERATOR
            - PAYER
          examples:
            - OPERATOR
          type: string
        score:
          examples:
            - '0.7312'
          type: string
      required:
        - decision
        - origin
      type: object
    LedgerInfo:
      additionalProperties: false
      properties:
        destinationOperationId:
          examples:
            - 550e8400-e29b-41d4-a716-446655440013
          type: string
        revert:
          $ref: '#/components/schemas/LedgerRevertInfo'
        sourceOperationId:
          examples:
            - 550e8400-e29b-41d4-a716-446655440012
          type: string
        transactionId:
          examples:
            - 550e8400-e29b-41d4-a716-446655440011
          type: string
      type: object
    WithdrawalBreakdownResponse:
      additionalProperties: false
      properties:
        agentMode:
          enum:
            - AGTEC
            - AGTOT
            - AGPSS
          examples:
            - AGTEC
          type: string
        transactionAmount:
          examples:
            - '80.00'
          type: string
        withdrawalAmount:
          examples:
            - '50.00'
          type: string
        withdrawalServiceProvider:
          examples:
            - '12345678'
          type: string
      required:
        - withdrawalAmount
        - agentMode
        - withdrawalServiceProvider
      type: object
    AccountDetails:
      additionalProperties: false
      properties:
        branch:
          examples:
            - '0001'
          type: string
        number:
          examples:
            - '123456789'
          type: string
        participant:
          examples:
            - '12345678'
          type: string
        type:
          enum:
            - CACC
            - SVGS
            - TRAN
            - OTHR
          examples:
            - TRAN
          type: string
      required:
        - branch
        - number
        - participant
        - type
      type: object
    OwnerDetails:
      additionalProperties: false
      properties:
        document:
          examples:
            - 12ABC34501DE35
          type: string
        name:
          examples:
            - John Doe
          type: string
        tradeName:
          examples:
            - John's Business
          type: string
        type:
          enum:
            - NATURAL_PERSON
            - LEGAL_PERSON
          examples:
            - NATURAL_PERSON
          type: string
      required:
        - document
        - name
        - type
      type: object
    FeeEntryResponse:
      additionalProperties: false
      properties:
        amount:
          examples:
            - '1.50'
          type: string
        calculationType:
          examples:
            - PERCENTAGE
          type: string
        calculationValue:
          examples:
            - '1.5'
          type: string
        creditAccount:
          examples:
            - 01989f9e-6508-79f8-9540-835be49fbd0d
          type: string
        feeLabel:
          examples:
            - PIX_FEE
          type: string
      required:
        - feeLabel
        - amount
        - creditAccount
        - calculationType
        - calculationValue
      type: object
    FraudCheckReason:
      additionalProperties: false
      properties:
        code:
          examples:
            - R1
          type: string
        description:
          examples:
            - Payer flagged
          type: string
      required:
        - code
      type: object
    LedgerRevertInfo:
      additionalProperties: false
      properties:
        destinationOperationId:
          examples:
            - 550e8400-e29b-41d4-a716-446655440016
          type: string
        sourceOperationId:
          examples:
            - 550e8400-e29b-41d4-a716-446655440015
          type: string
        transactionId:
          examples:
            - 550e8400-e29b-41d4-a716-446655440014
          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.