Telegram Bot API
🌐 English

answerShippingQuery

Category: Payments · Bot API 10.3 · Official documentation

Answers a shipping query.

Returns: On success, returns True.

Parameters

ParameterTypeRequiredDescription
shipping_query_idStringYesShipping query ID
okBooleanYestrue if shipping available
shipping_optionsArray of ShippingOptionOptionalJSON ShippingOption array (if ok=true)
error_messageStringOptionalError message (if ok=false)

Parameter descriptions are concise summaries; see the official documentation for the full text.

Example request

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/answerShippingQuery" \
  -H "Content-Type: application/json" \
  -d '{"shipping_query_id":"SHIPPING_QUERY_ID","ok":true}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/answerShippingQuery",
    json={
        "shipping_query_id": "SHIPPING_QUERY_ID",
        "ok": True
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/answerShippingQuery`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "shipping_query_id": "SHIPPING_QUERY_ID",
    "ok": true
  }),
});
console.log(await res.json());

Step-by-step guide: How to Create a Telegram Bot: Step by Step with BotFather and Python