> For the complete documentation index, see [llms.txt](https://docs.fonbnk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fonbnk.com/server-to-server/integration-guide/flow-examples.md).

# Flow examples

Every order has a **deposit** leg (what comes in) and a **payout** leg (what goes out). The pair you pick decides the flow. Each walkthrough below runs the same core calls — currencies, limits, KYC, quote, order, confirm — with the values for that pair filled in.

| Flow                                                                                                          | Deposit leg        | Payout leg         | Use it when                                                                            |
| ------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------ | -------------------------------------------------------------------------------------- |
| [Fiat to Crypto](/server-to-server/integration-guide/flow-examples/fiat-to-crypto.md)                         | `fiat`             | `crypto`           | A user pays local currency and receives crypto in their own wallet.                    |
| [Crypto to Fiat](/server-to-server/integration-guide/flow-examples/crypto-to-fiat.md)                         | `crypto`           | `fiat`             | A user sends crypto and receives local currency in their bank or mobile money account. |
| [Fiat to Merchant balance](/server-to-server/integration-guide/flow-examples/fiat-to-merchant-balance.md)     | `fiat`             | `merchant_balance` | A user pays local currency and **you** are credited in USD. Collections.               |
| [Merchant balance to Fiat](/server-to-server/integration-guide/flow-examples/merchant-balance-to-fiat.md)     | `merchant_balance` | `fiat`             | You spend your USD balance to pay a user in local currency. Payouts and disbursements. |
| [Crypto to Merchant balance](/server-to-server/integration-guide/flow-examples/crypto-to-merchant-balance.md) | `crypto`           | `merchant_balance` | A user sends crypto and you are credited in USD.                                       |

There is a sixth legal pair, **merchant balance to crypto** — spending your USD balance to send a user crypto. It works the same way as the others and has no walkthrough of its own yet; follow [Merchant balance to Fiat](/server-to-server/integration-guide/flow-examples/merchant-balance-to-fiat.md) and swap the payout leg for a crypto one.

Which pairs are legal is not guesswork: every entry from [Get available currencies](/server-to-server/api-endpoints/get-available-currencies.md) carries a `pairs` array listing the currency types it can be matched with.

{% hint style="info" %}
Topping up or withdrawing **your own** balance with crypto is a different mechanism, not one of these order shapes — it runs on its own endpoints under [Merchant balance](/server-to-server/api-endpoints/merchant-balance.md). The difference is which flow the order belongs to: these six are the regular order flow, those are a separate merchant-balance-crypto flow with their own limits and their own approval step.
{% endhint %}

Before you follow one of these, read [Integration guide](/server-to-server/integration-guide.md) for the call sequence and [Transfer types explanation](/server-to-server/integration-guide/transfer-types-explanation.md) for what the user has to do once the order exists.


---

# 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://docs.fonbnk.com/server-to-server/integration-guide/flow-examples.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.
