Blog

How to accept crypto payments in WHMCS

CoinStack11 min read
Integrations

To accept crypto payments in WHMCS, install a gateway module that sends each invoice to a crypto checkout and marks it paid when the payment completes. With the CoinStack module for WHMCS 8 and 9, setup takes 4 steps: create an API key, upload 2 folders, activate the gateway and paste the key. Customers pay with any of 10 tokens on 11 networks, you receive USDC in a wallet you control, and the fee is 0.8% per payment.

How does a crypto gateway fit into WHMCS?

WHMCS groups payment modules by how they collect money. Crypto modules are third-party gateways, which the WHMCS documentation describes as ones that "direct the client to the provider's website to process payments off-site." Two things follow from that.

Nothing is stored that could be charged later. A card module keeps a token and captures it when an invoice falls due. A crypto payment is a transfer the customer sends from their own wallet, so every invoice, renewals included, is paid from the invoice's pay button, with any of 10 tokens on 11 networks. The same page says the admin-side Attempt Capture button is switched off for third-party gateways "because the client must click the payment button on the invoice to send payment." Handling WHMCS renewals when customers pay with crypto covers the reminder and suspension settings that make this work.

The invoice email differs too. Third-party gateways send the Invoice Created template and card gateways send Credit Card Invoice Created, so payment hints for crypto customers belong in the first one.

The CoinStack module is one you add yourself, and WHMCS crypto payment gateways compared lists the crypto gateways available for WHMCS with fees and update dates. The rest of this guide follows the CoinStack module's setup documentation.

What you need before you start

RequirementDetail
WHMCS 8 or 9The 2 major versions the module supports. WHMCS's releases page marks 8.12 and older as End of Life, so update WHMCS first if you are behind.
PHP cURL extensionCheck under Utilities > System > PHP Info in the WHMCS admin area.
An https:// System URLSet under Configuration > System Settings > General Settings. The certificate has to be valid, because payment updates are sent to that address.
The WHMCS cronWHMCS recommends running it every 5 minutes. The module also uses it to catch up on payment updates it missed.
A CoinStack accountSign-up is instant with an email code or Google at Sign in. A wallet you control is created with the account, and payments settle there or to any other address you name.

Install the module in 4 steps

  1. Create an API key. In the CoinStack dashboard, open Developers, select New API key and set Access to Read and write. Copy the key when it appears. It starts with sk_ and is shown only once.
  2. Upload the module. Download the zip, unzip it, and copy the modules and includes folders it contains into the root of your WHMCS installation. They merge with the folders of the same name that are already there.
  3. Activate the gateway. In the WHMCS admin area, open Configuration > System Settings > Payment Gateways and activate CoinStack.
  4. Paste the key into the gateway's API key field and save.

That is the whole configuration. The module registers its own webhook, so there is no callback URL or signing secret to copy between the 2 systems. It connects within a few minutes of saving. A Connection line in the gateway settings shows whether it is connected and, if it is not, the reason, such as a System URL without https://, a key that was not recognized, or a key with read-only access. Reload the settings page to see the latest result.

The demo checkout shows the customer's side. For an end-to-end check, raise an invoice of $1 or more on a test client account and pay it from your own wallet. How to test a crypto checkout before launch has a fuller checklist.

What do customers see on a WHMCS invoice?

The payment method is listed as Crypto (CoinStack) unless you change its Display Name in the gateway settings. New customers can pick it on the order form. Existing customers can switch an open invoice to it only if Clients Choose Gateway is enabled in the Invoices tab of General Settings. With that setting off, WHMCS says "each invoice must use the payment gateway that the client chose during signup."

From the invoice, the steps are:

  1. The customer, signed in to the client area, clicks Pay Now on the invoice.
  2. The module creates a checkout for the invoice balance, so credit already applied to the invoice is left out, and sends the customer to the hosted checkout page. The page shows the invoice number as its description.
  3. The customer picks a token and a network and sees an address, the exact amount and a QR code. There is no wallet to connect. They can send from any wallet or from an exchange's withdrawal form.
  4. The page updates as the payment is detected and completed, and carries a link back to the invoice.

Two details save support tickets. The checkout stays open for 24 hours, and clicking Pay Now again in that time returns the customer to the same checkout, with the same address, as long as the balance has not changed and more than 10 minutes remain. After it expires unpaid, the next click opens a new checkout with a new address. And the amount in crypto is fixed once the customer picks a token: with no time limit for stablecoins, for 60 minutes for BTC and for 20 minutes for the other tokens.

How do invoices get marked paid?

The module maps the checkout's status to the WHMCS invoice.

Checkout statusWhat happens in WHMCS
confirmingA payment was detected. The invoice changes from Unpaid to Payment Pending.
completedThe payment is recorded on the invoice and the invoice is marked Paid.
partialLess than the full amount arrived. The invoice is not marked paid, and the customer can send the rest to the same address.
expired after a part paymentWhat arrived is recorded as a payment on the invoice, which stays Unpaid with a lower balance.
resolvedYou accepted an underpayment in the CoinStack dashboard. The remainder is recorded and the invoice is marked Paid.

Updates reach WHMCS in 3 ways. CoinStack sends a signed webhook to modules/gateways/callback/coinstack.php and makes up to 8 delivery attempts over about a day if your server does not accept it. The module checks its open checkouts again when the WHMCS cron runs. And the link back from the checkout page triggers a check as the customer returns. In each case the notification only says which checkout changed. The module then reads that checkout's status from the CoinStack API before it touches an invoice.

From there WHMCS behaves as it does with any gateway. Its billing logic page says that "a transaction that fully pays the balance on an invoice" sets off the automation on payment. The payment confirmation email goes out and the Next Due Date moves forward one billing cycle. A new order is provisioned according to the product's Module Settings, and a service suspended for non-payment is unsuspended if Enable Unsuspension is on.

