Case: accepting payments via YooKassa
A step-by-step guide: how to connect a bot and accept payments right inside it via YooKassa — from connecting the shop to an automation that creates a payment, sends the link, and reacts to the outcom
This guide walks through the whole path — from connecting a YooKassa shop to an automation that creates a payment, sends the user a payment link, and continues the scenario depending on whether the user paid, canceled, or never paid.
Step 1. Connect your bot
For the automation to send messages and react to user events, connect your bot first — see Connecting a bot for details.
Step 2. Connect the YooKassa integration
Go to the Integrations section in your account.
Find the YooKassa card in the list of available integrations and click Configure.
Click Connect — you'll be redirected to YooKassa's authorization page.
Sign in to your YooKassa account (if not already signed in), pick the shop you want to grant access to, and confirm.
You'll be redirected back to your graspil account automatically — the integration is connected.
Use Test connection any time to confirm access is still active. If access was revoked (e.g. you disconnected the app in YooKassa's settings) — reconnect the integration the same way.
Step 3. Build the automation
There's no ready-made template in the catalog yet — build the flow manually, in the Automations section (full documentation).
Open Automations → Create automation, select your bot.
Add a trigger — for example, a "Buy" button click, or any other event after which the user should be billed.
Add an action block Integrations → Create payment (YooKassa) and fill in:
Integration — the one you connected in Step 2.
Amount — a number (e.g.
990.00) or a template, e.g.{{ event.value }}, if the amount depends on the user's choice.Currency — defaults to
RUB.Payment description — what the user (and YooKassa itself) will see, e.g.
Pro plan payment.Payment wait timeout — how many minutes to wait for payment before treating it as abandoned.
The block has three outputs — connect each to its own continuation:
Paid — the user paid the invoice.
Canceled — the payment was canceled in YooKassa.
Not paid — the wait timeout expired.
You don't need to add a separate "Wait for event" block — the "Create payment" block already waits for the outcome itself; you only need to wire its ready-made outputs onward.
From the "Create payment" block to the next step (e.g. a "Send message" block on the Paid output), add a message with the payment link — use the variable
{{ steps.<id>.confirmation_url }}(the block id is filled in automatically when you pick the variable in the message builder).Connect every block with arrows, click Run test to check the flow, and publish the automation.
Reacting to a payment from another automation
The "YooKassa payment succeeded" event is also available as a regular "By event" trigger in any other automation for the same bot — for example, if you want to run a separate scenario in parallel rather than continue the same chain (notify a manager, add the user to a segment, etc.). See the full list in Events.
Need help setting this up?
If something isn't working or you still have questions — contact graspil support, we'll help you set up payment acceptance via YooKassa for your specific case.
Last updated