White-label (rebrand API) https://api.paygate.to with your own custom domain using Cloudflare workers.
- Create a new Cloudflare worker
- Edit the code and replace with the desired worker.js (You can use the hidden affiliate wallet version to hide your wallet affiliate parameter from your sub merchants by inserting it directly in the Cloudflare JS code).
- Replace the example wallet (0x505e71695E9bc45943c58adEC1650577BcA68fD9) with your own affiliate wallet.
- Replace checkout.example.com with your own custom domain to be displayed in the hosted Multi-provider Mode.
- Leave all instances of api.paygate.to intact, don't replace it with your own domain name.
- Route your custom domain to the newly created Cloudflare worker from your Cloudflare dashboard.
- For more information visit: https://paygate.to/affiliate-white-label/
- Technical Custom Domain Guide: https://paygate.to/white-label-api-custom-domain-guide/
Original Guide: https://paygate.to/white-label-api-custom-domain-guide/
In this tutorial you will learn how to use your own custom domain with the payment gateway API.
You will be able to use your own domain instead of:
api.paygate.tocheckout.paygate.to
You will also be able to optionally insert your affiliate wallet to earn your desired percentage on every sale your sub-merchant receives.
You need to complete 4 steps:
- Your domain name must be using Cloudflare DNS service (free account plan will work fine).
- Create a free Cloudflare Worker with the provided JS code to use the API.
- Route your domain to use the Cloudflare Worker.
- Optionally insert your affiliate wallet within the code and redistribute plugins to earn percentage on your sub-merchant sales.
Affiliate program: https://paygate.to/affiliate-white-label/
Create an account at:
Add your domain name to use the free Cloudflare DNS service.
After adding your domain you will be instructed to change your domain nameservers (NS records).
Go to your domain registrar where you registered your domain and use the custom nameservers provided in your Cloudflare account.
Those nameservers are different for each account.
Example screenshot:
After completing the previous steps your domain should be actively using Cloudflare.
Make a proxy (Orange Cloud) DNS A record for every subdomain you want to use with the API.
You can add 8.8.8.8 or any other IP address as this record will be proxied to the API anyway.
In the following example we will use:
api.iptvpay.compayment.iptvpay.com
instead of:
api.paygate.tocheckout.paygate.to
Example screenshot:
You may need to add a proxied record for every domain/subdomain you want to use as a custom domain for the API.
The IP address does not matter because it is only needed as a route for the worker in the next steps.
Example screenshot:
Go back to your main account page in the Cloudflare dashboard.
Example screenshot:
Visit the Cloudflare Workers tab.
Create a new worker after pressing the Create Application button.
After creating the worker, open its settings and edit the code.
Example screenshot:
You will need to insert the provided worker.js code into your worker.
Two versions are available:
The standard worker allows you to use your own custom domain without affiliate wallet injection.
GitHub: https://github.com/paygate-to/white-label-api/blob/main/worker.js
This version simply allows you to use your custom domain with the API.
The affiliate version allows you to use your hidden affiliate USDC (Polygon) wallet to earn 0.5% on every sale that goes through your custom domain.
GitHub: https://github.com/paygate-to/white-label-api/blob/main/hidden-affiliate-address-version/worker.js
Make sure to replace the wallet in the example code with your own USDC wallet to receive earnings.
You only need to:
- Change the wallet address
- Set a custom error page (optional)
Deploy the code to your Cloudflare Worker.
The free Cloudflare plan allows:
100,000 requests per day
with your own custom domain free of charge.
From the newly created worker settings you can:
- Set a global custom domain
- Set custom routes with multiple domains
Add a route for each subdomain you want to use with the wildcard *.
Example screenshot:
Example routes:
api.iptvpay.com/*
payment.iptvpay.com/*The * wildcard means the domain will work globally for any API path.
After completing all previous steps your domain should work exactly the same way as:
api.paygate.toUse the API documentation for testing:
https://paygate.to/instant-payment-gateway/#postman
Using the standard worker.js:
- Your domain will work exactly the same as the original API
Using the affiliate worker.js:
- The
affiliatewallet parameter will automatically be added to each request
- All plugins and modules are open-source and available to be modified or re-branded.
- Visit the GitHub repository to access all code:
You can easily re-brand all plugins or modules.
Replace all instances of:
api.paygate.to
checkout.paygate.towith your own custom domain configured in the previous steps.
Hidden Affiliate Injection
When using the affiliate worker.js:
- The affiliate wallet parameter will automatically be added to every request
- No need to insert the wallet inside plugin code
- This helps prevent sub-merchants from removing your wallet or bypassing your commission
Feel free to contact support for any questions.
There are different ready-made worker.js files available depending on your use case.
Allows you to use your custom domain for:
- Credit card systems
- Crypto systems
Without affiliate earning.
GitHub: https://github.com/paygate-to/white-label-api/blob/main/worker.js
Allows you to use your custom domain for:
- Credit card systems
With:
0.5%affiliate earnings
to the wallet inserted in the worker code.
GitHub: https://github.com/paygate-to/white-label-api/blob/main/hidden-affiliate-address-version/worker.js
Allows you to use your custom domain for:
- Credit card systems
With:
- Custom affiliate earning percentage
to the wallet inserted in the worker code.
Affiliate API documentation: https://documenter.getpostman.com/view/14826208/2sA3Bj9aBi#5bcee463-af55-4e7f-914e-bfdcb71f4098
Allows you to use your custom domain for:
- Credit card systems
- Crypto systems
With:
- Custom affiliate earning percentage
to the wallets inserted in the worker code.
Affiliate API documentation: https://documenter.getpostman.com/view/14826208/2sAXjF8ujk#1120f17a-0153-4256-ab3a-b96be79f09bb
Optional easy-to-use credit card affiliate workers with increased percentage presets.
Allows you to use your custom domain for:
- Credit card systems
- Virtual credit cards (VCC)
- Crypto systems
With:
- Custom affiliate earning percentage
- Full white-label support
- Sub-affiliate systems
Sub-affiliate worker example: https://github.com/paygate-to/white-label-api/blob/main/hidden-affiliate-address-version/Advanced-Full-White-label-with-sub-affiliate/Example-For-your-sub-affiliate/sub-affiliate-worker.js
Sub-affiliate API documentation: https://documenter.getpostman.com/view/14826208/2sA3Bj9aBi#e74d712c-5a25-4a23-9197-851e45074dd9







