Telegram Stars icon

Telegram Stars

Interact with Telegram Stars payments API

Overview

This node interacts with the Telegram Stars payments API, allowing users to perform various operations related to Telegram Stars transactions. It supports sending invoices, answering pre-checkout queries, refunding star payments, retrieving star transaction lists, and getting the bot's star balance. This node is useful for automating payment workflows within Telegram bots, such as managing payments, refunds, and transaction tracking.

Use Case Examples

  1. Sending an invoice to a user for a product or service using Telegram Stars.
  2. Answering pre-checkout queries to confirm or reject payments.
  3. Refunding a user's star payment in case of issues or cancellations.
  4. Retrieving a list of star transactions for record-keeping or analysis purposes.

Properties

Name Meaning
Operation The specific Telegram Stars API operation to perform, such as sending an invoice or getting transactions.
Chat ID Unique identifier for the target chat or username of the target channel (used in sending invoices).
Title Product name, 1-32 characters (used in sending invoices).
Description Product description, 1-255 characters (used in sending invoices).
Payload Bot-defined invoice payload, 1-128 bytes (used in sending invoices).
Currency Three-letter ISO 4217 currency code, typically 'XTR' for Telegram Stars (used in sending invoices).
Price Label Label for the price portion (used in sending invoices).
Price Amount Price of the product in the smallest units of the currency (used in sending invoices).
Additional Fields (Send Invoice) Optional additional parameters for sending invoices, such as message thread ID, provider data, photo URL, notification settings, and reply options.
Pre-Checkout Query ID Unique identifier for the pre-checkout query to be answered (used in answering pre-checkout queries).
OK Boolean indicating whether the pre-checkout query is approved (true) or rejected (false).
Error Message Human-readable error message required if OK is false (used in answering pre-checkout queries).
User ID Identifier of the user whose payment will be refunded (used in refunding star payments).
Telegram Payment Charge ID Telegram payment identifier for the charge to be refunded (used in refunding star payments).
Additional Fields (Get Star Transactions) Optional parameters for retrieving star transactions, including offset (number of transactions to skip) and limit (maximum number of transactions to retrieve, between 1-100).

Output

JSON

  • transaction_id - Unique identifier of the star transaction.
  • user_id - Identifier of the user involved in the transaction.
  • amount - Amount of stars involved in the transaction.
  • currency - Currency code, typically 'XTR' for Telegram Stars.
  • date - Date and time when the transaction occurred.
  • status - Status of the transaction (e.g., successful, refunded).
  • details - Additional details related to the transaction.

Dependencies

  • Telegram Stars API

Troubleshooting

  • Ensure that the API credentials for Telegram Stars are correctly configured and valid.
  • Verify that required parameters such as price label and price amount are provided and valid when sending invoices.
  • Check that the limit parameter for retrieving star transactions is within the accepted range (1-100).
  • Handle errors returned by the Telegram Stars API gracefully, especially when the operation fails due to invalid input or network issues.

Links

Discussion