Each transaction is stored with the checkout ID as its transaction ID and the CoinStack fee in the fees field, in the invoice's currency. That gives you one line per payment to match against the dashboard, and the checkout's reference, WHMCS- followed by the invoice ID, ties it back the other way.

Which invoice currencies work?

CoinStack accepts invoices in 146 currencies, among them USD, EUR, GBP, INR, BRL, TRY, NGN and IDR. For those there is nothing to set. The invoice amount is sent in the client's currency and converted to US dollars when the checkout is created, and the payment is recorded in WHMCS in the invoice's own currency.

On an invoice in a currency outside that list, the customer sees a line saying the payment method is not available for the invoice, and the Activity Log names the invoice and the currency. The fix is the Convert To For Processing setting on the gateway: choose a currency that is accepted, such as USD. WHMCS adds 2 conditions in its guide to converting invoice currencies. The setting "only displays if you have configured at least two currencies", and the conversion uses "the Base Conversion Rate value in your WHMCS installation at the time of payment." Turn on Exchange Rates under Currency Auto Update Settings in Automation Settings so those rates stay current.

You do not add Bitcoin or USDT as a WHMCS currency. Prices and invoices stay in the currencies you already sell in.

Invoices of $1 or more can be paid on most networks. Accepting Bitcoin on WHMCS invoices and accepting USDT in WHMCS cover the details for each token.

What happens with part payments, overpayments and refunds?

Customers type amounts by hand and exchanges deduct fees, so some payments miss the total.

  • A small shortfall still completes. The allowance is set in the CoinStack dashboard under Settings, then Underpayment, and defaults to 0.5%. On a $20 invoice that is 10 cents, and WHMCS marks the invoice Paid.
  • A larger shortfall leaves the checkout partial. If it expires that way, the customer can pay the rest from the invoice page, which opens a new checkout for the remaining balance. To write off the difference instead, select Mark as resolved on the checkout in the CoinStack dashboard.
  • A payment more than 2% over the total is flagged as overpaid. All of it settles to your wallet, the invoice is paid for its own amount, and the Gateway Log entry notes the overpayment. Returning the extra is your call: refund it from your wallet, or add it to the client's credit balance by hand.

You send refunds from your own wallet, on your own timing. To keep the books straight, record the refund on the invoice with the type WHMCS calls Manual Refund Processed Externally. How to refund a crypto payment covers getting the right address from the customer first.

What does it cost on a hosting invoice?

The CoinStack fee is 0.8% of each payment, taken before the payment settles. There is no setup fee and no monthly fee. For comparison, Stripe's US list price for a domestic card is 2.9% plus 30 cents.

InvoiceCoinStack feeCard at 2.9% + 30 cents
$9.99 shared hosting, monthly$0.08$0.59
$36 VPS, quarterly$0.29$1.34
$180 dedicated server, monthly$1.44$5.52

Network cost is separate. It is the cost of moving the payment from the customer's network to your wallet: the docs example puts it below 2 cents for $25 in USDC on Base, and it costs more on Bitcoin and TRON. By default you cover it on every network except those 2, where it is added to what the customer pays. You can change who covers it, network by network, under Settings, then Network cost.

Every payment settles as USDC when it completes, on the network you choose and at the address you choose, such as the wallet created with your account or an exchange deposit address. The account owner can withdraw from the dashboard to any supported token and network, or convert the balance to fiat and receive it in a bank account. Selling USDC on an exchange is described in how to cash out USDC.

Where do you look when an invoice stays unpaid?

Two WHMCS logs hold the module's records. The Gateway Log, under Billing > Gateway Log, has an entry for each payment event and each error, with the checkout ID, its status, the amounts and whether it was underpaid, overpaid or late. The Activity Log, under Configuration > System Logs, gets a note for anything that needs a person, such as a payment that arrived for an invoice that was already cancelled or paid another way.

If payments complete in the CoinStack dashboard but invoices are not marked paid, the docs list 3 things to check:

  1. The System URL starts with https:// and its certificate is valid.
  2. Your firewall or security plugin allows POST requests from outside to modules/gateways/callback/coinstack.php.
  3. The WHMCS cron is running.

WHMCS invoice paid on-chain but still Unpaid works through each case. If you write to [email protected], include your WHMCS version, the invoice number and the related Gateway Log entries.

Frequently asked questions

Do I have to enter a callback or webhook URL in WHMCS?

No. When the gateway connects, the module registers its webhook with CoinStack for you, pointing at the callback file inside your WHMCS installation. Your part is to keep the System URL on https:// with a valid certificate and to let outside POST requests reach modules/gateways/callback/coinstack.php through any firewall or security plugin.

What status does a WHMCS invoice show while a crypto payment is confirming?

Payment Pending. The module moves the invoice from Unpaid to Payment Pending when a payment is detected, and to Paid when the checkout completes. Provisioning and renewal wait for the Paid status. If the detected payment fails and nothing else arrives, the invoice goes back to Unpaid when the checkout expires.

What happens if a customer pays after the checkout has expired?

The payment is still recorded against the checkout. If it covers the full amount, the checkout becomes completed with a late flag and the module marks the invoice Paid, provided the invoice is still Unpaid. If you cancelled the invoice in the meantime, nothing is recorded in WHMCS, the Activity Log tells you, and the USDC is in your wallet to refund or apply by hand.

Can crypto run next to Stripe or PayPal in WHMCS?

Yes. WHMCS lets you activate several gateways, and each appears as its own payment method. Card customers keep their automatic charges, and crypto becomes one more choice on the order form and on invoices. Enable Clients Choose Gateway if you want existing customers to be able to switch an invoice to crypto themselves.

More posts