> For the complete documentation index, see [llms.txt](https://developers.bead.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.bead.xyz/settlement/testing-settlement-in-the-test-environment.md).

# Testing Settlement in the Test Environment

The Bead test environment includes settlement flow simulators for BTC, Lightning, PayPal, Venmo, and Klarna payments. These simulators advance the settlement lifecycle automatically so you can observe and validate the full status progression without waiting for production-equivalent timing.

**How settlement progresses in the test environment**

Settlement for all payment types follows the same lifecycle: payments are grouped into batches, batches roll into settlements, and settlements are funded via ACH. In the test environment, a nightly simulator advances each stage automatically.

The status progression you will observe is:

1. Payments complete and are grouped into an open batch (`batch.status = open`).
2. Batch closes overnight (`batch.status = closed`). A settlement record is created with `status = cleared`.
3. The simulator runs. A simulated ACH event advances the settlement.
4. Settlement status moves to `dispatched`, then `paid`. A deposit record is created and moves to `paid`.

**Simulator schedule**

The simulators run automatically on a nightly schedule. Plan your test flows accordingly:

1. Process test payments.
2. Confirm the batch has closed (`batch.status = closed`) — this happens at the nightly batch close.
3. Check settlement status the following morning — the simulator will have advanced the settlement to `dispatched` or `paid`.

**What to observe when testing**

* Use `GET /Batches` filtered by `Type` (`crypto` for BTC and Lightning, `walletApps` for PayPal, Venmo, and Klarna) to confirm batch status has moved to `closed`.
* Use `GET /Settlements` filtered by `MerchantIds` and `Type` to retrieve the settlement record once the batch has closed.
* Use `GET /Settlements/{id}` to review `status`, `grossFundableAmount`, `totalTransactionFees`, `depositFees`, and `netFundableAmount`.
* Use `GET /Settlements/{id}/deposits` to confirm the deposit record `status` once settlement completes.

Expected end state after a full nightly cycle: batch `status = closed`, settlement `status = paid`, deposit `status = paid`.

**Differences from production**

| Behavior           | Production                                    | Test environment                    |
| ------------------ | --------------------------------------------- | ----------------------------------- |
| Batch close        | Nightly (midnight ET)                         | Nightly (midnight ET)               |
| Settlement funding | Real ACH event                                | Simulated ACH event                 |
| Timing to `paid`   | Vendor-dependent (hours to next business day) | Advances overnight on test schedule |

**Next steps**

* Use [Settlements](/settlement/settlements.md) to review settlement records and fee breakdowns.
* Use [Batches](/settlement/batches.md) to track batch status and payment grouping.
* Use [Deposits](/settlement/deposits.md) to confirm funded movement once settlement completes.
* Use [Payment Settlements](broken://spaces/jL0BeBYhFGcs8tIiuCcV/pages/0I8XtK4ztAK8gab9XUjz) for payment-level settlement detail.
* Use [Merchant Settlements](broken://spaces/jL0BeBYhFGcs8tIiuCcV/pages/zKSBYYX80HC72lJTvqVi) for the merchant-level settlement event view.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.bead.xyz/settlement/testing-settlement-in-the-test-environment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
