Guide
Accept USDT and crypto in WHMCS: setup guide
Add USDT (TRC-20, BEP-20), Bitcoin and other coins to WHMCS invoices with the free AywaPay module: install, settings, renewals, part payments and testing.
· 8 min read
If you sell hosting, VPN plans, game servers or SaaS through WHMCS, some of your clients already ask to pay in USDT. This guide shows how to add crypto to your WHMCS invoices with the free AywaPay module: what it does, how to install and set it up, what happens on renewals and part payments, and how to test it without real money.
Why hosting and VPN clients pay in USDT
Hosting and VPN businesses sell to people in many countries. Cards get declined across borders, some regions have few card options, and many clients already keep part of their savings in stablecoins. For them, paying a monthly invoice in USDT is simply the easiest way.
- USDT holds its value. One USDT tracks one US dollar, so a 10 USD plan costs about 10 USDT. Neither you nor the client takes on price swings between invoice and payment.
- Low network fees on TRON and BNB Smart Chain. Most clients send USDT on TRON (TRC-20) or BNB Smart Chain (BEP-20), where a transfer costs far less than on Ethereum. That matters for small monthly invoices.
- No chargebacks. A confirmed crypto payment can't be pulled back by the payer the way a card payment can. Refunds are your decision.
- Clients pay from where they hold coins. That can be a phone wallet or an exchange account. The payment page shows the address, the exact amount and a QR code.
Not sure which network to offer? Read USDT TRC-20 vs ERC-20 vs BEP-20. Bitcoin, ETH, BNB, TRX, LTC, DOGE and more are available too; see the supported coins.
What the WHMCS module does
- Adds AywaPay (crypto) as a payment gateway. Clients see a Pay Now button on their unpaid invoices.
- Pressing Pay Now creates an AywaPay invoice for the amount still due on the WHMCS invoice, in the invoice's own currency, and sends the client to the payment page. Just viewing an invoice creates nothing.
- When the payment is confirmed, a signed webhook marks the WHMCS invoice Paid by itself. WHMCS then runs its normal steps, such as activating or renewing the service.
- Every webhook is written to Billing → Gateway Log, so you can see each step.
- No card data passes through WHMCS, and the module loads no outside scripts.
Before you start
- WHMCS 8.x on PHP 7.4 or newer.
- Your WHMCS site reachable from the internet over HTTPS, so payment webhooks can arrive. If a firewall or bot protection sits in front of WHMCS, it must let POST requests reach
/modules/gateways/callback/aywapay.php. - A AywaPay account with a store. In the store you will copy two values: the API key and the webhook signing secret.
Step 1: upload the module
- Download
aywapay-for-whmcs.zipfrom the WHMCS integration page and unzip it. - Upload the
modulesfolder into your WHMCS root folder, the one that holdsinit.php. Let it merge with the existingmodulesfolder. - Check that three paths now exist:
modules/gateways/aywapay.php(the gateway),modules/gateways/aywapay/(the Pay script and shared code) andmodules/gateways/callback/aywapay.php(where payments are reported).
Step 2: get your API key and signing secret
- In the AywaPay dashboard open your store, then API, and copy the store's API key.
- In the same store open Webhooks and create the webhook signing secret. It starts with
whsec_and is shown only once, so copy it now.
The API key and the signing secret are two different values. The key lets WHMCS create invoices. The secret lets WHMCS check that a webhook really came from AywaPay.
Step 3: turn the gateway on
In WHMCS 8 go to System Settings → Payment Gateways, open All Payment Gateways and click AywaPay (crypto). (Older menus call it Setup → Payments → Payment Gateways.) You'll see these fields:
| Field | What to enter |
|---|---|
| API key | Your store's API key. A key that starts with test_ makes test invoices only, so no real money moves. |
| Webhook signing secret | The whsec_ secret from the store's Webhooks tab. Invoices are marked paid only by webhooks signed with it. |
| Invoice expiry (minutes) | Optional, 10 to 10080. Leave it empty to use your store's setting (60 minutes by default). |
| Description | Short text shown to the client above the Pay button. |
| Convert To For Processing | Leave it empty. The module accepts the invoice's own currency. |
Save. The Pay Now button appears only when both the API key and the signing secret are saved; until then the invoice says the gateway is not set up yet.
You don't need to enter a webhook URL in the AywaPay dashboard. Each invoice tells AywaPay where to send its webhooks: https://your-whmcs/modules/gateways/callback/aywapay.php.
How invoices get marked paid
- The client opens an unpaid invoice and presses Pay Now.
- The module checks that the invoice is unpaid and set to AywaPay, reads the amount due and the client's currency from WHMCS, and creates an AywaPay invoice. The amount is never taken from the browser.
- The client picks a coin and network on the payment page and pays.
- AywaPay sends a signed webhook. The module checks the signature and the timestamp, finds the WHMCS invoice, and checks that the price and currency match.
- On paid or overpaid, the module adds the payment to the WHMCS invoice in the invoice's currency (not the crypto amount), with the AywaPay invoice id as the transaction id. The invoice turns Paid.
A repeated webhook is ignored, so an invoice is never paid twice. If the client presses Pay Now again while the last AywaPay invoice can still be paid, the module reuses it instead of making a new one.
Renewals and recurring services
Crypto is pushed by the payer, so nobody can charge a client's wallet the way a saved card is charged. Renewals work the WHMCS way: WHMCS creates the renewal invoice on schedule and sends its usual invoice email. The client opens the invoice, presses Pay Now and pays. Once the invoice is paid, WHMCS renews or unsuspends the service as it normally does.
- Set your invoice generation days so clients get the invoice a few days before the due date. That leaves time to move coins from an exchange.
- Keep WHMCS's payment reminder emails on. They link straight to the invoice and its Pay Now button.
- Each renewal invoice gets its own AywaPay invoice, so your dashboard shows one payment per billing period.
Part payments and wrong amounts
Clients sometimes send a little less than asked, often because an exchange took its withdrawal fee out of the amount. The WHMCS invoice is only marked paid when the full amount has arrived. Everything else is logged in the Gateway Log so you can decide.
| What happened | WHMCS invoice |
|---|---|
| Paid in full, or more | Marked Paid. Any extra stays in your AywaPay balance. |
| Payment seen, waiting for confirmations | Stays unpaid. Logged as waiting for confirmations. |
| Part paid, invoice still open | Stays unpaid. The log shows how much arrived and how much is still due. The client can send the rest on the same payment page. |
| Time ran out after a part payment | Stays unpaid. The part that arrived is credited to your AywaPay balance, and Pay Now again makes a new invoice for the full balance. Contact the client, or refund from your dashboard. |
| Expired with nothing paid | Stays unpaid. The client can press Pay Now again. |
| Amount or currency doesn't match | Stays unpaid. Logged so you can check it in your dashboard. |
Your store also has an Accept underpayment up to (%) setting, which lets a payment that is short by a small share count as paid. Payments that arrive after an invoice expired are still credited to your balance. More on this in crypto underpayments and overpayments.
Step 4: test with a test_ key
- Paste your store's test key (it starts with
test_) into API key and save. - Create an invoice for a test client in WHMCS. Use a test client, because a paid invoice can activate a real service.
- Log in as that client, open the invoice and press Pay Now.
- The test payment page has Simulate buttons: paid, overpaid, underpaid and expire. Press paid and check that the WHMCS invoice turns Paid.
- Try the other buttons on new invoices and read each line in Billing → Gateway Log.
Test webhooks carry "test": true and move no money. You can also press Send a test in the store's Webhooks tab: the module answers it and changes nothing, which is a quick way to check that webhooks reach your server.
Step 5: go live
Swap the live API key in and save. Pay one small real invoice yourself, for example a few dollars in USDT on TRON, and watch it turn Paid. Then you're ready for clients.
Troubleshooting
| Problem | What to check |
|---|---|
| No Pay Now button | Both the API key and the webhook signing secret must be saved, and the invoice's payment method must be AywaPay (crypto). |
| Invoice stays unpaid after paying | Open Billing → Gateway Log. "Bad, old or missing signature" means the secret in WHMCS doesn't match your store's, or your server clock is off. No log line at all means the webhook can't reach the callback URL. |
| Webhook blocked | Allow POST requests to /modules/gateways/callback/aywapay.php through your firewall or bot protection. |
What it costs
The module is free. You pay 0.5% per payment plus the coin's network fee, with no setup or monthly fees. Your store can be set to Store pays (you cover both) or Customer pays (both are added on top and you receive the full invoice amount). Withdrawals to your own wallet cost $0.25 plus the network fee. The pricing page has a fee calculator.
Frequently asked questions
- Which WHMCS versions does the module support?
- WHMCS 8.x on PHP 7.4 or newer. Download it from the WHMCS integration page.
- Can clients pay renewals automatically?
- No wallet can be charged without the owner sending the payment. WHMCS creates each renewal invoice and emails it, and the client pays it with Pay Now. The invoice is then marked paid by itself.
- What happens if a client sends too little USDT?
- The WHMCS invoice stays unpaid. While the payment page is open the client can send the rest. If time runs out, the part that arrived is credited to your balance and noted in the Gateway Log, so you can contact the client or refund.
- Do I need to set a webhook URL?
- No. Every invoice tells AywaPay where to send its webhooks. Your WHMCS site only needs to accept POST requests at the callback address.