> ## 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.

# Blesta

> Accept crypto payments on your Blesta invoices.

The CoinStack gateway adds crypto as a payment method on your Blesta invoices. Customers pay on the CoinStack checkout page, and the payment is applied to their invoices once it completes, so new orders and renewals activate as they do with any other gateway.

## Requirements

* Blesta 6 or newer
* The PHP cURL extension
* A Blesta address 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 gateway**

[Download the gateway](https://coinstack.net/downloads/coinstack-blesta.zip) and unzip it. Copy its `components` folder into your Blesta root.

**3. Install it**

In Blesta, go to **Settings > Payment Gateways > Available** and install Crypto (CoinStack).

**4. Paste the key**

Paste the API key, choose the currencies to accept, and save.

CoinStack connects when you save. The gateway registers its own webhook, so there are no URLs or secrets to copy. If it cannot connect, the settings are not saved and the page shows why.

## How it works

* When a customer chooses to pay with crypto, the gateway creates a checkout for the amount they are paying and shows a **Pay with crypto** button that takes them to it. A customer can pay several invoices with one checkout.
* When the checkout is completed, the payment is recorded as a transaction and applied to the invoices.
* While a payment is confirming, the transaction shows as pending.

If the customer leaves and comes back to pay the same amount, they are sent to the checkout they already have, as long as it is still open.

### Currencies

CoinStack accepts invoices in [146 currencies](https://docs.coinstack.net/reference/currencies.md). You choose which of them the gateway is offered for in its settings.

### Partial payments

If a checkout expires partly paid, what arrived is recorded and applied to the invoices, and the customer can pay the rest from the client area. 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 applied as well.

### Refunds

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

## Troubleshooting

If you change the address of your Blesta installation, save the gateway settings again so CoinStack sends payment updates to the new address.

If invoices are not being marked paid:

* Your Blesta address must start with `https://` and have a valid certificate.
* Your firewall or security plugin must allow `POST` requests from outside to `callback/gw/`.

Payments and errors are recorded in the gateway log, under **Tools > Logs > Gateway**.


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