Integrating Digital Products into Your Product

This guide is for Telegram bot and service owners who want to use Tribute as a payment system. Accept payments via SBP and Telegram Stars, receive withdrawals in USDT without complex payment provider

Benefits of Tribute Digital Products Integration

For you as a service owner:

  • Payment acceptance - SBP and Telegram Stars

  • Simple integration - create a product, get a link, set up a webhook

  • Ready infrastructure - no need to integrate payment providers yourself

  • Automatic withdrawals - receive money in USDT

For your users:

  • Convenient payment - one-click purchase through Telegram

  • Available payment methods - SBP, Telegram Stars

How it works: general scheme

1. You create a digital product in Tribute

For example, for an AI assistant it could be "AI Assistant Access for 1 month"

Each product has its own link in the format:

  • For Telegram: https://t.me/tribute/app?startapp=p123

  • For browser: https://web.tribute.tg/p/123

In your bot or other service, add a "Pay" button that leads to the product link

4. User pays

The buyer can:

  • Pay directly with Telegram Stars (if available on balance)

  • Buy Stars via SBP and immediately exchange them for the product

5. You receive a webhook about successful payment

After payment, a POST request with purchase information arrives at your server. More about webhook format in the webhooks documentation

6. Provide access to the user

Activate the service for the user using the Telegram ID from the webhook

Step-by-step setup instructions

Step 1: Registration in Tribute

  1. Open @tribute in Telegram

  2. Click "Start" and follow the instructions

  3. Go to the "Author Dashboard" section

Step 2: Creating a digital product

  1. In the dashboard, select "Digital Products" → "Create Product"

  2. Fill in the required fields:

    • Product name - what the buyer will see (for example: "AI Assistant for 1 month")

    • Price - specify the cost in the desired currency

    • Message after purchase - important for integration!

Correct message after purchase

This message will be received by the user after payment. Use it to direct the user back to your bot:

✅ Thank you for purchasing AI Assistant access for 1 month!
To activate your subscription, return to @YourAIBot and press /activate
Access will be provided automatically.
  1. Save the product and remember its ID (displayed in the product list)

Step 3: Getting API key

  1. In the dashboard, open the menu (three dots) → "Settings"

  2. Go to the "API Keys" section

  3. Click "Generate New Key"

  4. Save the key in a safe place - you'll need it to verify webhooks

Step 4: Setting up webhooks

  1. In the "API Keys" section, find the "Webhook URL" field

  2. Specify your server address for receiving webhooks:

    https://your-server.com/webhook/tribute
  3. Save settings

Step 5: Processing webhooks on your server

After successful payment for a digital product, Tribute will send a POST request to your URL:

Webhook format
{
  "name": "new_digital_product",
  "created_at": "2025-03-20T01:15:58.332Z",
  "sent_at": "2025-03-20T01:15:58.542Z",
  "payload": {
    "product_id": 456,
    "amount": 500,
    "currency": "usd",
    "user_id": 31326,
    "telegram_user_id": 12321321
  }
}

Webhook signature verification

Each request contains a trbt-signature header with HMAC-SHA256 signature of the request body. Examples of signature verification and webhook processing are available in the webhooks documentation

Step 6: Integration into your bot

In your Telegram bot, add a payment button

Python code
# Python + python-telegram-bot
from telegram import InlineKeyboardButton, InlineKeyboardMarkup

def send_payment_button(update, context):
    keyboard = [[
        InlineKeyboardButton(
            "💳 Pay ($9.99)",
            url="https://t.me/tribute/app?startapp=p456"
        )
    ]]
    reply_markup = InlineKeyboardMarkup(keyboard)
    
    update.message.reply_text(
        "AI Assistant for 1 month - $9.99",
        reply_markup=reply_markup
    )

Working with API

Getting product information

GET https://tribute.tg/api/v1/products/456
Headers:
  X-Api-Key: YOUR_API_KEY
JSON Response
{
  "id": 456,
  "type": "digital",
  "name": "AI Assistant for 1 month",
  "amount": 999,
  "currency": "usd",
  "starsAmount": 100,
  "link": "https://t.me/tribute/app?startapp=p456",
  "webLink": "https://web.tribute.tg/p/456"
}

Getting a list of all your products

GET https://tribute.tg/api/v1/products?type=digital
Headers:
  X-Api-Key: YOUR_API_KEY

Creating different pricing tiers

For different tiers, create several digital products:

  1. AI Assistant - 1 month (ID: 456) - $9.99

  2. AI Assistant - 3 months (ID: 457) - $24.99

  3. AI Assistant - 1 year (ID: 458) - $79.99

Handling retry attempts

When webhook delivery fails, Tribute retries after:

  • 5 minutes

  • 15 minutes

  • 30 minutes

  • 1 hour

  • 10 hours

Make sure your handler is idempotent (reprocessing the same payment won't create duplicates).

Withdrawals

You can withdraw earned funds in USDT (bank card withdrawals will be added in the future). Set up automatic withdrawals in the "Wallet" section.

Frequently Asked Questions

How quickly do webhooks arrive?

Usually within 1-2 seconds after successful payment.

Can I cancel a payment?

Digital products can be canceled through Tribute support.


Last updated