[01] Choose your setup
Your own addresses are now required: the shared PayGate API and checkout addresses no longer accept requests. Pick one now; you can add the other later.
api.yourdomain.com → your Cloudflare worker → your dedicated PayGate endpoint. Needed for card payments and the hosted multi-coin page, which open on your own checkout domain. Your brand, optional affiliate earnings, the strongest DDoS isolation.In this tutorial you will learn how to use your own custom domain with our payment gateway API. Your own domain and a dedicated API endpoint are now required: the shared api.paygate.to and checkout.paygate.to addresses no longer accept requests. You will also be able to optionally insert your affiliate wallet to earn your desired percentage on every sale your sub-merchant receive.
Get Your Dedicated API Endpoint
Every store and integration needs its own free dedicated API endpoint (also called a signer). It is a DDoS-protected PayGate address of your own, such as api-yourshop-1a2b3c4d5e6f7a8b9c0d1e2f.paygate.to. It takes a few seconds:
- Open the endpoint form on this page and enter your website (it is shown in your endpoint name).
- Tick the Verify you are human box, then press Get my dedicated endpoint.

- Copy your endpoint. The form shows where to paste it in each plugin.

Then choose how customers reach your checkout domain: with a free Cloudflare worker (the steps below), or with your own server.
Use a Cloudflare Worker
You need to make 4 steps:
- Your domain name must be using Cloudflare DNS service (free account plan will work fine).
- Create a free Cloudflare worker with our JS code to use our API.
- Connect your domain to the worker with one click (Add Domain). No DNS records or routes needed.
- Optionally you can insert your affiliate wallet within the code and redistribute our plugins to earn percentage on your sub-merchant sales.
Use Cloudflare DNS
- Create a free Cloudflare account
- Add your domain name to use the free Cloudflare DNS service (Domains → Add domain → Connect a domain).
- After adding your domain you will be instructed to change your domain’s 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.
- After completing the previous steps your domain should be actively using Cloudflare. You don't need to add any DNS records for the API: Cloudflare creates them when you connect the domain to your worker below.
Create a Cloudflare Worker
- In the Cloudflare dashboard sidebar open Compute → Workers & Pages.
- Press the Create application button.
- Choose Start with Hello World! This creates an empty worker you will replace with our code.
- Name the worker (for example
paygate-api) and press Deploy.
- On the new worker's page press Edit code.
- Select all the Hello World code in the editor, delete it and paste our worker.js code instead. We offer two versions: standard worker.js will allow you to use your own custom domain without an affiliate wallet injection this will simply allow you to use your custom domain with our API.
Optionally you can use the affiliate version worker.js which will allow you to use your hidden affiliate USDC (Polygon) wallet to earn 0.5% on every sale that go through your custom domain. Make sure to replace the wallet in the example code with your own USDC wallet to receive earnings.
⚠️ Replace thetargetUrladdress with your own dedicated API endpoint, then change the wallet address and set a custom error page. Never put your own domain intargetUrl.Dedicated API endpoint
ThetargetUrlin the worker is PayGate's address, not your own domain; your domain is connected in the worker's Domains tab. SettargetUrlto your free dedicated API endpoint (required: the shared address no longer accepts requests). The automatic generator above gets one for you and makes the change. - Press Deploy in the editor to publish the code.

The free Cloudflare plan will allow you to use 100,000 request per day with your own custom domain free of charge.
Connect Your Custom Domain to the Worker
- Open the worker's Domains tab and press Add Domain.
- Choose your domain and enter the subdomain for your API, for example api.example.com. Cloudflare creates the DNS record and the SSL certificate automatically, so there are no DNS records or routes to set up. If that subdomain already has a DNS record, delete it first.
- Press Add Domain again for your payment page address, for example payment.example.com. Your customers see this address on the hosted card and multi-coin crypto payment pages.
- After a minute or two your domain answers every PayGate API request. Enter it in the API Domain (or Custom API Domain) setting of your PayGate plugin, and your payment page address as the plugin's checkout domain (Custom Domain).
- You can follow the API Docs for testing.
- Using the standard worker.js your domain will work exactly the same as the original API and in case you inserted the affiliate worker.js with your affiliate wallet hidden in the JS code; the parameter affiliate wallet will be added to each request.
Use Your Own Server Instead of Cloudflare
You can skip Cloudflare completely. Use your dedicated endpoint directly as the API Domain, and serve your checkout domain from a server you already run:
- Point a subdomain such as checkout.example8585859.com at your server and give it an HTTPS certificate.
- Set the subdomain up as a reverse proxy that forwards every request to
https://+ your dedicated endpoint, keeping the path, the query string, the method and the body. - Connect to your endpoint over HTTPS with the endpoint's own name as the host name (Host header and SNI), and pass the answer back unchanged, including redirects.
- Enter the subdomain as the checkout domain (Custom Domain) in your plugin. The plugins add it to every payment page link (the
domainparameter), so the hosted pages build their links and requests on your domain.
The same proxy can also serve your own API domain (for example api.example8585859.com). Affiliate commissions that the worker files add for you are passed as request parameters instead; see the affiliate endpoints.
Earning Affiliate Commission and White-label Plugins and Modules
- All our plugins and modules are open-source and available to be modified or re-branded you can visit our GitHub to access all code.
- You can easily re-brand all plugins or modules. Every plugin asks for your own API domain (or dedicated endpoint) and checkout domain in its settings, so your sub-merchants enter the custom domains configured in the previous steps.
- When you use the affiliate worker.js for your custom domain the affiliate parameter wallet will be added to every request without the need to insert it in the plugin code. This maybe useful to prevent your sub-merchant from removing your wallet or bypass your commission.
- Feel free to contact our support for any questions.
Which worker.js File to Select
There are different ready made worker.js files you will probably need one of them only per your use case.
- Default worker.js would allow you to use your custom domain for both the credit card and crypto systems without affiliate earning.
- Default affiliate worker.js would allow you to use your custom domain for the credit card system with 0.5% affiliate earning to the wallet inserted in the worker code.
- Custom affiliate worker.js would allow you to use your custom domain for the credit card system with custom affiliate earning percentage to the wallet inserted in the worker code.
- Crypto affiliate worker.js would allow you to use your custom domain for both the credit card and crypto systems including crypto swapping with custom affiliate earning percentage to the wallets inserted in the worker code.
- Increased affiliate worker.js commission optional easy usage credit card only affiliate workers with increased percentage set for your convenience.
- Advanced full White-label would allow you to use your custom domain for all the credit card, crypto swap and crypto payment systems with custom affiliate earning percentage to the wallets inserted in the worker code. Also it will allow having your own credit card affiliate system for your white-label rebrand where your affiliates use workers to point to your custom API domain and set their own commission.

