Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

On-Ramp: Fiat → Crypto

Step-by-step guide to integrating fiat-to-crypto on-ramp transactions.

The on-ramp flow lets your users pay with local fiat currency and receive cryptocurrency in their wallet. Ivorypay handles the payment collection, conversion, and crypto payout automatically.

How it works

1. Your server calls POST /v1/onramp with user and transaction details
2. Ivorypay returns payment instructions for the selected method
3. The user transfers fiat or authorizes the bank/mobile-money payment
4. Ivorypay detects the payment → webhook: onramp.fiatPaymentReceived
5. Ivorypay converts fiat to crypto and sends it to the wallet address
6. Transaction completes → webhook: onramp.success (or onramp.failed)

Mobile money support

For mobile-money currencies (for example, UGX and KES), the customer authorizes the payment through their mobile money account instead of transferring to a virtual bank account. When transferDetails.paymentInstructions is present, display its ordered steps (currently English) for that payment. The customer follows them on the paying phone and enters their PIN only in the mobile money menu. Some networks send an automatic prompt; others require the customer to open the network's USSD menu. Use the returned instructions rather than hard-coding a network's steps. Confirm the final outcome through transaction status and webhooks.

ZAR bank payments

For ZAR, use Capitec Pay or EFT with your own interface or Ivorypay hosted checkout. Both require customer bank authorization; ZAR does not return a virtual account.

Integration steps

1

Create the on-ramp transaction

Choose between two initiation methods:

Method
Use when

POST /v1/onramp

You're creating a new customer and transaction in one call

POST /v1/onramp/initiate

The customer already exists in your Ivorypay account

Example: Initiate with customer creation

curl -X POST https://ramp-api.ivorypay.io/api/v1/onramp \
  -H "Authorization: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Amina",
    "lastName": "Okafor",
    "email": "amina@example.com",
    "phoneNumber": "+2348012345678",
    "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD68",
    "blockchain": "BSC_MAINNET",
    "reference": "550e8400-e29b-41d4-a716-446655440000",
    "token": "USDT",
    "fiatCurrency": "NGN",
    "fiatAmount": 50000
  }'

Response

The endpoint returns HTTP 201 with the standard envelope.

{
  "success": true,
  "message": "Query successful",
  "data": {
    "firstName": "Amina",
    "lastName": "Okafor",
    "email": "amina@example.com",
    "refCode": "abc123def4",
    "reference": "550e8400-e29b-41d4-a716-446655440000",
    "transferDetails": {
      "accountName": "Ivorypay - Amina Okafor",
      "accountNumber": "1234567890",
      "bank": "Providus Bank",
      "amountPayable": 50000,
      "expiresAt": "2026-03-26T13:00:00.000Z",
      "currency": "NGN",
      "businessFee": 0,
      "platformFee": 250,
      "gasFee": 0.5,
      "createdAt": "2026-03-26T12:00:00.000Z",
      "checkoutUrl": null,
      "cryptoAmount": 31.25
    }
  }
}
2

Collect payment from your user

Use the returned transferDetails for the selected payment method:

  • ZAR with your own interface: show a Continue to bank button that opens nextAction.url unchanged. See ZAR bank payments.

  • Virtual account: display accountNumber, bank, and the exact amountPayable in your interface.

  • Mobile money: follow the returned approval instructions; the customer may receive a prompt on their phone.

  • Full Ivorypay checkout: use the hosted checkout initiation flow and open its data.checkoutUrl.

3

Listen for webhooks

Set up a webhook endpoint to receive real-time updates:

Event
When it fires

onramp.fiatPaymentReceived

User's fiat payment has been detected and confirmed

onramp.cryptoPayoutProcessing

Crypto is being sent to the user's wallet

onramp.success

Crypto has been delivered: transaction complete

onramp.failed

Something went wrong: check failedReason

Example webhook payload: onramp.success

{
  "event": "onramp.success",
  "data": {
    "reference": "550e8400-e29b-41d4-a716-446655440000",
    "amount": 31.25,
    "platformFeeInCrypto": 0.15,
    "businessFeeInCrypto": 0,
    "gasFee": 0.5,
    "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD68",
    "network": "BSC_MAINNET",
    "token": "USDT",
    "transactionHash": "0xabc123...",
    "status": "SUCCESS",
    "customer": {
      "refCode": "abc123def4",
      "userId": "9b1a3f8a-1c2d-4e5f-9012-abcdef123456",
      "email": "amina@example.com",
      "firstName": "Amina",
      "lastName": "Okafor",
      "context": "LIVE",
      "createdAt": "2026-03-26T11:55:00.000Z",
      "createdAtDateOnly": "2026-03-26"
    }
  }
}
4

Verify the transaction (optional)

You can also poll for the transaction status:

curl -X GET https://ramp-api.ivorypay.io/api/v1/onramp/status/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: your_api_key"
5

Specifying amounts and fees

You can specify the transaction amount in either fiat or crypto (not both):

Scenario
Fields to send

User wants to spend 50,000 NGN

"fiatAmount": 50000

User wants to receive exactly 30 USDT

"cryptoAmount": 30

Business fees must be supplied in the same denomination as the amount. There are two valid patterns:

Pattern
Amount field
Fee field

Fiat-denominated

fiatAmount

businessFeeInFiat

Crypto-denominated

cryptoAmount

businessFeeInCrypto

Minimum amounts

Before initiating, check the minimum on-ramp amount for a currency:

Transaction lifecycle

Frequently asked questions

What happens if the payment session expires before the user pays?

Stop showing expired payment instructions. Read the current transaction and check whether money was received. Use funding refresh when eligible; do not create another payment merely because the previous response timed out.

What if the user sends the wrong fiat amount?

Ask customers to pay the exact returned amount using the specified currency/token and network. An amount or token mismatch may require reconciliation or refund; do not promise automatic success or a recalculated payout. Use the final authenticated status and safe failure reason.

Can I set both fiatAmount and cryptoAmount in the same request?

No. The API requires you to specify exactly one of fiatAmount or cryptoAmount. If you include both, the request will fail with a validation error. Use fiatAmount when the user wants to spend a specific amount of local currency, and cryptoAmount when the user wants to receive an exact amount of crypto.

How do I check the minimum on-ramp amount for a given currency?

Call GET /v1/onramp/minimum-amount/{currency} (e.g., /minimum-amount/NGN) with your API key. The response contains the minimum fiat amount required to initiate an on-ramp transaction in that currency.

What does the onramp.failed webhook mean, and how should I handle it?

The onramp.failed event indicates that the transaction could not be completed. The webhook payload includes a failedReason field explaining the cause. You should notify the user of the failure and, depending on the reason, reconcile the existing reference or contact support before creating another payment.

Last updated