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

# Document lifecycle

> Statuses and stages an in document goes through in the Trio API.

Every deposit that Trio processes becomes an in document, and each in document goes through a sequence of stages that records its lifecycle. This guide lists the statuses an in document can have, the stages it passes through and which statuses are final. For how a deposit is created in the first place, see the [Receivables overview](https://docs.trio.com.br/v2/guides/receivables/overview.md).

## Status and stages

An in document returned by [`GET /v2/documents/in/{id}`](https://docs.trio.com.br/v2/api-reference/banking-api/documents/receivables/get-receivable) carries its current `status` and a `stages` array. Each stage records the status the document reached, when it was recorded (`inserted_at`) and, when the stage represents an error, its `error_code` and `error_message`:

```json theme={null}
"status": "settled",
"stages": [
  {
    "id": "01a11802-3da7-2381-58a7-54b90a2ffa9a",
    "status": "created",
    "inserted_at": "2026-10-07T20:17:02.479108Z",
    "error_code": null,
    "error_message": null
  },
  {
    "id": "01a11802-3da7-af9b-756c-9522bbd3b87f",
    "status": "settled",
    "inserted_at": "2026-10-07T20:17:03.475249Z",
    "error_code": null,
    "error_message": null
  }
]
```

List in documents with [`GET /v2/documents/in`](https://docs.trio.com.br/v2/api-reference/banking-api/documents/receivables/list-receivables) or search them with [`POST /v2/documents/in/search`](https://docs.trio.com.br/v2/api-reference/banking-api/documents/receivables/search-receivables). Each status change also reaches you as a [webhook event](https://docs.trio.com.br/v2/webhooks/events/overview.md).

## Document statuses

| Status | Meaning | Final |
| - | - | - |
| `created` | The transaction was received and queued for processing. | No |
| `confirmed` | The settlement process has started. | No |
| `kyc` | Defined by the API; not yet described. | |
| `settled` | The transaction was successfully processed and settled. | Yes |
| `refunded` | Defined by the API; not yet described. | |
| `reversed` | Defined by the API; not yet described. | |
| `failed` | The transaction could not be processed due to invalid information or because the bank rejected it. | Yes |

## Stage statuses

The `status` of each entry in `stages` is one of the values below. `refund_link` appears only as a stage and never as the document `status`.

| Stage status | Also a document status |
| - | - |
| `created` | Yes |
| `confirmed` | Yes |
| `kyc` | Yes |
| `settled` | Yes |
| `failed` | Yes |
| `refund_link` | No |

## Transaction flow

```mermaid theme={null}
flowchart LR
    A[Created] --> B[Confirmed]
    B --> C[Settled]
    B --> D[Failed]
```

The final statuses are `settled` and `failed`. Once a document reaches a final status, its lifecycle is complete.

## Next steps

* [Cash in](https://docs.trio.com.br/v2/guides/receivables/cash-in.md): create the dynamic QR code that produces an in document.
* [QR code types](https://docs.trio.com.br/v2/guides/pix/qr-codes.md): the status of the QR code itself, before it is paid.
* [Simulate deposit failures](https://docs.trio.com.br/v2/guides/receivables/simulating-deposit-failures.md): reproduce rejected and refunded deposits in the sandbox.
* [Cash out](https://docs.trio.com.br/v2/guides/payments/cash-out.md): out documents have their own statuses.


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