White-Label API Custom Domain Guide | RiskPay.biz

Last Updated: 2025-04-08

Learn how to mask RiskPay’s API under your own domain using Cloudflare—plus hidden affiliate wallet integration to earn 0.5% lifetime commissions on every transaction.

No coding skills required
Free Cloudflare plan compatible
100% white-label checkout flow


Prerequisites

  1. A domain registered with any provider (e.g., GoDaddy, Namecheap).
  2. A free Cloudflare account.

Step 1: Configure Cloudflare DNS

1. Add Your Domain to Cloudflare

  • Sign up for Cloudflare and select the free plan.
  • Follow prompts to change your domain’s nameservers to Cloudflare’s (e.g., lara.ns.cloudflare.com).

2. Create Proxied DNS Records

  • Navigate to DNS > Records and add A records for:
    • api.yourdomain.com8.8.8.8 (proxy enabled 🟠)
    • checkout.yourdomain.com8.8.4.4 (proxy enabled 🟠)
    • Note: IPs are placeholders; Cloudflare will reroute traffic.

Step 2: Deploy the Cloudflare Worker

1. Create a New Worker

  • Go to Workers & Pages > Create Application.
  • Name it (e.g., riskpay-proxy).

2. Paste the Worker Code

Option A: Standard White-Label

// Basic proxy to RiskPay API (no affiliate wallet)  
addEventListener('fetch', event => {  
  event.respondWith(handleRequest(event.request))  
})  

async function handleRequest(request) {  
  const url = new URL(request.url)  
  url.hostname = 'api.riskpay.biz' // Keep this unchanged  
  return fetch(url, request)  
}

Option B: Affiliate Earnings (0.5% Commission)

// Adds hidden affiliate wallet to all requests  
addEventListener('fetch', event => {  
  event.respondWith(handleRequest(event.request))  
})  

async function handleRequest(request) {  
  const url = new URL(request.url)  
  url.hostname = 'api.riskpay.biz'  
  url.searchParams.append('affiliate_wallet', 'YOUR_USDC_POLYGON_WALLET') // Replace with your wallet  
  return fetch(url, request)  
}

3. Deploy the Worker

  • Click Save and Deploy.

Step 3: Route Traffic to Your Worker

  1. In your Worker’s Settings > Triggers, add routes:
    • api.yourdomain.com/*
    • checkout.yourdomain.com/*
  2. Enable the wildcard (*) to capture all subpaths.

Cloudflare Worker Routes (Picture coming soon)


Step 4: Rebrand RiskPay’s Plugins (Optional)

  1. Download our open-source plugins from GitHub.
  2. Replace all instances of:
    • api.riskpay.bizapi.yourdomain.com
    • checkout.riskpay.bizcheckout.yourdomain.com
  3. For WooCommerce: Upload the modified plugins to your clients’ sites.

💡 Pro Tip: Use the affiliate-enabled worker.js to ensure commissions even if clients alter plugin code.


Testing & Troubleshooting

  • Verify Setup: Visit api.yourdomain.com/status (should return RiskPay API).
  • Common Issues:
    • DNS not propagating? Wait 24 hours or flush DNS (ipconfig /flushdns).
    • 502 errors? Double-check worker code for typos.

Earning Commissions

Affiliate Dashboard Screenshot (Picture coming soon)


FAQ

A: No—Cloudflare’s proxy is required for security and routing.

A: Free Cloudflare workers allow 100,000 requests/day.

A: They receive USDC instantly to their wallets—no changes to RiskPay’s payout flow.


Need Help?

Contact our 24/7 Support Team: