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

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

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

await bot.api.call<boolean>("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">)