Skip to main content

payments.refundStarsCharge

Refund a Telegram Stars transaction, see here » for more info.

func (c *Client) PaymentsRefundStarsCharge(ctx context.Context, request *PaymentsRefundStarsChargeRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.PaymentsRefundStarsCharge(ctx, &tg.PaymentsRefundStarsChargeRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
UserIDInputUserClassyesUser to refund.
ChargeIDstringyesTransaction ID.

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CHARGE_ALREADY_REFUNDEDThe transaction was already refunded.
400CHARGE_ID_EMPTYThe specified charge_id is empty.
400USER_BOT_REQUIREDThis method can only be called by a bot.
400USER_ID_INVALIDThe provided user ID is invalid.

References