Payments

refundStarPayment()

Refunds a successful payment in Telegram Stars. Returns True on success.

parameters

parametertyperequireddescription
user_idnumberrequiredIdentifier of the user whose payment will be refunded
telegram_payment_charge_idstringrequiredTelegram payment identifier

returns

boolean

usage in yaebal

refundStarPayment is directly typed on Api — call it straight off bot.api.

bot.ts
import type { RefundStarPaymentParams } from "@yaebal/types";

await bot.api.refundStarPayment({
  user_id: 123456789,
  telegram_payment_charge_id: "...",
} satisfies RefundStarPaymentParams);

context shortcut

also available as ctx.refundStarPayment() on 16 context types — see @yaebal/contexts.

context shortcut
/** Refunds a successful payment in [Telegram Stars](https://t.me/BotNews/90). Returns *True* on success. */
ctx.refundStarPayment(params: Omit<RefundStarPaymentParams, "user_id"> & { user_id?: number })