How to Configure Robokassa
Let’s look at how to accept payments in a bot through the Robokassa service.
- Create an online store in your Robokassa account and specify the following technical settings:
- Hash calculation algorithm:
MD5 - Result URL: https://chatter.mavibot.ai/robokassa_callback/result
- Data submission method for Result URL:
GET - Success URL: https://chatter.mavibot.ai/robokassa_callback/success
- Data submission method for Success URL:
GET - Fail URL: https://chatter.mavibot.ai/robokassa_callback/fail
- Data submission method for Fail URL:
GET

Create test passwords and perform the initial setup in test mode.
How to Connect Robokassa to MaviBot
Go to the Acquiring section and click Connect on the Robokassa card:

Fill in the form in the window that opens:
- Store ID — the Shop ID, which you can find in the store settings in your Robokassa account.
- Password #1 and Password #2 — unique generated sequences of letters and numbers.
- VAT rate — specify the appropriate code for transferring the VAT value. This field sets the tax rate in the cash register. It is determined separately for each type of product, but applies to all units of that particular product together.
Available values:
- No VAT.
- VAT at 0%.
- VAT at 5%.
- VAT calculated at 12%.
- VAT calculated at 16%.
How to Generate a Payment Link
You can generate a payment link in a block using ONE OF the available methods:
- A button with the Payment function, or
- The
get_robokassa_payment_urlfunction in the Calculator, or- Generating a link using the
payment_sumvariable and additional parameters — a deprecated but still functional method.
Payment Button
You can generate a payment link using a button with the Payment function.
Learn how to create a button with the Payment function here.
Let’s review all available button parameters.
Required Payment Button Parameters
To generate a payment link, specify the following required parameters in the button settings:
- Amount
- Product name

Amount — specify the product price in rubles.
Product name — this field may contain only English or Russian letters, numbers, and punctuation marks. The maximum length is 100 characters. This information is displayed in the Robokassa interface and in the electronic receipt received by the customer after successful payment.
DO NOT use double quotation marks in the product name. Remove them or replace them with single quotation marks.
Automatic payment checkbox — enables recurring payments.
Click notification checkbox — enables tracking of clicks on the payment link. If enabled, a notification about the click will appear in the client conversation in MaviBot.
You can configure further bot logic based on this notification.
Many payment systems support cloud-based online cash registers required under Federal Law No. 54-FZ.
Review the receipt requirements on the website of your selected payment provider to avoid issues with the tax authorities.
Receipt Data
Open the Receipt data menu to display the receipt parameters:

Product name — required for generating a receipt.
DO NOT use double quotation marks in the product name. Remove them or replace them with single quotation marks.
Total amount in rubles — specify the total payment amount based on the product quantity. If the quantity is 1, the total amount in rubles is equal to the value entered in the required Amount field.
Quantity — the quantity or weight of the product. You can pass an integer or a decimal number using a dot, for example:
5
or
10.3
Client Variables Created Automatically When Using a Payment Button
As soon as the user receives a block containing a Payment button, the following client variables are created automatically:

The service client variable:
__payments
stores the payment amount and the identifier of the generated payment link. It is required to identify the webhook received from the payment provider.
The
__paymentsservice variable MUST NOT be deleted or modified.
The client variable:
error_payment_button
is created if an error occurs while generating the payment button.
The value of error_payment_button will contain either the error text or the error response returned by the payment provider.
Variable values become current after the user moves to the next block.
How to Process the Result
Please note
Robokassa sends notifications only for successful transactions through the Result URL.
Robokassa does not provide callbacks for unsuccessful payments.
The Fail URL is only the unsuccessful-payment page to which the payer is redirected if an error occurs on the payment page.
Successful Payment
After configuring the payment correctly and generating the payment link, test the setup.
If the payment is successful, a callback will be sent AUTOMATICALLY to the client conversation in the Clients section.
The callback consists of:
- 10 characters of the payment provider’s secret key;
- the word
_success; - the payment amount after a space.
The callback is generated automatically. You do not need to create it yourself or request it from the payment provider’s support team.


Example:
ovg58keefc_success 2999
Where:
-
ovg58keefc— 10 characters of the payment provider’s secret key; -
_success— the request processing result indicating a successful payment; -
2999— the payment amount.
Block execution:

