Blog

WHMCS invoice paid in crypto but still Unpaid: fixes

CoinStackUpdated 11 min read
Integrations

When a WHMCS invoice paid on-chain still shows Unpaid, either the payment update never reached WHMCS or WHMCS refused to record it. Check in this order: the Connection line in the gateway settings, a System URL on https:// with a valid certificate, a firewall that lets outside POST requests reach the callback file, a running WHMCS cron, an API key with Read and write access, the invoice's own status, and its currency. Then read the Gateway Log, which usually names the cause.

This guide follows the CoinStack module for WHMCS 8 and 9 and its troubleshooting documentation, checked in December 2026. The System URL, firewall and cron checks also apply to other WHMCS gateway modules that receive updates through a callback file.

Is the invoice actually stuck?

Start in the CoinStack dashboard, not in WHMCS. The module gives each checkout the reference WHMCS- followed by the invoice ID, and shows the invoice number as the checkout's description, so it is easy to find in the Checkouts list. Compare its status with the invoice.

Checkout status in CoinStackWhat WHMCS should showIs something wrong?
pendingUnpaidNo. Nothing has arrived at this checkout yet.
confirmingPayment PendingNo. A payment was detected and is being processed.
partialPayment Pending or UnpaidNo. The customer can send the rest to the same address.
expired, underpaidUnpaid, with what arrived recorded as a paymentNo. The customer can pay the balance from the invoice.
completed or resolvedPaidOnly if the invoice is not Paid. That is the case this guide is about.

If the customer insists they paid but the checkout is still pending, the problem is upstream of WHMCS. Get the transaction hash from the customer and check it yourself, following how to verify a crypto payment on a block explorer. The usual causes are a withdrawal the exchange has not sent yet, or a payment on the wrong network.

If the checkout is completed and the invoice is Unpaid, work through the checks below in order.

What does the Connection line say?

Open Configuration > System Settings > Payment Gateways and find CoinStack. Under the API key is a Connection line. Reload the page first, because it shows the result of the last attempt.

Connection lineMeaningNext step
"Connected. Payments made with CoinStack will mark invoices paid automatically."The module has registered its webhookGo on to the firewall check
"Connects within a few minutes of saving, the next time the WHMCS cron runs. Reload this page to check."It has not connected yetCheck the cron
Says the System URL must start with https://The callback address is not on HTTPSFix the System URL
"This API key was not recognized."The key is wrong or was deletedCreate and paste a new key
"This API key is read only."The key cannot register webhooksCreate a key with Read and write access

The connection is tied to both the key and the callback address. If you change either, by pasting a new key or moving WHMCS to a new domain, the module connects again the next time the cron runs.

Is the System URL on HTTPS with a valid certificate?

The System URL is under Configuration > System Settings > General Settings. The module builds its callback address from it, so it must start with https://, and the webhooks guide adds that a webhook URL must "use a domain name, not an IP address."

A valid certificate matters as much as the scheme. An expired certificate, or one issued for a different hostname, makes deliveries fail even though the URL looks right. If WHMCS lives in a subfolder, such as https://example.com/billing/, the System URL must include that folder, or the callback address points at a file that does not exist.

Can outside requests reach the callback file?

CoinStack sends payment updates as POST requests to modules/gateways/callback/coinstack.php under your System URL. Web application firewalls, bot challenges, request throttling and server security plugins sometimes block exactly this kind of request, because it arrives with no browser and no session.

Test it from a machine outside your network, not from the server itself, since many firewalls trust local traffic:

curl -i -X POST https://billing.example.com/modules/gateways/callback/coinstack.php \
  -H "Content-Type: application/json" \
  -d '{}'
ResponseWhat it tells you
200 with the body Ignored.The file is reachable and the gateway is active. The callback path is fine.
503 with Gateway not active.The file is reachable, but the CoinStack gateway is not activated in WHMCS.
404The module folders were not copied into the WHMCS root, or the System URL has the wrong path.
403, an HTML challenge page, or a timeoutSomething in front of WHMCS is blocking the request. Add an exception for this path.

The CoinStack dashboard gives you a second test. Under Developers you will find the webhook the module registered, pointing at your callback file. Send test posts a sample checkout.completed event and shows whether your server accepted it. The module answers a sample checkout it does not recognise with a 200, so a successful test confirms the path is open.

The module also makes outbound requests: when an update arrives, it reads the checkout's status from the CoinStack API before it touches an invoice. A Gateway Log error that starts Could not reach CoinStack means your server cannot make outbound HTTPS connections, or the PHP cURL extension is missing.

Is the WHMCS cron running?

Check Utilities > Automation Status. WHMCS's cron status guide shows a Warning when the cron ran before but "the system has not invoked it in the last 120 minutes (2 hours)", and an Error when it has never run.

The module relies on the cron in two ways. It makes the connection after you save the key. And on every run it re-checks each checkout created in the last 3 days that it still has on record as open, which is how it catches up on updates it missed.

That second job explains most long delays. If only the callback path is blocked, invoices are still marked paid at the next cron run. An invoice that stays Unpaid for hours usually has two problems at once (a blocked callback and a stopped cron), or one of these:

  • The checkout was created more than 3 days ago, so the cron no longer checks it.
  • The payment arrived after the checkout expired. The cron only re-checks open checkouts, so a late payment reaches WHMCS through the callback.
  • The invoice is no longer Unpaid (see below).

Does the API key still exist, with Read and write access?

