Telegram Stars Payment And Refund Workflow
Automates Telegram Stars invoicing, pre-checkout approvals, transaction logging in Google Sheets, and refunds via user ID.
What it does
You receive instant Telegram Stars invoices directly in your chat without manual setup. This workflow automatically logs every transaction to Google Sheets for clear financial tracking and handles refunds instantly using your stored user ID.
Step by step
- Configure the Telegram bot trigger to listen for specific payment events or user commands.
- Set up an HTTP request node to call the Telegram Bot API endpoint for creating invoices with the correct payload structure.
- Add a Google Sheets action node to append rows containing transaction IDs, amounts, and timestamps upon successful invoice creation.
Where the LLM does the work
- Generate the specific JSON payload format required by the Telegram Bot API for custom invoice fields and descriptions.
- Draft user-facing error messages that explain refund eligibility criteria in a clear and polite tone.
- Design the logic flow for handling edge cases like partial refunds or expired invoices based on business rules.
Watch out for
Tools that fit
The agent brief
You are helping me build the following AI agent workflow. ## Goal Telegram Stars Payment And Refund Workflow: Automates Telegram Stars invoicing, pre-checkout approvals, transaction logging in Google Sheets, and refunds via user ID. ## Specification - What it does: You receive instant Telegram Stars invoices directly in your chat without manual setup. This workflow automatically logs every transaction to Google Sheets for clear financial tracking and handles refunds instantly using your stored user ID. - Trigger: Triggered by an event (Event · on Telegram payment request) - Autonomy: Fully hands-off - Expected setup effort: under an hour - Tools/services involved: - Telegram: Invoice creation and refund processing - Google Sheets: Recording transaction logs - HTTP Request: API communication with Telegram ## Known pitfalls, handle each one explicitly in your implementation 1. Telegram requires valid currency codes for Star transactions so you must ensure your payload uses 'XTR' instead of standard ISO codes. 2. Invoice payloads have strict character limits for titles and descriptions so keep text concise to avoid API rejection errors. 3. Refund processing relies on unique charge IDs which expire after a certain period so store these immediately in Google Sheets upon payment. ## Reference implementation https://n8n.io/workflows/2461 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/telegram-stars-payment-and-refund-workflow/ via usecasesforagents.com
Frequently asked questions
Can I use a different Messaging than Telegram?
Yes. Telegram is only the example messaging in this recipe. The same flow works with ClickSend API, Discord, Google Chat and LINE Messaging API. Swap the messaging connection and keep the rest of the setup as written.
Want this running in your business?
Who it's for
Built for developers who want the busywork around code automated, not the code itself.
Sales teams can plug this into their own CRM and call cadence just as easily.