# Coinpayments

* [How to connect ](#how-to-connect)
* [How to Create a Link to Payment ](#how-to-create-a-link-to-payment)
* [How to process the result ](#how-to-process-the-result)
* [How to check the payment status](#how-to-check-the-payment-status)

## How to connect&#x20;

To connect the payment system Coinpayments will need 4 values: seller ID, IPN secret (for webhooks), private api key and public api key, as well as to set the webhook url.&#x20;

Go to Coinpayments account -> Settings&#x20;

<https://ww.coinpayments.net/index.php?cmd=acct_settings>

![](/files/LO7VBy01zP4Yiofn4FGq)

On the first tab, copy the seller ID **(seller ID)**

Then go to the Settings tab of the seller and come up with and enter the secret key IPN - IPN secret (This is used to confirm that the webhook comes from us, use a reliable complex string that will be difficult to guess.)&#x20;

**Link IPN** - url address for webhooks, add the following: <https://chatter.salebot.pro/coinpayments_callback/result>

Then go to the **API Keys** section and generate a key pair to access the api.

![](/files/5PXficX1kgywRloh1IxI)

**Save** all the settings, copy the data and go to the settings in Salebot. Open the section on payment systems, select **Coinpayments**.

&#x20;                                            ![](/files/MvNMf4eWw0m6naas0qkF)

We need to input the data.

![](/files/oH9he6IBzjAR0wVqnkxy)

To generate a link to payment, you need to set the value of the required variables: **original\_currency** - Original currency of the transaction. **sending\_currency** - Currency sent by the buyer. For example, if your products are priced in USD but you get BTC, you should use original\_currency = USD and sending\_currency = BTC. original\_currency and sending\_currency may have the same value if currency conversion is not required.

**buyer\_email** is the buyer’s email address. To send notifications if the payment is less and you need to pay extra or for returns. If this variable is not specified, mail will be taken automatically from the email variable, if the user has one in salebot.&#x20;

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

Also, before setting the payment\_sum value, you can specify the following optional variables to configure the payment.&#x20;

**payment\_description** - the name of the product, will be on the payment information page and in the IPN for the transaction.&#x20;

**buyer\_name** - the name of the buyer&#x20;

## How to Create a Link to Payment&#x20;

Create a link to the payment of 0.44444

&#x20;                                ![](/files/DaNp1xDgBvz5OTcwBFvm)

{% hint style="info" %}
Please note:

* First specify the email
* Next optional parameters **first\_name, payment\_description**, etc.
* And last, assign the value of the **payment\_sum** variable
  {% endhint %}

Note, first we set the variables for the settings, then payment\_sum. You can define variables earlier in a chain, not in a single block, this is an example.&#x20;

Next, at the right place, print the variable **coinpayments\_pay\_url** that contains the link

&#x20;                                              ![](/files/JRMNcszCfDcEycARJXZN)

{% hint style="warning" %}
To make a repeat payment, you must reset payment\_sum, the previously generated link, and after you reset the payment\_sum variable to get a new link
{% endhint %}

## How to process the result&#x20;

After successful payment in the bot will come kolbeks, on which you can understand that there was a successful payment. These colbecks in the system you see as messages from the user, so that they can not be sent by the user, they consist of the first 10 characters of the secret key and a notation \_success, for example: 16831CF4b5\_success

{% hint style="success" %}
These colbecks DO NOT SEE the user, they are displayed only to the operator.
{% endhint %}

{% hint style="danger" %}
The type of comparison should be "Full match"
{% endhint %}

Also after successful payment, the variable coinpayments\_payment\_completed is set to true&#x20;

For example, you can make a successful payment processing block with a condition and print the corresponding message to the user:

&#x20;

![](/files/IY1drU6YnqcFaHsj5uKZ)

Upon completion of payment, a **coinpayments\_payment\_callback** variable will be added to the client, containing the payment system response data for the completed transaction. You can extract the necessary data from the dictionary using the **get** method.

## How to check the payment status&#x20;

To check the payment status, you need to call **coinpayments\_get\_payment\_status()** in the Calculator field&#x20;

Example:

&#x20;                                           ![](/files/5JsnGpdWPUT2RRfWWDcU)

&#x20;                                          ![](/files/Lk88JB8Wzcq9RRSFSOqF)

Examples od the statuses:

*Waiting for buyer funds...*&#x20;

*Funds received and confirmed sending to you shortly…*&#x20;

*Complete*&#x20;


---

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