The module needs a key with Read and write access, because it creates checkouts and registers its own webhook. According to the authentication reference, a read-only key "gets a 403 with Invalid permissions on every other endpoint, including all webhook and event endpoints."

A read-only key fails at the start: the Connection line says so, and customers who click Pay Now get an error message instead of the checkout page. The more common problem is a key that worked and then disappeared, because someone deleted it under Developers or tidied up old keys. Updates then fail with Invalid authentication, and the Gateway Log fills with "Payment update could not be processed" or "Scheduled status check failed" entries.

The fix is the same in both cases. Create a new key with Read and write access, paste it into the gateway settings, save, and wait for the next cron run. Open checkouts from the last 3 days are picked up on their own. For older ones, open Recent events under Developers in the CoinStack dashboard and resend their checkout.completed events. CoinStack makes 8 delivery attempts over about a day, then stops until you resend.

Is the invoice still Unpaid or Payment Pending?

The module records a payment only on an invoice that is Unpaid or Payment Pending. If the invoice was cancelled, either by hand or by Auto Cancellation in Automation Settings, or was paid another way, the module records nothing. The Gateway Log entry reads "Not recorded, invoice is" followed by the status, and the Activity Log (Configuration > System Logs) gets a note naming the checkout and the invoice.

The USDC is already in your wallet, so you have three ways to settle it:

  1. Reopen the invoice and resend the event. Set the status back to Unpaid in the invoice's Options tab, then resend the checkout.completed event from Recent events, and the module records the payment. On WHMCS 9.1, which according to its invoice management docs enforces immutability by default, the Options tab is not available on a Cancelled invoice unless immutability is disabled.
  2. Record it by hand on a new invoice, as described below.
  3. Refund the customer from your own wallet, or credit their account.

If Auto Cancellation keeps catching crypto payers, handling WHMCS renewals with crypto covers how to time it against your suspension days.

Is the invoice in a currency CoinStack accepts?

This one blocks payment rather than recording, but it lands in the same support queue. On an invoice in a currency outside CoinStack's 146 accepted currencies, the customer sees "This payment method is not available for this invoice." and the Activity Log names the invoice and its currency.

Set Convert To For Processing on the gateway to an accepted currency such as USD. WHMCS's payment gateway docs say the conversion uses the rates in your Currencies settings, so keep those current. If you later delete the currency chosen there, checkouts fail with "The currency chosen under Convert To For Processing no longer exists."

How do you read the Gateway Log?

Open Billing > Gateway Log. Each module entry lists the checkout ID, its status, the amount, the US dollar value, what was received, the fee, and whether the payment was underpaid, overpaid or late.

EntryMeaning
Payment detected, waiting for confirmationInvoice set to Payment Pending. Wait.
Partly paid, waiting for the restCheckout is partial. Nothing recorded yet.
PaidPayment recorded and invoice paid. May add "customer overpaid", or "paid after the rate lock", which the module writes when the checkout carries the late flag (paid after it expired).
Marked resolved in CoinStackYou accepted an underpayment. Remainder recorded.
Expired after a partial payment, recorded what arrivedInvoice stays Unpaid with a lower balance.
Checkout expiredExpired with nothing paid.
Not recorded, invoice is ...The invoice was not Unpaid or Payment Pending.
Payment update could not be processedAn update arrived but failed. The error field says why, and CoinStack retries.
Scheduled status check failedThe cron catch-up failed. Same error field.
Checkout could not be createdNo checkout was made when the customer clicked Pay Now. Usually the key or the currency.

No entry at all for a checkout that shows completed points to the callback path and the cron: nothing reached WHMCS.

When should you record the payment by hand?

When the causes are fixed and resending has not helped, or the original invoice cannot be reopened, use the invoice's Add Payment tab. WHMCS asks for "the date, payment method, transaction ID, and amount." Choose CoinStack as the method and use the checkout ID as the transaction ID, which is what the module itself uses, so your records match the dashboard. The CoinStack fee for the checkout goes in the fees field.

A later event cannot record the payment twice: the module skips invoices that are already Paid and logs that it did. A support playbook for crypto payment tickets has replies for the customer while you sort it out. If none of this explains it, write to [email protected] with your WHMCS version, the invoice number and the related Gateway Log entries. Setup itself is covered in how to accept crypto payments in WHMCS.

Frequently asked questions

How long should a WHMCS invoice stay on Payment Pending?

It depends on the network the customer paid on. Fast networks complete in seconds to a few minutes. Bitcoin adds a block about every 10 minutes on average, and a customer who chose a low wallet fee can wait longer. If the invoice goes back to Unpaid, the detected payment did not complete and the checkout expired. The Gateway Log and the checkout in the dashboard will show which.

Will resending a CoinStack event mark the invoice paid twice?

No. The module reads the checkout's current status from the CoinStack API, keeps track of what it has already recorded for each checkout, and records only on invoices that are Unpaid or Payment Pending. Resending an event for an invoice that is already Paid adds a Gateway Log line and changes nothing else.

I moved WHMCS to a new domain. Do I need to set up the webhook again?

No. Update the System URL. Because the connection is tied to the callback address, the module registers a webhook for the new address at the next cron run. The old webhook stays listed under Developers in the CoinStack dashboard and its deliveries will fail, so delete it there once the new one appears.

Why does the module check the CoinStack API instead of trusting the callback?

The callback only tells the module which checkout changed. The module then reads that checkout's status from the API before it touches an invoice, so a forged or replayed request cannot mark an invoice paid. The same check runs on the cron and when the customer returns from the checkout page.

More posts