Telegram Bot API
🌐 Türkçe

editUserStarSubscription

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

Telegram Stars aboneliğini iptal eder veya yeniler.

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

Parametreler

ParametreTürZorunluAçıklama
user_idIntegerEvetKullanıcı ID'si
telegram_payment_charge_idStringEvetTelegram ödeme ID'si
is_canceledBooleanEvettrue = abonelik yenilemesini iptal et, false = yenilemeye izin ver

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/editUserStarSubscription" \
  -H "Content-Type: application/json" \
  -d '{
  "user_id": 123456789,
  "telegram_payment_charge_id": "CHARGE_ID",
  "is_canceled": true
}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/editUserStarSubscription",
    json={
        "user_id": 123456789,
        "telegram_payment_charge_id": "CHARGE_ID",
        "is_canceled": True
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/editUserStarSubscription`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "user_id": 123456789,
    "telegram_payment_charge_id": "CHARGE_ID",
    "is_canceled": true
  }),
});
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