# Telegram Invoice & Payments (Telegram Stars)

FlowBridge includes a powerful **Custom Function** that allows you to send Telegram invoices and accept payments using **Telegram Stars** directly through your agent.

This integration requires **Premium Plus**.

***

### Overview

The **Telegram Invoice & Payment** custom function lets you trigger a complete payment flow directly from within your Voiceflow canvas. Simply drag the function into your flow, configure the product details, and FlowBridge handles everything that happens on Telegram.

When a user completes the purchase:

* Telegram processes the payment
* The result is sent back to FlowBridge
* Your Voiceflow flow automatically continues via the **"Completed"** path
* FlowBridge returns the **product ID** you configured, so your flow or backend can react accordingly

This allows you to create paid features, premium unlocks, digital goods, and other monetization flows with minimal setup.

***

### How It Works

1. Add the **Telegram Invoice** Custom Function to your Voiceflow project
2. Configure:
   * Product title
   * Description
   * Price (in Stars)
   * Product ID (your identifier for the item being sold)
3. When the agent reaches this function, FlowBridge automatically sends the invoice to the user on Telegram
4. The user pays using **Telegram Stars**
5. Once Telegram confirms the payment, FlowBridge triggers the **"Completed"** output path
6. Your selected **product ID** is included in the output, enabling downstream logic

***

### Payment Handling

* All payments go **directly to your Telegram bot**
* You receive the Stars immediately
* You can withdraw earnings in real currency using Telegram’s monetization tools
* FlowBridge **does not** take a cut, process the transaction, or hold funds

FlowBridge’s role is simply to orchestrate the payment + agent flow in a seamless way.

***

### Accessing Product Data

When the user completes a payment, FlowBridge includes your configured product metadata inside the response object.

If you are using the **FlowBridge Telegram API** directly, you can read the product information from the: `invoice_payload`

Inside this object, the `id` key contains the product ID you provided.\
This is useful when:

* Processing the purchase server-side
* Granting access to digital goods
* Unlocking premium features
* Tracking analytics or orders

***

### Requirements

To use Telegram Invoice & Payments through FlowBridge:

* Your Telegram bot must support payments via Stars
* Your workspace must be on the **Premium Plus plan**
* You must be using a Telegram channel connected through FlowBridge

***

### Example Use Cases

* Selling digital content (PDFs, guides, images)
* Paid premium access inside your bot
* Pay-to-unlock features inside a flow
* One-time feature upgrades
* Selling services or microtransactions inside Telegram

***

### How do I get the function?

You can download the custom function through the `Custom Functions` page on your FlowBridge Connect environment's admin panel.&#x20;


---

# 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.flowbridge.app/documentation/social-integrations/telegram/telegram-invoice-and-payments-telegram-stars.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.
