Payments

answerShippingQuery()

If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.

parameters

parametertyperequireddescription
shipping_query_idstringrequiredUnique identifier for the query to be answered
okbooleanrequiredPass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
shipping_optionsShippingOption[]optionalRequired if ok is True. A JSON-serialized array of available shipping options.
error_messagestringoptionalRequired if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. “Sorry, delivery to your desired address is unavailable”). Telegram will display this message to the user.

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 { AnswerShippingQueryParams } from "@yaebal/types";

await bot.api.call<boolean>("answerShippingQuery", {
  shipping_query_id: "...",
  ok: true,
} satisfies AnswerShippingQueryParams);

context shortcut

also available as ctx.answer() on 1 context type — see @yaebal/contexts.

context shortcut
/** If you sent an invoice requesting a shipping address and the parameter *is\_flexible* was specified, the Bot API will send an [Update](https://core.telegram.org/bots/api/#update) with a *shipping\_query* field to the bot. Use this method to reply to shipping queries. On success, *True* is returned. */
ctx.answer(params: Omit<AnswerShippingQueryParams, "shipping_query_id">)