Telegram Bot API
🌐 Türkçe

createInvoiceLink

Kategori: Ödemeler · Bot API 10.3 · Resmi dokümantasyon

Ödeme bağlantısı oluşturur.

Dönüş değeri: Başarılı olduğunda String döndürür.

Parametreler

ParametreTürZorunluAçıklama
business_connection_idStringİsteğe bağlıİşletme bağlantısı ID'si
titleStringEvetÜrün adı
descriptionStringEvetÜrün açıklaması
payloadStringEvetPayload
provider_tokenStringİsteğe bağlıÖdeme sağlayıcısı token'ı
currencyStringEvetPara birimi
pricesArray of LabeledPriceEvetJSON LabeledPrice dizisi
subscription_periodIntegerİsteğe bağlıAbonelik süresi (saniye)
max_tip_amountIntegerİsteğe bağlıMaksimum bahşiş tutarı
suggested_tip_amountsArray of Integerİsteğe bağlıÖnerilen bahşiş tutarlarının JSON dizisi
provider_dataStringİsteğe bağlıSağlayıcı için JSON verisi
photo_urlStringİsteğe bağlıÜrün fotoğrafı URL'si
photo_sizeIntegerİsteğe bağlıFotoğraf boyutu
photo_widthIntegerİsteğe bağlıFotoğraf genişliği
photo_heightIntegerİsteğe bağlıFotoğraf yüksekliği
need_nameBooleanİsteğe bağlıAdı iste
need_phone_numberBooleanİsteğe bağlıTelefonu iste
need_emailBooleanİsteğe bağlıE-posta adresini iste
need_shipping_addressBooleanİsteğe bağlıTeslimat adresini iste
send_phone_number_to_providerBooleanİsteğe bağlıTelefon numarasını sağlayıcıya gönder
send_email_to_providerBooleanİsteğe bağlıE-posta adresini sağlayıcıya gönder
is_flexibleBooleanİsteğe bağlıEsnek fiyat

Parametre açıklamaları kısa özetlerdir; tam metin için resmi dokümantasyona bakın.

Örnek istek

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/createInvoiceLink" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Example",
  "description": "Example item",
  "payload": "order-1",
  "currency": "XTR",
  "prices": [
    {
      "label": "Item",
      "amount": 100
    }
  ]
}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/createInvoiceLink",
    json={
        "title": "Example",
        "description": "Example item",
        "payload": "order-1",
        "currency": "XTR",
        "prices": [
            {
                "label": "Item",
                "amount": 100
            }
        ]
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/createInvoiceLink`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "title": "Example",
    "description": "Example item",
    "payload": "order-1",
    "currency": "XTR",
    "prices": [
      {
        "label": "Item",
        "amount": 100
      }
    ]
  }),
});
console.log(await res.json());

Adım adım rehber: Telegram bot nasıl yapılır? BotFather ile adım adım bot oluşturma