Webhooks
Webhook notifications for shop events.
Setup:
Go to Creator Dashboard → Settings (three-dot menu) → API Keys section
Generate API key if you haven't already
Specify your webhook URL in the webhook settings
Signature verification: Each request contains trbt-signature header with HMAC-SHA256 signature of request body signed with your API key.
Retry attempts: On delivery failure, system retries with exponential backoff over ~24 hours: 5min, 15min, 30min, 1h, 2h, 4h, 8h, 8h.
Notification about a shop order payment completion.
shop_orderPossible values: Event creation time
2025-03-20T01:15:58.33246ZEvent sending time
2025-03-20T01:15:58.542279448ZWebhook successfully processed
okInvalid webhook data
Invalid webhook signature
Payload
{
"name": "shop_order",
"created_at": "2025-03-20T01:15:58.33246Z",
"sent_at": "2025-03-20T01:15:58.542279448Z",
"payload": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"shopId": 1,
"amount": 100000,
"currency": "rub",
"fee": 8000,
"status": "paid",
"email": "customer@example.com",
"customerId": "user_12345",
"isRecurrent": false,
"period": "monthly",
"paymentToken": "660e8400-e29b-41d4-a716-446655440001",
"cardLast4": "4242",
"cardBrand": "VISA",
"starsAmount": 0,
"onlyStars": false,
"firstPeriodAmount": 50000,
"memberStatus": "active",
"memberExpiresAt": "2025-12-13T15:04:05Z",
"isTrial": false,
"trialPeriod": "seven_days",
"trialEndsAt": "2025-12-20T15:04:05Z",
"paymentLinkUuid": "7f1c2a3b-4d5e-4f60-8a9b-0c1d2e3f4a5b",
"payload": {
"modelId": "m_7"
}
}
}Notification when a recurring shop order charge fails. Sent after each failed charge attempt. The system makes up to 3 attempts (1 initial + 2 retries) over ~8 hours before cancelling the subscription.
Only fires for card-based recurring payments. Subscriptions paid directly with Telegram Stars (no fiat card on file) are auto-renewed by Telegram itself — when Telegram does not renew, the subscription is cancelled with cancelReason="stars_subscription_expired" via shop_order_cancelled without any preceding shop_order_charge_failed events. The same applies to OnlyStars card-to-Stars subscriptions when the buyer cancels on Telegram's side: the card pre-charge is skipped and the subscription is cancelled with cancelReason="stars_subscription_expired" (no shop_order_charge_failed).
Charge timing relative to memberExpiresAt:
- Card payments: charge happens strictly after
memberExpiresAt, typically within minutes. - OnlyStars (card-to-Stars): charge happens up to 72 hours before
memberExpiresAtto pre-purchase Stars for Telegram renewal.
shop_order_charge_failedPossible values: Event creation time
2025-03-20T01:15:58.33246ZEvent sending time
2025-03-20T01:15:58.542279448ZWebhook successfully processed
okInvalid webhook data
Invalid webhook signature
Payload
{
"name": "shop_order_charge_failed",
"created_at": "2025-03-20T01:15:58.33246Z",
"sent_at": "2025-03-20T01:15:58.542279448Z",
"payload": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"shopId": 1,
"amount": 100000,
"currency": "rub",
"period": "monthly",
"chargeRetries": 1,
"email": "customer@example.com",
"customerId": "user_12345",
"isRecurrent": true,
"starsAmount": 0,
"onlyStars": false,
"firstPeriodAmount": 50000,
"memberStatus": "active",
"memberExpiresAt": "2025-12-13T15:04:05Z"
}
}Notification when a recurring shop order is charged successfully.
shop_order_charge_successPossible values: Event creation time
2025-03-20T01:15:58.33246ZEvent sending time
2025-03-20T01:15:58.542279448ZWebhook successfully processed
okInvalid webhook data
Invalid webhook signature
Payload
{
"name": "shop_order_charge_success",
"created_at": "2025-03-20T01:15:58.33246Z",
"sent_at": "2025-03-20T01:15:58.542279448Z",
"payload": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"shopId": 1,
"amount": 100000,
"currency": "rub",
"period": "monthly",
"email": "customer@example.com",
"customerId": "user_12345",
"isRecurrent": true,
"starsAmount": 0,
"onlyStars": false,
"firstPeriodAmount": 50000,
"memberStatus": "active",
"memberExpiresAt": "2025-12-13T15:04:05Z"
}
}Notification when a recurring shop order subscription is cancelled. See cancelReason in the payload for the trigger:
cancelled_by_seller— explicit cancel from the Mini App / public API (POST /api/v1/shop/orders/{orderUuid}/cancel).charge_failed— recurring charge could not be completed after all retries.payment_method_expired— saved card is no longer usable.stars_subscription_expired— Telegram Stars subscription stopped renewing on Telegram's side. Covers both pure-Stars subscriptions (no fiat card on file; renewal is handled by Telegram) and OnlyStars card-to-Stars subscriptions whose buyer cancelled on Telegram's side (the card pre-charge is then stopped).seller_unavailable— seller can no longer accept payments.last_charge_refunded— the buyer's most recently created shop-order buyer transaction was refunded (via any path: bank chargeback, Telegram Stars refund, manual seller refund). Refunding an older charge while a newer one still exists does NOT cancel the subscription. This event is emitted in addition to theshop_order_refundedevent for the same transaction.chargeback— the buyer disputed a payment with their bank. Renewal stops right away, the paid period runs to its end, and this event arrives when the period ends. If the dispute is lost,shop_order_refundedfollows for the disputed transaction; when that refund lands before the period ends and the disputed transaction is the latest charge, the subscription closes at once withlast_charge_refundedinstead, andchargebackis not sent.
shop_order_cancelledPossible values: Event creation time
2025-03-20T01:15:58.33246ZEvent sending time
2025-03-20T01:15:58.542279448ZWebhook successfully processed
okInvalid webhook data
Invalid webhook signature
Payload
{
"name": "shop_order_cancelled",
"created_at": "2025-03-20T01:15:58.33246Z",
"sent_at": "2025-03-20T01:15:58.542279448Z",
"payload": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"shopId": 1,
"amount": 100000,
"currency": "rub",
"period": "monthly",
"cancelReason": "cancelled_by_seller",
"email": "customer@example.com",
"customerId": "user_12345",
"isRecurrent": true,
"starsAmount": 0,
"onlyStars": false,
"firstPeriodAmount": 50000,
"memberStatus": "cancelled",
"memberExpiresAt": "2025-12-13T15:04:05Z"
}
}Notification when a shop order transaction is refunded. Fires for one-time and recurring orders alike, regardless of refund trigger (bank chargeback, Telegram Stars refund, manual seller refund).
Lifecycle. Manual seller-initiated refunds emit status=initiated first, then a second event with status=completed once the provider confirms. Bank chargebacks and Telegram Stars refunds skip the initiated step and emit status=completed directly. Consumers must idempotently handle two events with the same transactionId (one per status).
Recurring orders — last-charge cancellation. When the refunded transactionId is the most recently created shop-order buyer transaction for a recurring subscription, this event is followed by a shop_order_cancelled event with cancelReason="last_charge_refunded". Refunding an older charge (i.e., when a newer recurring charge still exists for the same subscription) does NOT cancel the member.
shop_order_refundedPossible values: Event creation time
2025-03-20T01:15:58.33246ZEvent sending time
2025-03-20T01:15:58.542279448ZWebhook successfully processed
okInvalid webhook data
Invalid webhook signature
Payload
{
"name": "shop_order_refunded",
"created_at": "2025-03-20T01:15:58.33246Z",
"sent_at": "2025-03-20T01:15:58.542279448Z",
"payload": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"shopId": 1,
"transactionId": 12345,
"amount": 100000,
"currency": "rub",
"status": "initiated",
"refundedAt": "2025-03-20T01:15:58.33246Z",
"customerId": "user_12345",
"isRecurrent": false,
"period": "onetime",
"starsAmount": 0,
"onlyStars": false,
"firstPeriodAmount": 50000,
"memberStatus": "active",
"memberExpiresAt": "2025-12-13T15:04:05Z",
"paymentLinkUuid": "7f1c2a3b-4d5e-4f60-8a9b-0c1d2e3f4a5b",
"payload": {
"modelId": "m_7"
}
}
}Notification when an initial shop order payment (CIT) fails (e.g., card declined, insufficient funds). Sent for one-time payments and for the first charge of a recurring order. The amount that was attempted is in smallest currency units — firstPeriodAmount when a recurring order has a first-period override, otherwise amount. A decline is not terminal — the order stays pending and payable, so the same order may trigger this webhook more than once before it is paid.
shop_order_payment_failedPossible values: Event creation time
2025-03-20T01:15:58.33246ZEvent sending time
2025-03-20T01:15:58.542279448ZWebhook successfully processed
okInvalid webhook data
Invalid webhook signature
Payload
{
"name": "shop_order_payment_failed",
"created_at": "2025-03-20T01:15:58.33246Z",
"sent_at": "2025-03-20T01:15:58.542279448Z",
"payload": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"shopId": 1,
"amount": 100000,
"currency": "rub",
"errorCode": "payment_declined",
"errorMessage": "Card declined by issuer",
"email": "customer@example.com",
"customerId": "user_12345",
"starsAmount": 0,
"onlyStars": false,
"firstPeriodAmount": 50000,
"paymentLinkUuid": "7f1c2a3b-4d5e-4f60-8a9b-0c1d2e3f4a5b",
"payload": {
"modelId": "m_7"
}
}
}The customer has paid the invoice. Sent immediately after payment, before the shop_order webhook.
This is an intermediate signal: funds have not been credited to the merchant yet and the payment may not complete. Do not deliver goods or treat the order as paid — the final status arrives via the shop_order webhook.
shop_order_payment_receivedPossible values: Event creation time
2025-03-20T01:15:58.33246ZEvent sending time
2025-03-20T01:15:58.542279448ZWebhook successfully processed
okInvalid webhook data
Invalid webhook signature
Payload
{
"name": "shop_order_payment_received",
"created_at": "2025-03-20T01:15:58.33246Z",
"sent_at": "2025-03-20T01:15:58.542279448Z",
"payload": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"shopId": 1,
"amount": 100000,
"currency": "rub",
"period": "monthly",
"starsAmount": 150,
"onlyStars": true,
"starsPurchaseId": 4711,
"email": "customer@example.com",
"customerId": "user_12345"
}
}Last updated