Fiat To Crypto Payment Gateway API
Create anonymous payment links, send customers to card or bank-transfer providers, and settle orders to crypto wallets through Onramp Pay.
Base URL
Checkout URL
Important notes
- Create one unique wallet per customer payment or invoice.
- The callback URL must be URL-encoded and must contain a unique value.
- Do not embed provider checkout in an iframe. Redirect the customer directly.
- For white-label partners, document them as sub-affiliates under Onramp Pay. Do not expose direct PayGate affiliate setup as the partner flow.
Create Wallet
https://api.onramp-pay.com/control/wallet.php?address=0xYourPolygonWallet&callback=https%3A%2F%2Fmerchant.com%2Fcallback%3Finvoice%3DINV-1001
Creates a unique encrypted wallet reference for one customer invoice. Use address_in from this response when building the checkout URL. Your callback URL must contain a unique order, invoice, or user value.
Parameters
Example response
{
"address_in": "encrypted_checkout_address",
"polygon_address_in": "0x756C4D5EAad2165b3841a543Cf851Eed6AAF211B",
"callback_url": "https://merchant.com/callback?invoice=INV-1001",
"ipn_token": "payment_tracking_token"
}Process Payment
https://checkout.onramp-pay.com/process-payment.php?address=encrypted_checkout_address&amount=103.00&provider=moonpay&email=john%40example.com¤cy=USD
Redirects the customer to a selected payment provider. Pass the encrypted address_in returned by Create Wallet, not your payout wallet. If the customer should cover Onramp Pay fees, add 3% to the checkout amount before redirecting.
Parameters
Example response
HTTP 302 redirect to the provider checkout page
Multi-provider Checkout
https://checkout.onramp-pay.com/pay.php?address=encrypted_checkout_address&amount=103.00&email=john%40example.com¤cy=USD&domain=checkout.onramp-pay.com
Shows a hosted checkout page where the customer can choose from available provider routes. Provider availability depends on customer location, currency, order amount, and route status.
Parameters
Example response
HTTP 302 redirect to hosted Onramp Pay checkout
List Providers
https://api.onramp-pay.com/control/provider-status
Returns available fiat-to-crypto payment providers, their provider IDs, route status, minimum currency, and minimum amount. Fetch this before routing production traffic.
Example response
{
"providers": [
{
"id": "moonpay",
"provider_name": "MoonPay",
"status": "active",
"minimum_currency": "USD",
"minimum_amount": 20
},
{
"id": "rampnetwork",
"provider_name": "ramp.network",
"status": "active",
"minimum_currency": "USD",
"minimum_amount": 4
}
]
}Convert to USD
https://api.onramp-pay.com/control/convert.php?from=EUR&value=1258.31
Converts a fiat amount into USD for providers that only support USD checkout values.
Parameters
Example response
{
"status": "success",
"value_coin": "1351.76",
"exchange_rate": "1.07427"
}Check Payment Status
https://api.onramp-pay.com/control/payment-status.php?ipn_token=payment_tracking_token
Checks payment status by ipn_token. Use this for support and manual review. Your production order state should rely on webhook callbacks to avoid rate limiting.
Parameters
Example response
{
"status": "paid",
"value_coin": "117.59",
"txid_out": "0xe85ed56174785b0bb9fcb522655f961675ad236f2aad2f5bb4fa2f074ac09726",
"coin": "polygon_usdc"
}Callback Event
https://merchant.com/callback?invoice=INV-1001&value_coin=105.60&coin=polygon_usdc&txid_in=0xa22a...&txid_out=0x94c2...&address_in=0x32e854...&value_forwarded_coin=102.432
Onramp Pay calls your callback URL after payment. Your original query parameters are preserved, and payment data is appended for reconciliation.
Parameters
Example response
Respond with plain text: ok
Sub-affiliate Create Wallet
https://api.onramp-pay.com/set-affiliate.php?address=0xMerchantWallet&callback=https%3A%2F%2Fmerchant.com%2Fcallback%3Finvoice%3DINV-1001&sub_affiliate=0xSubAffiliateWallet&domain=checkout.sub-affiliate-website.com&sub_affiliate_fee=0.01&merchant_fee=0.95
Use this flow for partners who white-label under Onramp Pay. PayGate is the upstream provider, Onramp Pay is the affiliate layer, and your partner is the sub-affiliate. Do not use the direct PayGate affiliate endpoint in partner-facing documentation.
Parameters
Example response
{
"address_in": "encrypted_checkout_address",
"polygon_address_in": "0x756C4D5EAad2165b3841a543Cf851Eed6AAF211B",
"callback_url": "https://merchant.com/callback?invoice=INV-1001",
"ipn_token": "payment_tracking_token"
}Sub-affiliate Worker Example
https://sub-affiliate-website.com/control/wallet.php?...
Example Cloudflare Worker for a sub-affiliate that points to the Onramp Pay API domain, rewrites wallet creation endpoints to the sub-affiliate endpoints, appends the partner wallet, domain, and fee split, and preserves customer country routing.
Example response
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const targetUrl = 'https://api.onramp-pay.com';
const url = new URL(request.url);
url.hostname = new URL(targetUrl).hostname;
if (url.pathname.includes('/control/wallet.php')) {
url.pathname = url.pathname.replace('/control/wallet.php', '/set-affiliate.php');
} else if (url.pathname.includes('/crypto/cards/wallet.php')) {
url.pathname = url.pathname.replace('/crypto/cards/wallet.php', '/vcc-set-affiliate.php');
}
if (!url.pathname.includes('process-payment.php')) {
url.search += (url.search ? '&' : '') + 'sub_affiliate=0xSubAffiliateWallet&domain=checkout.sub-affiliate-website.com';
url.search += (url.search ? '&' : '') + 'sub_affiliate_fee=0.01';
url.search += (url.search ? '&' : '') + 'merchant_fee=0.95';
}
const modifiedRequest = new Request(url.toString(), {
method: request.method,
headers: {
...Object.fromEntries(request.headers),
'PGTO-IPCountry': request.cf?.country || 'XX'
},
body: request.body ? request.clone().body : null,
redirect: 'manual'
});
const response = await fetch(modifiedRequest);
if (response.status >= 300 && response.status < 400) return response;
if (response.status >= 400) return Response.redirect('https://www.sub-affiliate-website.com/error', 302);
const modifiedResponse = new Response(response.body, response);
modifiedResponse.headers.set('Access-Control-Allow-Origin', '*');
return modifiedResponse;
}