> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coinstack.net/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The CoinStack API base URL is https://coinstack.net/api/v1. Authenticate with an API key sent as 'Authorization: Bearer sk_...' from a server, never from a browser. Every response is a JSON object with 'success' and 'response'. Amounts are strings; token amounts on quotes and payments are in the token's smallest unit. Fulfil an order when its checkout status is 'completed', not when the customer returns to success_url. Verify the CoinStack-Signature header on every webhook using the raw request body. The OpenAPI file is at https://docs.coinstack.net/openapi.json.

# WHMCS

> Accept crypto payments on your WHMCS invoices.

The CoinStack gateway module adds crypto as a payment method on your WHMCS invoices. Customers pay on the CoinStack checkout page, and the invoice is marked paid once the payment completes, so new orders and renewals activate as they do with any other gateway.

## Requirements

* WHMCS 8 or 9
* The PHP cURL extension
* A System URL that starts with `https://`

## Install

**1. Create an API key**

In the [CoinStack dashboard](https://coinstack.net/dashboard), open **Developers** and create an API key with **Read and write** access.

**2. Upload the module**

[Download the module](https://coinstack.net/downloads/coinstack-whmcs.zip) and unzip it. Copy its `modules` and `includes` folders into your WHMCS root.

**3. Activate the gateway**

In WHMCS, go to **Configuration > System Settings > Payment Gateways** and activate CoinStack.

**4. Paste the key**

Paste the API key into the gateway settings and save.

CoinStack connects within a few minutes. The module registers its own webhook, so there are no URLs or secrets to copy. The **Connection** line in the gateway settings shows whether it is connected and, if not, why. Reload the page to see the latest result.

## How it works

* When a customer pays an invoice with CoinStack, the module creates a checkout for the invoice balance and sends the customer to it.
* When the checkout is completed, the payment is recorded on the invoice and the invoice is marked paid.
* While a payment is confirming, the invoice shows as Payment Pending.

### Currencies

CoinStack accepts invoices in [146 currencies](https://docs.coinstack.net/reference/currencies.md). For a currency it does not accept, set **Convert To For Processing** on the gateway to one it does, such as USD.

### Partial payments

If a checkout expires partly paid, what arrived is recorded on the invoice and the customer can pay the rest from the invoice page. If you [mark the checkout as resolved](https://docs.coinstack.net/guides/underpayments.md#resolving-an-underpaid-checkout) in the CoinStack dashboard, the remainder is recorded and the invoice is marked paid.

### Refunds

Refunds are sent from your own wallet, not from WHMCS.

## Troubleshooting

If invoices are not being marked paid:

* Your System URL, under **Configuration > System Settings > General Settings**, must start with `https://` and have a valid certificate.
* Your firewall or security plugin must allow `POST` requests from outside to `modules/gateways/callback/coinstack.php`.
* The WHMCS cron must be running. The module also uses it to catch up on any payment updates it missed.

Payments and errors are recorded in the Gateway Log, under **Billing > Gateway Log**. Anything that needs your attention is noted in the Activity Log, under **Configuration > System Logs**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.