# Telegram Stars & Paid Subscriptions

> Accept Telegram Stars digital currency and configure recurring subscription periods using createInvoiceLink.

**Category:** Telegram Bot API (A-Z)  
**URL:** https://docs.botlify.cloud/?page=stars-subscriptions  
**Platform:** Botlify Cloud (https://botlify.cloud)  

---

## Monetizing with Telegram Stars

      

Telegram Stars (⭐️) allow users to pay for digital goods, services, and monthly subscriptions inside bots without third-party payment gateways.

      
```php
function create_stars_subscription(string $title, string $description, int $starsPrice, int $periodSeconds = 2592000): string {
    $res = bot('createInvoiceLink', [
        'title'               => $title,
        'description'         => $description,
        'payload'             => 'sub_' . bin2hex(random_bytes(8)),
        'currency'            => 'XTR', // Official Telegram Stars Currency Code
        'prices'              => [
            ['label' => $title, 'amount' => $starsPrice]
        ],
        'subscription_period' => $periodSeconds // 2592000 = 30 days recurring
    ]);
    return $res['result'] ?? '';
}
```
