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

# Atomic Clearing & Escrows

> How fiat clearing and on-chain settlement happen as a single event.

## Atomic clearing

Every payment and debit pull settles through the same mechanism: the moment fiat clears into OpenFi's settlement account, it triggers stablecoin minting/routing on-chain in the same atomic operation. There's no pre-funded liquidity pool on either side and no window where funds exist in two places at once.

This is why `POST /v1/payments` and `POST /v1/debit-pulls` both return a `settlement` object (`chain`, `tx_hash`) rather than exposing atomic clearing as a separate endpoint you call. It's a property of how every settlement executes, not a distinct action.

```json theme={null}
"settlement": {
  "chain": "stellar",
  "tx_hash": "71ffa..."
}
```

`chain` is `stellar` or `solana`. OpenFi routes automatically. You never choose it.

## Programmatic escrow (V2)

> [!NOTE]
>
> Programmatic escrow arrives in V2.

Once available, escrow will let cleared funds be locked against programmatic conditions (a milestone attestation, a delivery confirmation, a payroll deadline) before release to the destination, with automatic rollback if conditions aren't met in time. See the [Agentic Commerce use case](https://docs.openfi.co/use-cases.md#1-agentic-commerce-and-autonomous-supply-chains) for the intended flow.


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