Skip to main content

Quick Start

Connect your Telegram bot and send your first notification in under 5 minutes.
1

Create a bot with BotFather

Open @BotFather in Telegram, run /newbot, and copy the bot token.
2

Connect it to Shoppex

3

Share your deep link

The response includes a deep_link_url — share it with customers so they can opt in to notifications via Telegram.
4

Send a broadcast

Once customers have connected, you can send broadcasts, set up automated journeys, or enable the AI agent.
That’s it — your bot is live. The rest of this guide covers everything you can build on top of it.

What You Can Do

Once your bot is connected, Shoppex gives you:
  • Automatic notifications — order confirmations, restock alerts, and promotional messages that respect each customer’s preferences
  • Broadcasts — scheduled or immediate messages to segmented audiences, with click tracking and revenue attribution
  • Journeys — event-driven follow-up automation (post-purchase, abandoned cart, renewal reminders)
  • Two-way inbox — customers can reply, and merchants can respond from the API or dashboard
  • AI agent — route inbound messages to an AI that can search products, look up orders, and create coupons

Bot Response Shape

When you connect a bot, Shoppex returns a grouped resource:

Customer Linking

Customers connect to your shop through the bot deep link:
You can add context to the deep link for richer linking: The merchant deep link is pre-built in the bot response under connection.merchant_deep_link_url — it binds the Telegram chat to a Shoppex manager so merchant-only agent flows route safely. Once linked, list users with:

Automatic Notifications

Before you touch broadcasts or journeys, Shoppex already sends Telegram messages automatically when:
  • An order is confirmed
  • A product comes back in stock
  • You create promotional broadcasts for opted-in users
These messages respect each user’s notification preferences. This is the default behavior — most shops start here and add broadcasts or journeys later.

Notification Preferences

Each user has a notification_preferences object that controls what they receive. Update a single user:
Bulk update multiple users:

Broadcasts

Broadcasts let you send messages to a filtered audience — immediately or scheduled. A broadcast request has three parts:
URL buttons are automatically wrapped in Shoppex tracking links, so you get click-through rates and revenue attribution for free.
Broadcasts move through these states: DRAFT → SCHEDULED → SENDING → COMPLETED / CANCELLED / FAILED

Warehouse Restock Broadcasts

For product-specific restocks, use the dedicated endpoint — Shoppex generates the message around the product data:

Saved Segments

When you find yourself targeting the same audience across multiple broadcasts, save it as a segment:
Then reference it in any broadcast:
Manage segments with GET, PUT, and DELETE on /dev/v1/telegram/bots/:botId/segments/:segmentId.

Analytics and Click Tracking

Shoppex tracks URL button clicks per broadcast and attributes completed orders back to the broadcast that drove them.
The attribution flow: you send a broadcast with a product button → Shoppex rewrites the URL to a tracking link → customer clicks → Shoppex records the click and redirects to the product page → if the customer completes an order within the attribution window, the revenue counts back to that broadcast.

Journeys

Journeys are event-driven follow-up flows — think “post-purchase drip” or “abandoned cart reminder” without sending each message manually.

Supported Triggers

Example: Post-Purchase Follow-Up

The journey fires when a customer completes an order, sends the first message immediately, and queues the follow-up for 24 hours later. Test journeys before going live with POST /dev/v1/telegram/bots/:botId/journeys/:journeyId/test.

Preference Center and Inbox

The bot doubles as a two-way support channel. Customer commands: Merchant inbox endpoints:
  • GET /dev/v1/telegram/bots/:botId/inbox — list conversations
  • GET /dev/v1/telegram/bots/:botId/inbox/:conversationId — read a conversation
  • POST /dev/v1/telegram/bots/:botId/inbox/:conversationId/reply — send a reply
  • PUT /dev/v1/telegram/bots/:botId/inbox/:conversationId/status — close or reopen

AI Agent

The AI agent routes inbound Telegram messages through Shoppex’s commerce tools — product search, order lookup, coupon creation, payment links, and more.

Agent Modes

Enable the Agent

When enabled, Shoppex provisions a shop-scoped Dev API key for the bot, stores inbound messages as inbox history, routes them to the AI model, and sends the response back to Telegram.

Usage Stats

A customer asking “Do you have the hoodie in black?” gets a product search and direct answer. A merchant saying “Create a 15% coupon for the hoodie” gets a coupon created through the Dev API. The estimated_cost_usd field tracks AI token costs so there are no surprises on your bill.

Lifecycle and Monitoring

Track broadcast delivery with:
  • GET /dev/v1/telegram/bots/:botId/broadcasts — list all
  • GET /dev/v1/telegram/bots/:botId/broadcasts/:id — single broadcast
  • GET /dev/v1/telegram/bots/:botId/broadcasts/:id/stats — delivery progress
  • GET /dev/v1/telegram/bots/:botId/analytics — bot-level analytics
The broadcast response groups delivery progress under delivery: sent_count, failed_count, progress_percentage, estimated_time_remaining_seconds, and failure_reasons.

Next Steps

Developer API Quickstart

Set up your API key and make your first call

Authentication

Scopes, API keys, and OAuth2 for Telegram integrations

Webhooks Guide

Listen for order events that trigger Telegram journeys

Payments Guide

Create payment links that your bot can share