Integration Guide
Accept crypto payments anywhere - web, mobile apps, or any platform. Simple API, powerful results.
Web Apps
Direct redirect or iframe
Mobile Apps
WebView or in-app browser
Any Backend
REST API integration
Use Your API Keys
Get your keys from API Keys page (requires wallet setup first)
Create Payment Session
Call our API from your backend
const response = await fetch(
'https://your-domain.com/api/payment/initialize',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + SECRET_KEY
},
body: JSON.stringify({
amount: 50.00,
currency: 'USD'
})
}
);
const { widget_url } = await response.json();Redirect Customer to Payment
Open the payment widget URL on any platform
// Web: Redirect browser
window.location.href = widget_url;
// Mobile (React Native): Open WebView
<WebView source={{ uri: widget_url }} />
// Mobile (Native): Open in-app browser
openUrl(widget_url);How to Setup:
- Go to Settings and click the Webhooks tab
- Enter your webhook URL (e.g., https://yoursite.com/api/webhook)
- Copy the webhook secret for signature verification
- Save your settings
Webhook Payload Example:
{
"event": "payment.completed",
"session_id": "sess_abc123",
"status": "completed",
"amount": "100.00",
"currency": "USD",
"settled_amount": "100.00",
"settled_currency": "USDC",
"deposit_tx_hash": "0x742d35...",
"settle_tx_hash": "0x8f3e21...",
"timestamp": "2024-11-17T10:30:00Z"
}Events: payment.pending, payment.confirming, payment.completed, payment.failed, payment.expired
Verify Webhook Signature:
// Verify the X-Webhook-Signature header
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return signature === expected;
}NNext.js / React
// app/api/create-payment/route.ts
export async function POST(request: Request) {
const { amount, currency } = await request.json();
const response = await fetch(
'https://your-domain.com/api/payment/initialize',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.SECRET_KEY}`
},
body: JSON.stringify({ amount, currency })
}
);
return Response.json(await response.json());
}
// components/PayButton.tsx
'use client';
export function PayButton({ amount }: { amount: number }) {
const handlePay = async () => {
const res = await fetch('/api/create-payment', {
method: 'POST',
body: JSON.stringify({ amount, currency: 'USD' })
});
const { widget_url } = await res.json();
window.location.href = widget_url;
};
return (
<button onClick={handlePay}>
Pay with Crypto
</button>
);
}RNReact Native / Mobile Apps
import { WebView } from 'react-native-webview';
import { Linking } from 'react-native';
// Option 1: Use WebView (recommended)
function PaymentScreen({ widgetUrl }) {
return (
<WebView
source={{ uri: widgetUrl }}
onNavigationStateChange={(state) => {
if (state.url.includes('success')) {
navigation.navigate('Success');
}
}}
/>
);
}
// Option 2: Open in external browser
async function openPayment(widgetUrl) {
await Linking.openURL(widgetUrl);
}PyPython (Flask / Django)
import requests
import os
def create_payment(amount, currency='USD'):
response = requests.post(
'https://your-domain.com/api/payment/initialize',
headers={
'Content-Type': 'application/json',
'Authorization': f'Bearer {os.getenv("SECRET_KEY")}'
},
json={'amount': amount, 'currency': currency}
)
return response.json()
# Usage
payment = create_payment(100.00)
return redirect(payment['widget_url'])Why do I need to add a wallet first?
Your wallet is where all payments are settled. We need it before generating API keys so payments have somewhere to go. Go to Settings → Wallets.
How do I test payments?
Use the Test Widget page to simulate a payment flow and see how the widget works before integrating.
Does it work on mobile apps?
Yes! Use WebView (React Native, Flutter, native iOS/Android) or open the widget URL in an in-app browser. Works on any platform.
How do webhooks work?
Configure your webhook URL in Settings. We POST payment status updates to your server with signature verification.