T-commerce: how online sales work through Telegram

    Last summer, Telegram released a new payment-enabled API. Since then, the messenger has also become a sales channel that 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.Kassa was the first among Russian payment services to support this feature. Individual entrepreneurs and small organizations immediately accepted payments to Telegram through the Cashier: florists, tea and coffee shops, trainers, training course organizers, charitable foundations and many others ( here you can read reviews and examples). But for larger companies with a stream of orders, there was one stopper.


    The fact is that until recently Telegram sales had one feature that did not take into account the purely Russian specifics of electronic commerce - the mandatory sending of online checks (requirement 54-FZ, known as the law on online cash desks) Yandex.Kassa immediately had a special protocol that supported work with new cash register equipment and automated the transfer of checks. But in Telegram, such automation was not technically supported, and sellers had to set up the transmission of checks themselves (consider dancing with a tambourine). And recently, the messenger went towards the Russian e-commerce market and implemented a joint project with Yandex.Cash, adding an important element to its protocol - a special field has appeared for additional information to the payment provider. Now it has become convenient to sell via Telegram from the point of view of not only the customer 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 needs to be done to launch sales on Telegram, accepting payments through Yandex.Cash.


    What does the payment process look like in Telegram


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


    1. The buyer puts the goods in the basket on the store’s website, and at the payment stage he chooses to pay via Telegram (the second option is when the client initially chooses the product or service using the Telegram bot; we will consider just such a scenario in the figure below).
    2. The store’s bot bills the customer.
    3. Telegram exchanges information about the invoice with the payment bot Yandex.Cash.
    4. The payer enters the payment information without leaving the Telegram application.
    5. Bot Y. Kassi makes a payment and announces a successful payment to the backend of the store and Telegram.
    6. Telegram notifies the payer and bot of the store.

    Needless to say, the speed of execution of paragraphs. 1-2 depends on the client (selection of goods, input of payment information), and the processes from paragraphs. Do 3-6 happen 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 in Telegram

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


    How to set up sales through Telegram


    When Telegram just released the 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, taking into account all the scenarios of the store communicating with the user. But in reality, he didn’t sell big retail on Telegram, but small service companies and small shops came.


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


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

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


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


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


    Sales via Telegram at 54-FZ


    What is the essence of the online box office law

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


    Until recently, merchants needed to monitor sales through a bot and carry out fiscalization on their own. What does this mean in practice? It’s the same as if sales were going offline: the bot sent the seller a notification about the sale, the seller manually drove into the cash desk all the goods sold and passed the check to the contacts that the buyer left before payment.


    Outside the framework of Telegram, Yandex.Kassa, as a service, was already able to automatically transfer data about online payments for more than 70 KKM models of all popular suppliers. But there was no such function in the cash desk of Kassa due to restrictions 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 at home. This field is required for transmitting data on the composition of the check. Y. Kassa knows how to parse this field, so the merchant can only configure his bot correctly, supplementing it with 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, then a request to Telegram to send an invoice with additional information for the Yandex.Kassi payment bot will look like this ( attention to the Receipt field is 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:


    • need_phone_number or need_email - they tell Telegram that after clicking on the account you need to request a phone number (need_phone_number) and / or email (need_email);
    • send_email_to_provider (if you requested an email from the buyer) or send_phone_number_to_provider (if you requested a phone number) - indicate the need to send the entered values ​​to the payment provider;
    • provider_data with the receipt object - the receipt should contain a list of commodity items or services, their quantity and prices. Everything is like in a regular check.

    In order for Ya.Kassa to automatically “signal” to your cash register after paying in Telegram that the buyer needs to send a check (the check itself sends the OFD serving your cash register), you need to do the following:


    1. Indicate the settings of your cash register compatible with Yandex.Kassa in Y.Kassa’s personal account (now Kassa supports several dozen types of KKT - for example, Atol and Atol Online, Orange Data, UMKA, StarRus, Evotor, Dreamkas, Iskra, Shtrikh-M, Accountmash, Incotex and others).
    2. If you do not already have a Telegram bot, create it and connect it to the Yandex.Kassi bot using this instruction .

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


    Also popular now: