# Wallet pay

<figure><img src="/files/DX7JvRpGESDX1QAtoNqK" alt="" width="319"><figcaption></figcaption></figure>

## Connecting the payment system

### Connecting on Telegram side

**Step 1.** Log in to your partner account

{% hint style="info" %}
[To do this, follow the link](https://pay.wallet.tg/)
{% endhint %}

On the page that opens, click "Log in via Telegram", then enter your phone number in the pop-up window "Appears oauth.telegram.org " and click "Apply".

It is necessary to connect the payment system both through the web browser and through the application:

* You will receive a Telegram message requesting authorization - click **"Apply".**
* You also need to click "Apply" in the pop-up window **"oauth.telegram.org " in a web browser.**

{% hint style="success" %}
It is recommended to use an account that the person in charge of finance has access to. For legal entities – an authorized representative.
{% endhint %}

**Step 2.** Take a small survey

<figure><img src="/files/5UzIOoZqzA1piW88GGn2" alt=""><figcaption><p>Pic. 1. Filling in information about the merchant</p></figcaption></figure>

If you are logging in for the first time or you need some additional information, WalletPay offers you to answer a few questions to get more detailed information. There are two steps:

#### 1. Questionnaire

#### 2. KYB (Know Your Business) or KYC (Know Your Customer) checks

After completion, your application will be reviewed soon and you will be notified of the results. If successful, you will see the commission charged by the service and get access to your account where you can start integration.

{% hint style="warning" %}
For legal entities, the form can only be filled out by a trusted person: a director or an employee by proxy.
{% endhint %}

**Step 3.** *Create the first "Store".*

After completing the "Survey" successfully, you will be suggested to create your first store.

**Step 4.** *Create an "API key"*

After the name of the first store, you will be suggested to set it up:

* Generate  API key.
* Copy your API key and start integrating with Mavibot.

**Step 5**. *Create an order and receive a payment link*

If you want to put a link in a button, use **Inline Button.**

Please note that only the specified "customerTelegramUserId" can open the payment page.

**Step 6.** *Withdraw funds*

After the client confirms the payment, the funds are credited to your assets and are held for 48 hours by default. After this time, you will be able to withdraw funds to the balance of your Wallet, which you used to log into the Paypal Wallet service.

**Step 7.** *Return of funds*

Currently, withdraw funds are available from your Wallet account, which you use to log in to WalletPay. But it will be available in your Merchant account soon.

### What the payment button look like?

When integrating your Telegram Bot with the "Wallet Pay API", make sure that the payment button complies with the following recommendations:

1. Named as one of two ways:

* :purse: Wallet Pay
* :purse: Pay via Wallet

2. Located above the other buttons (if you have any).

> Note. :purse: — это смайлик (see <https://emojipedia.org/purse/>).
>
> See the example in \[[Demo Store Bot](https://t.me/PineAppleDemoWPStoreBot)].

## Connecting to Mavibot

Log in to the project and click the **“Connect”** button for Wallet Pay in the “Payment systems” section.

<figure><img src="/files/yuZXsyxON9RfBTnDDv64" alt=""><figcaption><p>Pic. 2. The "Acquiring" section for connecting the service to Mavibot</p></figcaption></figure>

In the window that opens, enter the API key generated for your WalletPay store.

<figure><img src="/files/Wn3Q4QdplVO5NhipVST6" alt=""><figcaption><p>Pic. 3. A form with API key input field</p></figcaption></figure>

* [x] Ready! Now customers can pay for purchases in your store in cryptocurrencies (USDT, Toncoin and Bitcoin) using the Paypal Wallet service.

### How to generate a payment link

Create a funnel constructor block and call the **“wallet\_pay\_generate\_payment\_url”** function in the calculator, passing the necessary parameters to it:

| Parameters           | Parameters description                                                                                    |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| **amount**           | the amount of the payment in cryptocurrency or other fiat currency available for conversion to “TON”.     |
| **сurrency\_code**   | The default payment currency is “RUB". List of available currencies: "TON" "BTC" "USDT" "EUR" "USD" "RUB" |
| **description**      | a short description of the order from 5 to 100 characters.                                                |
| **timeout\_seconds** | The link's validity period is in seconds, the default is 3600 seconds.                                    |

<figure><img src="/files/u0VJnAqAIIYUu78emKLl" alt=""><figcaption><p>Pic. 4. Example of parameter transmission</p></figcaption></figure>

When the block is triggered in a chat with a bot, the client will receive a payment link, and the **wallet\_pay\_payment\_completed** client variable will be created with the value <mark style="color:red;">**False.**</mark>

{% hint style="warning" %}
This link can only be opened in a chat with a bot connected to a WalletPay billing account.
{% endhint %}

### Payment verification

After successful payment, the client's **wallet\_pay\_payment\_completed** variable will set to <mark style="color:green;">**True,**</mark> and the seller will receive a callback in the form of **4690FE98\_success**, which consists of:

* “4690FE98” - these are the first 8 characters of the Wallet Pay API key.
* слова об успешно

<mark style="color:red;">**!**</mark> if there is a payment error, you will receive a **callback** with the suffix “<mark style="color:red;">**\_fail**</mark>”.

Address for notifications (callbacks): <https://chatter.salebot.pro/wallet_pay/payment_callback> - inserted into the payment system settings

A callback can be embedded in the block condition to send a message to the client about a successful payment (or a payment error):

<figure><img src="/files/L7SlhKkIVGwGFlnXWnJa" alt=""><figcaption><p>Pic. 5. An example of the reaction to a callback in the "Starting condition" block</p></figcaption></figure>

<figure><img src="/files/6nMzQOdKNqqbwa4LKxyp" alt=""><figcaption><p>Pic. 6.An example of a response to a callback in the "Non state condition" block</p></figcaption></figure>

{% hint style="info" %}
If you do not want to knock the client out of the main chatbot scheme, use the "Non state condition" block. You cannot go to this block, so the client will not be knocked out of the main funnel after payment and will receive a notification of successful payment.\
​омление об успешной оплате.

And if you need to continue the funnel with a reaction to a successful payment, then use the "Start condition" block, then the client will move from the payment block to the "Start condition" block, from which you can continue the funnel.
{% endhint %}

{% hint style="info" %}
More information about conditional blocks is provided in the article of the same name. ссылка[блоках с условием рассказали](broken://pages/VktePfPMzzJlbjBSqE93)&#x20;
{% endhint %}

### Useful links

\[[Wallet Pay Business Support](https://t.me/WalletPay_supportbot)]

\[[Demo Store Bot](https://t.me/PineAppleDemoWPStoreBot)]

\[[Merchant Community](https://t.me/+6TReWBEyZxI5Njli)]


---

# 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/wallet-pay.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.
