# Crypto to Merchant balance

Let’s do a NGN (fiat) deposit to merchant balance USD payout.&#x20;

{% stepper %}
{% step %}

#### First, call [Get available currencies](https://docs.fonbnk.com/server-to-server/api-endpoints/get-available-currencies) and assume you receive:

{% code title="Example response" overflow="wrap" expandable="true" %}

```json
[
  {
    currencyType: 'crypto',
    currencyCode: 'POLYGON_USDT',
    paymentChannels: [
      {
        type: 'crypto',
        transferTypes: ['manual'],
        isDepositAllowed: true,
        isPayoutAllowed: true,
      },
    ],
    currencyDetails: {
      network: 'POLYGON',
      asset: 'USDT',
      contractAddress: '0x3b3a06b48119c035a2e86afdb69d9ad930643b3d',
    },
    pairs: ['fiat', 'merchant_balance'],
  },
  {
    currencyType: 'merchant_balance',
    currencyCode: 'USD',
    paymentChannels: [
      {
        type: 'merchant_balance',
        transferTypes: ['manual'],
        isDepositAllowed: true,
        isPayoutAllowed: true,
      },
    ],
    currencyDetails: {
      merchantName: 'Fonbnk',
    },
    pairs: ['fiat', 'crypto'],
  },
];
```

{% endcode %}

We see POLYGON\_USDT supports both deposits and payouts. Merchant balance supports both deposit and payout. So we can do Crypto → Merchant balance USD.
{% endstep %}

{% step %}

#### Call [Get order limits](https://docs.fonbnk.com/server-to-server/api-endpoints/get-order-limits) with:

* depositPaymentChannel: "<mark style="color:yellow;">crypto</mark>"
* depositCurrencyType: "<mark style="color:yellow;">crypto</mark>"
* depositCurrencyCode: "<mark style="color:yellow;">POLYGON\_USDT</mark>"
* payoutPaymentChannel: "<mark style="color:yellow;">merchant\_balance</mark>"
* payoutCurrencyType: "<mark style="color:yellow;">merchant\_balance</mark>"
* payoutCurrencyCode: "<mark style="color:yellow;">USD</mark>"

{% code title="Example response" %}

```json
{
    "deposit": {
        "min": 1,
        "max": 500,
        "minUsd": 1,
        "maxUsd": 500,
        "supportsDecimals": true,
        "step": 0.000001
    },
    "payout": {
        "min": 1,
        "max": 500,
        "minUsd": 1,
        "maxUsd": 500,
        "supportsDecimals": true,
        "step": 0.01
    }
}
```

{% endcode %}

We see that the minimum deposit is 1 POLYGON\_USDT and the maximum is 500 POLYGON\_USDT, which corresponds to 1-500 USD limit for merchant balance.

