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

# Transaction lifecycle

> Statuses of a transaction, permitted transitions and associated events.

Every charge created gives rise to a transaction. The `status` field reports the current status of the transaction, which changes as a result of acts of the payer, the acquirer, the banking system or the integrator itself. Relevant transitions are communicated by [notification](https://docs.fincle.com.br/guides/webhooks.md).

## Statuses

| Status | Description |
| - | - |
| `pending` | Charge created, awaiting payment. Initial status of every transaction. |
| `waiting` | Transaction awaiting an external act or event. |
| `paid` | Payment confirmed. |
| `refused` | Payment declined. For cards, the `refuseReason` field states the reason. |
| `expired` | Charge past due without payment. |
| `canceled` | Transaction canceled. |
| `error` | Failure in processing the payment. |
| `refund` | Amount returned to the payer. |
| `infraction` | Paid Pix transaction under analysis of an infraction report. |
| `contest` | Payment under dispute. |
| `chargeback` | Payment reversed as a result of an upheld dispute. |

## Transitions

```mermaid theme={null}
stateDiagram-v2
    [*] --> pending
    pending --> paid: payment confirmed
    pending --> refused: payment declined
    pending --> expired: due date passed
    pending --> canceled: cancellation
    paid --> refund: refund
    paid --> infraction: infraction report
    infraction --> paid: infraction rejected or cancelled
    infraction --> refund: infraction upheld
    paid --> contest: dispute
    contest --> chargeback: dispute upheld
```

## Creation and confirmation

The transaction is created in the `pending` status. For Pix and boleto, it remains in that status until the payment is settled, when it moves to `paid`, or until the due date. For credit card, the response to the creation already contains the outcome of the authorization, `paid` or `refused`, with the `pending` status possible while the acquirer completes processing.

Once the payment is confirmed, the net amount is credited to the account balance according to the settlement period applicable to the payment method, as described in [Balance and transfers](https://docs.fincle.com.br/guides/balance-and-transfers.md).

## Events after payment

The `paid` status is not final. Three kinds of event may change it.

A [refund](https://docs.fincle.com.br/guides/refunds.md), at the integrator's initiative or at the payer's request, moves the transaction to the `refund` status.

An [infraction report](https://docs.fincle.com.br/guides/infractions-and-med.md) on a Pix transaction moves the transaction to the `infraction` status and results in the precautionary block of the amount. Once the analysis is concluded, the transaction returns to `paid`, if the infraction is rejected or cancelled, or moves to `refund`, if it is upheld.

A dispute over a payment moves the transaction to the `contest` status and, if upheld, to the `chargeback` status.

## Associated events

| Transition | Event notified |
| - | - |
| Creation of the transaction | `transaction_created` |
| Confirmation of payment | `transaction_paid` |
| Declined card payment | `card_declined` |
| Refund request by the payer | `refund_requested` |
| Return of the amount | `transaction_refunded` |
| Opening or update of an infraction | `infraction` |
| Other status changes | `transaction_updated` |

## Monitoring

It is recommended that the integration consider the payment confirmed only upon receipt of the `transaction_paid` event. The `GET /transactions/{transactionId}` operation returns the current status of a transaction, and the `GET /transactions` operation lists the transactions of the account, filtered by status, payment method and period, which enables periodic reconciliation.


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