telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

update_id as an idempotency key

Open Desalutar20 opened this issue 8 months ago • 3 comments

Hi, I have a payment service that stores an idempotency key in the database to ensure that requests aren’t repeated. Can I use update_id as the idempotency key, or could it be repeated?

Desalutar20 avatar Mar 26 '26 11:03 Desalutar20

Payment notifications have specific fields with unique payment identifiers. update_id may be used to apply updates in the correct order or to discard duplicate updates, but it can't be used as an idempotency key for payments.

levlam avatar Mar 27 '26 10:03 levlam

Payment notifications have specific fields with unique payment identifiers. update_id may be used to apply updates in the correct order or to discard duplicate updates, but it can't be used as an idempotency key for payments.

The problem is that my payment system isn't integrated via the Telegram API, so I need something unique within the request

Desalutar20 avatar Mar 28 '26 01:03 Desalutar20

If the payment system isn't integrated via the Telegram API, then Bot API isn't related to payments and their handling.

levlam avatar Mar 28 '26 19:03 levlam