If you sent an invoice requesting a shipping address and the parameter *is\_flexible* was specified

POST /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.

Body Required

  • shipping_query_id string Required

    Unique identifier for the query to be answered

  • ok boolean Required

    Specify 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_options array[object]

    This object represents one shipping option.

    Hide shipping_options attributes Show shipping_options attributes array[object]
    • id string Required

      Shipping option identifier

    • title string Required

      Option title

    • prices array[object] Required

      This object represents a portion of the price for goods or services.

      Hide prices attributes Show prices attributes array[object]
      • label string Required

        Portion label

      • amount integer Required

        Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

  • error_message string

    Required 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.

Responses

  • default
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is false.

    • error_code integer Required
    • description string Required
    • parameters object

      Contains information about why a request was unsuccessful.

      Hide parameters attributes Show parameters attributes object
      • migrate_to_chat_id integer

        Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

      • retry_after integer

        Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

  • 200
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is true.

    • result boolean Required

      Default value is true.

POST /answerShippingQuery
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/answerShippingQuery \
 -H "Content-Type: application/json" \
 -d '{"shipping_query_id":"string","ok":true,"shipping_options":[{"id":"string","title":"string","prices":[{"label":"string","amount":42}]}],"error_message":"string"}'
Request example
{
  "shipping_query_id": "string",
  "ok": true,
  "shipping_options": [
    {
      "id": "string",
      "title": "string",
      "prices": [
        {
          "label": "string",
          "amount": 42
        }
      ]
    }
  ],
  "error_message": "string"
}
Request examples
{
  "shipping_query_id": "string",
  "ok": true,
  "shipping_options": [
    {
      "id": "string",
      "title": "string",
      "prices": [
        {
          "label": "string",
          "amount": 42
        }
      ]
    }
  ],
  "error_message": "string"
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": true
}
Response examples (200)
{
  "ok": true,
  "result": true
}