# Coinpayments

* [Как подключить](#podklyuchenie) ссылка How to connect
* [Как сформировать ссылку на оплату](#kak-sformirovat-ssylku-na-oplatu) ссылка How to generate a payment link
* [Как обработать результат](#obrabotka-rezultata) ссылка How to process the result
* [Как проверить статус платежа](#proverka-statusa-platezha) ссылка How to check the payment status

## How to connect

To connect the Coinpayments payment system, you will need four values: the seller ID, the IPN secret (for webhooks), the API private key, and the API public key. You will also need to set the webhook URL.

Go to the personal account of Coinpayments -> Account settings <https://www.coinpayments.net/index.php?cmd=acct_settings>

![](https://lh3.googleusercontent.com/xACTDovKtHxhj7vrWkS0u2TpAy_mK1VU7fR7k2KAD_6lL9OHyKsn4Np54iD4jb7Gjackry858WfaABz37i6tkfn5HZW94n4SKqDq3ooRToxaeXQPRbhvgnKG-KrAssSlHy2lrSSQ)

On the first tab, copy the seller's ID. (**seller ID**)

![](/files/jPDoX1x7g1eqLtS08NUq)

Next, go to the "Seller Settings" tab and create and enter an IPN secret key  - **IPN secret** ( This is used to verify that the webhook is coming from us). Use a secure, complex string that is hard to guess

IPN link - is the URL for webhooks, add the following: **<https://chatter.salebot.pro/coinpayments\\_callback/result>**

![](https://lh6.googleusercontent.com/K939LTpXmntuJKU1tTN6NTBgl2ziiQTG7okWMRAdOMMQa0K7LbH0X3l7FWmd74FPqY9NOOGl89tbK99fgCpFLva4NJ8VVZVwwGfaE9YYKQ5EOkkb72Qz3FO5jPisxWxrAX8Ac94p)

Next, go to the API Keys section and generate a key pair to access the API.

![](https://lh6.googleusercontent.com/4Y9V4YRgYAvMJNelxlO5bhynVt1er0a5F-QNnOitbBrWFfOLPwJpOM8BHKgMcXxlKzwE9rc32Coxo-iVB_kvGRrgf0XXEjSsop5Uic8CP-8ey8Ll7a_CkvB7D3tcpcEgUo0Dbz7N)

Save all the settings, copy the data and go to the settings in Mavibot. Open the "Acquiring" section, select Coinpayments.

<figure><img src="/files/GdhNFSn5tfDn4WSSv1Ca" alt=""><figcaption></figcaption></figure>

You need to enter the received data.

<figure><img src="/files/1RmVaSKSGL6nyK8HdNyZ" alt="" width="563"><figcaption></figcaption></figure>

To generate a payment link, you need to set the value of the required variables:

<table><thead><tr><th width="201">Variables</th><th width="228">Value of variable</th><th>Note</th></tr></thead><tbody><tr><td> <strong>original_currency</strong> </td><td>The original currency of the transaction.</td><td></td></tr><tr><td><strong>sending_currency</strong></td><td>The currency that the customer will send.</td><td>For example, if your products are priced in USD, but you receive BTC, you should use original_currency = USD and sending_currency = BTC. original_currency and sending_currency can have one value if currency conversion is not required.</td></tr><tr><td><strong>buyer_email</strong> </td><td>Customer's email address.</td><td>To send notifications if the payment is for a lower amount and needs to be paid extra, or for refunds. If this variable is not set, the mail will be taken automatically from the email variable, if the user has one in Mavibot.</td></tr></tbody></table>

After that, you need to set the value of the **payment\_sum** variable (for example, 10 or 0.0055 **(separated by a dot!)),** and the **coinpayments\_pay\_url** variable will appear immediately after that. This variable can be displayed with a link or placed on a button with the text "Pay". The link looks like: **<https://www.coinpayments.net/index.php?cmd=checkout\\&id=CPFK5QZ3FKSNWHI75CO8M4BRVD\\&key=e7782d2ce24f7d03815606a5c4a882eb>**

Also, before setting the value of the payment\_sum variable, you can set the following optional variables to configure the payment.

**payment\_description** - the product name will be on the payment information page and in the IPN for the transaction.

**buyer\_name** - customer's name

This is what the payment page looks like.

![](https://lh3.googleusercontent.com/Yn1a6_JOW4wkj2SqNwkkJYMBZoh4JcR1HEinzP67O6WmYBcCV3IdRw_JCEQI0L7OV-8IuH_JdMEdOaduymc0vs5QAmpfcgrU0tFD9ZrT6V_B8vvQqe-sQcUDMsd9PJRa_uUsJAsX)

## How to generate a payment link

Create a payment link in the amount of 0.0256

<figure><img src="/files/ZNxSBA8QtUzx9jLlSu0y" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
**Pay attention:** \
\- First, specify the email address\
-Next optional parameters  **first\_name, payment\_description** and ect.\
\- Finally, assign a value to the **payment\_sum** variable.
{% endhint %}

Please note that we first set the variables for the settings, then **payment\_sum.** Variables can be set earlier in the chain, rather than in a single block, this is an example.

Next, we output the **coinpayments\_pay\_url** variable in the right place, which contains the link

<figure><img src="/files/0PlRhOhxdCfcWIkb6fwT" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %}
To make a repeat payment, you need to reset the payment\_sum, the previously generated link, and then reassign the payment\_sum variable to get a fresh link.
{% endhint %}

## How to process the result

After a successful payment, callbacks will be sent to the bot, which will let you know that the payment was successful. You see these callbacks in the system as messages from the user. To prevent the user from sending them, they consist of the first 10 characters of the secret key and the postscript \_success, for example: **16831CF4b5\_success**

{% hint style="success" %}
These callbacks are NOT VISIBLE TO the user, they are displayed only to the operator.
{% endhint %}

{% hint style="danger" %}
The type of comparison should be "Complete Match"
{% endhint %}

Also, after successful payment, the coinpayments\_payment\_completed variable is set to True.

For example, you can process a successful payment in a conditional block and display the corresponding message to the user:

<figure><img src="/files/3MA93aQt0H6IW4pg1fTC" alt=""><figcaption></figcaption></figure>

After the payment is completed, the **coinpayments\_payment\_callback** variable will be added to the client, containing the data of the payment system's response to the completed transaction. You can extract the required data from the resulting dictionary using the **get** method.

## How to check the payment status

To check the payment status, use **coinpayments\_get\_payment\_status()** method in the Calculator field.

Example:

<figure><img src="/files/2YdXOEhG1hPVmHmyMZpb" alt="" width="563"><figcaption></figcaption></figure>

> **Status example**:
>
> Waiting for buyer funds...
>
> Funds received and confirmed sending to you shortly…
>
> Complete


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavibot.ai/payment/coinpayments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
