📜 ⬆️ ⬇️

T-commerce: how online sales work with Telegram

Telegram released a new payment-enabled API last summer. Since then, the messenger has become a sales channel, which allows companies not only to communicate with the client, but also to accept payment for their goods and services directly in the dialog box. Yandex.Cassa was the first among Russian payment services to support this feature. Individual entrepreneurs and small organizations immediately began to accept payments to Telegram through the Cashier: florists, tea and coffee shops, coaches, organizers of training courses, charitable foundations and many others ( here you can read reviews and examples). But for larger companies with a stream of orders was one stopper.


The fact is that until recently, Telegram-sales had one feature that did not take into account purely Russian specifics of electronic commerce — the mandatory sending of online checks (the 54- requirement, known as the law on online cash registers ). Yandex.Cash immediately appeared a special protocol that supported the work with the new cash equipment and automated transfer of checks. But in Telegram such automation was not technically supported, and sellers had to set up the transfer of checks themselves (consider dancing with a tambourine). And recently, the messenger went to meet the Russian e-commerce market and implemented a joint project with Yandex.Money, adding an important element to its protocol - a special field appeared for additional information to the payment provider. Now selling via Telegram has become convenient from the point of view of not only the client service, but also the automation of the transfer of online checks (that is, compliance with 54-FZ). Under the cut, I'll tell you what to do to launch sales in a Telegram, accepting payments through Yandex.Cass.


How does the telegram payment process look like?


If you have not had to buy anything via the messenger, the sales scenario may not be obvious. In some cases, the sale begins on the site, and ends in the Telegram. In others, all customer service goes through Telegram-bot. Here is how it will look step by step:


  1. The buyer puts the product on the store site into the basket, and at the payment stage selects a payment via Telegram (the second option is when the customer initially selects a product or service using a Telegram bot; this is the scenario that we consider in the figure below).
  2. Bot store bills the buyer.
  3. Telegram exchanges information about the invoice with the Yandex.Cashy payment bot.
  4. The payer enters payment information without leaving the Telegram application.
  5. Bot J.Kassi makes the payment and reports the successful payment to the backend of the store and to the Telegram.
  6. Telegram notifies the payer and the bot store.

Needless to say that the speed of implementation of paragraphs. 1-2 depends on the client (product selection, payment information input), and the processes from paragraphs. 3-6 occur almost instantly?


An example of using a payment bot in the Russian language service “You can do it!” (@UchenyjBot)




The size of the average check when paying by Telegram

The average check when paying in the messenger through Yandex.Cash is 700 rubles - comparable to the average check when paying on the site. Each business has its own absolute indicator. For example, the average check in a music school that accepts payment through a cashier in a Telegram is 4,000 rubles. A subscription to the consultation service on the Russian language, the payment process of which is shown above, costs 149 rubles.


How to set up sales via Telegram


When Telegram just released an API with payment support, it seemed that this sales channel would be in demand among medium and large merchants, who could write their own bot, which takes into account all the scenarios of the store’s communication with the user. But in fact, a large retail did not go on sale in Telegram, but small service companies and small shops came.


To set up sales in Telegram via Yandex.Cash, you need to do three main things:


  1. Register with Yandex.Money: sign the contract and get the store identifier (shopId).
  2. Create Telegram-bot, which will communicate with customers. All bots are created via @Botfather , but their behavior can be programmed independently or through constructors. Ready bot must be activated via chat with @BotFather.
  3. Connect your bot to the Yandex.Cashy payment bot. To do this, in the “Payments” tab in the menu of your bot, in the dialogue with BotFather, select Yandex.Cash as a payment provider. Then start the dialogue with the new bot via / start, specify the shopId from your Yandex.Cash account (it is assigned when the merchant is connected, each has its own) and implement the sendinvoice method from the Telegram payment API . As soon as the bot is set up, payment acceptance will turn on automatically.

In response to a request, your bot will send an invoice to the client. The invoice must contain the cost, the name, the description of the goods, the payload parameter and the provider_token parameter - this is the same token that issued @BotFather.


If you need to get a shipping address from the buyer, implement the Shipping Query method. When the user specifies an address, this request must be answered using the answerShippingQuery method and the delivery methods as well as their prices must be passed through it.


So, almost everything is ready, except for sending a check.


Sales via Telegram at 54-FZ


What is the essence of the law on online cash

In July 2017, Law 54-FZ came into force, the essence of which is the need for an online tax report for each sale through the Internet. That is, any online store working with individuals must use a new generation of cash registers that can send electronic checks to the tax office after each payment (such cash registers (CCP) can be bought or rented). Checks are transferred to the tax and the buyer via the Internet through the operator of fiscal data - OFD (therefore, the cash must always be online). The receipt must contain the name of the product, price, quantity, VAT rate, information about the seller and the cash register itself.


Until recently, merchants had to monitor sales through the bot and conduct fiscalization on their own. What does this mean in practice? It’s all the same as if the sales went offline: the bot gave the seller a notice of sale, the seller manually entered all the goods sold into his cash desk and passed the check on the contacts that the buyer left before paying.


Beyond the Telegram, Yandex.Kassa as a service already knew how to automatically transfer data about online payments to more than 70 KKM models of all popular suppliers. But in the Cashier’s payment bot, there was no such function due to limitations on the size of the data that our bot could receive from the merchant bot. Everything worked out in February, when Telegram finalized its protocol for payment bots : a field appeared for additional information to the payment provider - Provider data, and we realized this opportunity. This field is required for the transfer of data on the composition of the check. Y. Kassa knows how to parse this field, so the merchant can only set up his bot correctly, adding data on the composition of the check.


Below is the request code without an attached check, that is, as it was until February :


{ "chat_id":147426403, "title": "Test", "description": "Test", "payload":{}, "provider_token":"390540012:LIVE:1514", "currency": "RUB", "start_parameter":"mybot", "prices":[{"label":"-","amount": 6100}] } 

If you add information about the composition of the check for further processing and fiscalization, the request to Telegram to send an invoice with additional information for the Yandex.Cashy payment bot will look like this ( attention to the Receipt field is the data of the composition of the check ):


 { "chat_id":147426403, "title": "Test", "description": "Test", "payload":{}, "provider_token":"390540012:LIVE:1514", "currency": "RUB", "start_parameter":"mybot", "prices":[{"label":"-","amount": 6100}], "provider_data":{ "receipt":{ "email":"example@example.com", "items":[ { "description": " A", "quantity": "1.00", "amount": { "value": "100.00", "currency": "RUB" }, "vat_code": 1 } ] } } } 

From the required data in the request:



So that after payment in Telegram, J. Kassa automatically “signaled” to your cash register that the buyer needs to send a check (he sends the check to the CRF serving your cash register), do the following:


  1. In the personal account of Ya.Kassy, ​​specify the settings of your cash register compatible with Yandex.Cash (now the Cashier supports several dozen varieties of CCV - for example, Atol and Atol Online, Orange Data, UMKA, StarRus, Evotor, Drikkas, Spark, Strich-M, Scoringmash, Incotex and others).
  2. If you do not have a Telegram bot, create it and connect it to the Yandex.Cashi bot using this instruction .

If you have experience in creating a payment bot or have questions about how to set up payment, welcome to comments.


')

Source: https://habr.com/ru/post/351766/


All Articles