Payme is a payment service in Uzbekistan. Customers pay with Uzcard or Humo cards on the Payme payment page or in the Payme app. Payments are accepted in Uzbek soums (UZS).

Payme works differently from most payment systems: before charging the customer, it contacts MaviBot to check that the order exists and the amount is correct. That is why connecting Payme takes two parts: entering your keys in MaviBot and adding the MaviBot address to your Payme cashbox settings.

Connecting Payme

Obtaining Cashbox Credentials

  1. Sign an agreement with Payme and log in to your Payme Business account.
  2. Create a web cashbox.
  3. In the cashbox settings, open the developer parameters and copy the following values:
Payme MaviBot Field
Cashbox ID (Merchant ID) Cashbox ID (Merchant ID)
Key Cashbox key (Key)

The same section shows a second key, TEST_KEY. It is only needed for sandbox testing, see Test Mode.

Connecting Payme in MaviBot

Open Acquiring in your project, select Payme, and fill in the following fields:

Field Description
Cashbox ID (Merchant ID) Identifier of your Payme web cashbox. Used to generate payment links.
Cashbox key (Key) Key of the web cashbox. MaviBot uses it to verify that a request comes from Payme. Without it, payments are not confirmed.
Test mode Enables payments in the Payme sandbox without charging real funds. Disable this option to accept real payments.

Save the settings. The same window shows:

  • Endpoint URL — the address of your project that must be added to the Payme cashbox (next step);
  • the words the bot receives after a payment and after a failure (see Payment Callbacks). They appear after the first save.

The Payme card is shown to projects whose country is set to Uzbekistan.

Configuring the Payme Cashbox

In the web cashbox settings in Payme Business:

  1. Paste the address from the MaviBot connection window into the Endpoint URL field. It looks like this:

    https://chatter.mavibot.ai/payme_callback/123456
    

    where 123456 is your project number. Copy the address with the button in the connection window instead of typing it.

  2. Add an account field named order_id.

  3. Choose the one-time account type.

Important! Without the Endpoint URL and the order_id field, Payme cannot check the order, and the payment page will show an error.

Use the following Calculator function:

get_payme_payment_url(amount, description, language)

Parameters

Parameter Required Description
amount ✅ Payment amount in soums.
description No Payment description.
language No Payment page language: ru, uz or en. Default: ru.

The function returns a payment URL. Save it to a variable and send it to the customer.

Example

A link for 150,000 soums with the payment page in Uzbek:

pay_link = get_payme_payment_url(150000, "Kurs", "uz")

If the link is not created, the function returns an empty value, and the error text is saved to the error_payment_func variable.

Example 1. You can insert the payment link directly into the message text.

Example 2. You can add the payment link to a button.

This example is useful if you need to set dynamic pricing based on customer types or discounts.

Alternatively, you can create a button with the Billing type, as described below. In this case, the payment amount is fixed.

Notes

  • The currency is always UZS. The function has no currency parameter.
  • One link is one payment. After a successful payment the same link cannot be paid again; generate a new link for each new payment.
  • Payme cancels an unpaid payment 12 hours after the customer started it. After that the customer can start the payment again with the same link.

To send a payment button:

  1. Create a button with the payment type in a block.
  2. Select Payme as the payment system.
  3. Specify the product name and the amount in soums.

Store, Landing Pages and Courses

In the payment settings of a store, a landing page or a course plan, select Payme in the list of payment systems.

Payment Callbacks

When Payme completes a payment, a service message is sent to the dialog with the customer.

Successful Payment

peazs1czv9_success 150000

Where:

  • peazs1czv9 — the word of your project. It is shown in the Payme connection window in MaviBot and does not change when you replace the key;
  • 150000 — the payment amount.

Set up a block that reacts to this message to grant access or confirm the order. To react to any amount, use only the beginning of the message without the amount.

Failed or Cancelled Payment

peazs1czv9_fail 150000

Sent when Payme cancels an unpaid payment: the bank declined it, the customer interrupted the payment, or the time ran out.

Returning from the payment page to the bot does not confirm the payment. Grant access only on the _success message.

Customer Variables After a Payment

Variable Description
payme_payment_completed True if the payment was completed, False if it was cancelled.
payme_order_id Payment number in MaviBot.
payme_transaction_id Transaction number in Payme.
last_payment_sum Amount of the last payment.
payme_refunded True if the payment was refunded from the Payme account.
payme_refund_amount Refund amount.

Refunds

Refunds are made in the Payme Business account. MaviBot is notified and saves the
payme_refunded and payme_refund_amount variables. No _fail message is sent for a refund.

Test Mode

You can test your flow without real charges.

  1. In MaviBot, enable Test mode and enter the cashbox TEST_KEY in the key field instead of the production key.
  2. Generate a payment link: it opens the Payme sandbox page.
  3. After testing, disable test mode and enter the production key.

Limitations

  • UZS only.
  • Recurring payments and subscriptions are not available with Payme.
  • MaviBot does not send fiscal receipt data (IKPU codes) to Payme.