Assume the merchant wants to receive 100 USD. Check the user’s tier using the [KYC requirements](https://docs.fonbnk.com/server-to-server/kyc-flow) flow before proceeding. In the sample sandbox rules, payouts of 100 USD or more trigger the <mark style="color:yellow;">advanced</mark> tier, so be sure the user has submitted and been approved for that document set.
{% endstep %}

{% step %}

#### Call [Create quote](https://docs.fonbnk.com/server-to-server/api-endpoints/create-quote):

{% code title="Example request" %}

```json
{
  "deposit": {
    "paymentChannel": "crypto",
    "currencyType": "crypto",
    "currencyCode": "POLYGON_USDT"
  },
  "payout": {
    "paymentChannel": "merchant_balance",
    "currencyType": "merchant_balance",
    "currencyCode": "USD",
    "amount": 100
  }
}
```

{% endcode %}

{% code title="Example response" overflow="wrap" expandable="true" %}

```json
{
    "quoteId": "69c5443c5ea688026a418ca2",
    "quoteExpiresAt": "2026-03-26T15:05:40.842Z",
    "deposit": {
        "paymentChannel": "crypto",
        "currencyType": "crypto",
        "currencyCode": "POLYGON_USDT",
        "currencyDetails": {
            "network": "POLYGON",
            "asset": "USDT",
            "contractAddress": "0x3b3a06b48119c035a2e86afdb69d9ad930643b3d"
        },
        "cashout": {
            "amountBeforeFees": 100,
            "amountAfterFees": 100,
            "amountBeforeFeesUsd": 100,
            "amountAfterFeesUsd": 100,
            "chargedFees": [],
            "chargedFeesUsd": [],
            "totalChargedFees": 0,
            "totalChargedFeesUsd": 0,
            "exchangeRate": 1,
            "exchangeRateAfterFees": 1,
            "chargedFeesPerRecipient": {},
            "chargedFeesPerRecipientUsd": {},
            "feeSettings": []
        },
        "fieldsToCreateOrder": [
            {
                "key": "blockchainWalletAddress",
                "type": "string",
                "label": "Your wallet address",
                "required": false
            },
            {
                "key": "depositSandboxForcedFlow",
                "type": "enum",
                "label": "Sandbox deposit forced flow",
                "required": false,
                "defaultValue": "deposit_success",
                "options": [
                    {
                        "label": "Deposit success",
                        "value": "deposit_success"
                    },
                    {
                        "label": "Deposit invalid",
                        "value": "deposit_invalid"
                    }
                ]
            }
        ],
        "transferType": "manual"
    },
    "payout": {
        "paymentChannel": "merchant_balance",
        "currencyType": "merchant_balance",
        "currencyCode": "USD",
        "currencyDetails": {
            "merchantName": "bohdan test"
        },
        "cashout": {
            "amountBeforeFees": 100,
            "amountAfterFees": 100,
            "amountBeforeFeesUsd": 100,
            "amountAfterFeesUsd": 100,
            "chargedFees": [],
            "chargedFeesUsd": [],
            "totalChargedFees": 0,
            "totalChargedFeesUsd": 0,
            "exchangeRate": 1,
            "exchangeRateAfterFees": 1,
            "chargedFeesPerRecipient": {},
            "chargedFeesPerRecipientUsd": {},
            "feeSettings": []
        },
        "fieldsToCreateOrder": [
            {
                "key": "payoutSandboxForcedFlow",
                "type": "enum",
                "label": "Sandbox payout forced flow",
                "defaultValue": "payout_success",
                "required": false,
                "options": [
                    {
                        "label": "Payout success",
                        "value": "payout_success"
                    },
                    {
                        "label": "Payout failed -> Refund success",
                        "value": "refund_success"
                    },
                    {
                        "label": "Payout failed -> Refund failed",
                        "value": "refund_failed"
                    }
                ]
            }
        ]
    }
}
```

{% endcode %}

For a merchant to receive 100 USD, user must deposit 100 POLYGON\_USDT. Collect these fields:

* <mark style="color:yellow;">blockchainWalletAddress</mark>
* <mark style="color:yellow;">depositSandboxForcedFlow</mark> (sandbox optional field to simulate deposit success/failure/underpayment/overpayment)
* <mark style="color:yellow;">payoutSandboxForcedFlow</mark> (sandbox optional field to simulate payout success/failure)

> **Sandbox tip:** When you're testing in the sandbox environment you can set <mark style="color:yellow;">depositSandboxForcedFlow</mark> or <mark style="color:yellow;">payoutSandboxForcedFlow</mark> to force the platform to return success, failure, or other edge outcomes. This makes it easy to imitate failed flows without moving real funds.
> {% endstep %}

{% step %}

#### Create the order via [Create order:](https://docs.fonbnk.com/server-to-server/api-endpoints/create-order)

{% code title="Example request" overflow="wrap" expandable="true" %}

```json
{
    "quoteId": "69c5443c5ea688026a418ca2",
    "userCountryIsoCode": "NG",
    "userEmail": "tester+ng@fonbnk.com",
    "userIp": "223.134.123.12",
    "deposit": {
        "paymentChannel": "crypto",
        "currencyType": "crypto",
        "currencyCode": "POLYGON_USDT",
        "amount": 100
    },
    "payout": {
        "paymentChannel": "merchant_balance",
        "currencyType": "merchant_balance",
        "currencyCode": "USD"
    },
    "fieldsToCreateOrder": {
        "blockchainWalletAddress": "0x5b7ae3c6c87f4a3f94b35c77233b13191ebfad20"
    }
}
```

{% endcode %}

{% code title="Example response" overflow="wrap" expandable="true" %}

```json
{
    "quoteUsed": true,
    "order": {
        "_id": "69c545ea57cb634f272a57f2",
        "countryIsoCode": "NG",
        "userId": "69c54529ca181e1811eeb37b",
        "userEmail": "tester+ng@fonbnk.com",
        "status": "deposit_awaiting",
        "deposit": {
            "paymentChannel": "crypto",
            "currencyType": "crypto",
            "currencyCode": "POLYGON_USDT",
            "currencyDetails": {
                "network": "POLYGON",
                "asset": "USDT",
                "contractAddress": "0x3b3a06b48119c035a2e86afdb69d9ad930643b3d"
            },
            "cashout": {
                "amountBeforeFees": 100,
                "amountAfterFees": 100,
                "chargedFees": [],
                "totalChargedFees": 0,
                "chargedFeesPerRecipient": {},
                "amountBeforeFeesUsd": 100,
                "amountAfterFeesUsd": 100,
                "chargedFeesUsd": [],
                "totalChargedFeesUsd": 0,
                "exchangeRate": 1,
                "exchangeRateAfterFees": 1,
                "chargedFeesPerRecipientUsd": {},
                "feeSettings": []
            },
            "providedFieldsToCreateOrder": {
                "blockchainWalletAddress": "0x5b7ae3c6c87f4a3f94b35c77233b13191ebfad20"
            },
            "transferInstructions": {
                "type": "manual",
                "instructionsText": "Please send the exact amount of crypto to the address below. Make sure to send only USDT on the Polygon network. Sending any other assets or using a different network may result in loss of funds.",
                "transferDetails": [
                    {
                        "id": "recipientWalletAddress",
                        "label": "Wallet address to send",
                        "value": "0xdc9cbad0c43f912a66cd44cd22a15c04368e659f"
                    },
                    {
                        "id": "senderWalletAddress",
                        "label": "Your wallet address",
                        "value": "0x5b7ae3c6c87f4a3f94b35c77233b13191ebfad20"
                    },
                    {
                        "id": "amountToSend",
                        "label": "Amount to send",
                        "value": "100"
                    },
                    {
                        "id": "cryptoTransactionRequestAdditionalData",
                        "label": "Crypto transaction additional data",
                        "value": ""
                    }
                ],
                "fieldsToConfirmOrder": [
                    {
                        "key": "blockchainTransactionHash",
                        "type": "string",
                        "label": "Transaction hash",
                        "required": true
                    }
                ]
            },
            "formattedUserFieldsToCreateOrder": [
                {
                    "key": "blockchainWalletAddress",
                    "label": "Your wallet address",
                    "value": "0x5b7ae3c6c87f4a3f94b35c77233b13191ebfad20",
                    "type": "string"
                },
                {
                    "key": "depositSandboxForcedFlow",
                    "label": "Sandbox deposit forced flow",
                    "value": null,
                    "type": "enum"
                }
            ]
        },
        "payout": {
            "paymentChannel": "merchant_balance",
            "currencyType": "merchant_balance",
            "currencyCode": "USD",
            "currencyDetails": {
                "merchantName": "bohdan test"
            },
            "cashout": {
                "amountBeforeFees": 100,
                "amountAfterFees": 100,
                "chargedFees": [],
                "totalChargedFees": 0,
                "chargedFeesPerRecipient": {},
                "amountBeforeFeesUsd": 100,
                "amountAfterFeesUsd": 100,
                "chargedFeesUsd": [],
                "totalChargedFeesUsd": 0,
                "exchangeRate": 1,
                "exchangeRateAfterFees": 1,
                "chargedFeesPerRecipientUsd": {},
                "feeSettings": []
            },
            "providedFieldsToCreateOrder": {},
            "formattedUserFieldsToCreateOrder": [
                {
                    "key": "payoutSandboxForcedFlow",
                    "label": "Sandbox payout forced flow",
                    "value": null,
                    "type": "enum"
                }
            ]
        },
        "statusChangeLogs": [],
        "createdAt": "2026-03-26T14:42:51.252Z",
        "updatedAt": "2026-03-26T14:42:51.252Z",
        "expiresAt": "2026-03-26T15:12:50.857Z"
    }
}
```

{% endcode %}
{% endstep %}

{% step %}

#### A user makes the transfer with the exact amount and reference.&#x20;

{% endstep %}

{% step %}

#### Call [Confirm order](https://docs.fonbnk.com/server-to-server/api-endpoints/confirm-order) with a transaction hash:

```json
{
  "orderId": "692ee4bba60e213546387b1e",
  "fieldsToConfirmOrder": {
    "blockchainTransactionHash": "...hash"
  }
}
```

{% endstep %}

{% step %}

#### The system validates the deposit and processes payout.&#x20;

{% endstep %}

{% step %}

#### Use [Get order](https://docs.fonbnk.com/server-to-server/api-endpoints/get-order) to track status until " <mark style="color:yellow;">payout\_successful</mark>".

{% endstep %}
{% endstepper %}
