Telegram Bot icon

Telegram Bot

Interact with the Telegram Bot API – send messages, manage chats, handle payments, and more

Actions101

Payment → Answer Pre Checkout Query

AI-generated

Summary

Send a response to a Telegram pre-checkout query to confirm whether the bot is ready to proceed with the payment order or to provide an error message if not.

Inputs

  • Pre-Checkout Query ID (required) — Unique identifier for the pre-checkout query to answer.
  • OK (required) — Boolean indicating whether the bot is ready to proceed with the order (true) or not (false).
  • Error Message — Error message to show to the user if OK is false, explaining why the bot cannot proceed.

Output shape

a single response object indicating success or error from the Telegram API

Returns the Telegram API response for the answerPreCheckoutQuery method. If the response has a result field which is an object or array, it is passed through as JSON output.

Examples

Example 1: Confirm successfully the pre-checkout query to proceed with payment.

Set 'Pre-Checkout Query ID' with the query id received, set 'OK' to true.

Example 2: Reject a pre-checkout query with an error message.

Set 'Pre-Checkout Query ID' with the query id received, set 'OK' to false and provide an 'Error Message' explaining why the order cannot proceed.

Links

Discussion