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 payment-related operations within Telegram. Specifically, the 'Answer Pre-Checkout Query' operation enables the bot to respond to pre-checkout queries during the payment process, confirming whether the payment can proceed or if there is an error. This is useful in scenarios where a bot needs to validate payment details or conditions before finalizing a transaction, such as confirming product availability or user eligibility.

Use Case Examples

  1. A bot receives a pre-checkout query from a user attempting to purchase a product and uses this node to approve the payment by sending a positive response.
  2. If there is an issue with the payment, such as invalid payment details or out-of-stock items, the bot can respond with an error message to inform the user before the payment is processed.

Properties

Name Meaning
Pre-Checkout Query ID Unique identifier for the query to be answered, used to specify which pre-checkout query the bot is responding to.
OK Boolean flag indicating whether everything is alright (true) or if there is an error (false) in the pre-checkout query.
Error Message Human-readable error message required if 'OK' is false, explaining why the payment cannot proceed.

Output

JSON

  • pre_checkout_query_id - The unique identifier of the pre-checkout query that was answered.
  • ok - Boolean indicating if the pre-checkout query was approved.
  • error_message - Error message provided if the pre-checkout query was not approved.

Dependencies

  • Telegram Stars API access with appropriate API authentication token

Troubleshooting

  • Ensure the 'Pre-Checkout Query ID' is correctly provided and matches the query received from Telegram, otherwise the response will fail.
  • If 'OK' is set to false, the 'Error Message' must be provided; otherwise, the node will throw an error.
  • Network or authentication issues with the Telegram Stars API can cause request failures; verify API credentials and connectivity.

Links

Discussion