Callback:

Payment provider callbacks are NOT VISIBLE to the user.
They are displayed only in the Clients section and are visible to the operator or administrator.
Example of Configuring a Callback Response
In a conditional block, such as a Start condition block or a Non-state with condition block, specify the callback received after payment.
Select either Exact match or Contains keywords as the matching type.

After payment, the customer will receive the message from the block configured to respond to the callback:

Payment Amount Error
If the amount specified in the button settings differs from the amount paid by the customer, the bot will automatically receive a callback consisting of:
- 10 characters of the payment provider’s secret key;
-
_different_amounts; - the unique payment ID after a space.
Example:
ovg58keefc_different_amounts 123456
Where:
-
ovg58keefc— 10 characters of the payment provider’s secret key; -
_different_amounts— indicates that the paid amount differs from the amount in the payment link; -
123456— the unique payment ID.
get_robokassa_payment_url Function in the Calculator
You can generate a payment link using the get_robokassa_payment_url function in the block Calculator.
In the Calculator field, assign the result of the get_robokassa_payment_url function to a variable.
You can choose the variable name yourself. The screenshots show example variable names.
The payment link will be saved in this variable.
You can display the variable as a link in a message or place it in a button with text such as Pay.
Example payment link:
https://auth.robokassa.ru/Merchant/Index.aspx?MerchantLogin=test_salebot&OutSum=800&InvId=1412&IsTest=1&SignatureValue=0427369c3bd068bae30935f896060dda
Many payment systems support cloud-based online cash registers required under Federal Law No. 54-FZ.
Review the receipt requirements on the website of your selected payment provider to avoid issues with the tax authorities.
Calculator
Example 1:

Parameter Description
get_robokassa_payment_url(amount, description, products_for_receipt, recurrent, currency)
Function Parameters
| Parameter | Description |
|---|---|
amount |
Payment amount. Specify the product price in rubles. Required parameter. |
description |
Product name. This field may contain only English or Russian letters, numbers, and punctuation marks. The maximum length is 100 characters. This information is displayed in the Robokassa interface and in the electronic receipt received by the customer after successful payment. Required parameter. |
products_for_receipt |
Receipt generation parameters. Read more here. |
recurrent |
Enables recurring payments. Pass 1 if recurring payments are enabled, or None if they are disabled. |
currency |
Three-letter currency code. The value must strictly match the parameters accepted by Robokassa.USD — US dollar;EUR — euro;KZT — tenge. |
Code Examples
Example 1: Payment Link Without a Receipt
res = get_robokassa_payment_url(100, 'Buy me')
Example 2: Payment Link With a Receipt
receipt = [{"name":"DDDDDDDD","amount":"44","quantity":"1","vat_code":"5","method":"full_payment","object":"commodity"}]
res = get_robokassa_payment_url(100, 'Buy me', receipt, '3', 1, 1)
You can display the variable as a link in a message or place it in a button with text such as Buy.
If the block contains several payment-link functions and an error occurs, the error value will be saved in the variable:
error_payment_funcThe error from the last function in the Calculator will be saved.
After configuring the payment correctly and generating the payment link, test the setup.
How to Add a Payment Description
You can add a payment description by setting the variable:
payment_description

The description will be displayed on the payment form and on the receipt.
How to Process the Result
If the payment is successful, a callback will be sent AUTOMATICALLY to the client conversation in the Clients section.
The callback consists of:
- 10 characters of the payment provider’s secret key;
-
_success; - the payment amount after a space.
The callback is generated automatically. You do not need to create it yourself or request it from the payment provider’s support team.
Example:
ovg58keefc_success 1500
Where:
-
ovg58keefc— 10 characters of the payment provider’s secret key; -
_success— the request processing result indicating a successful payment; -
1500— the payment amount.
Please note
The callback is visible only to you in the client conversation.
The callback is not visible to the customer, but you can configure a response to a successful payment.
Example
Settings of a block using the get_robokassa_payment_url function:
1. Displaying the Link in the Message Text

Important
The payment link is unique. You must not copy it and send it to other customers.
Send the payment link through a variable in the bot.
Callback after successful payment:

2. Displaying the Link in a Button

Block execution:

Callback after successful payment:
