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 through Telegram.
4

Send a broadcast

Once customers connect, you can send broadcasts, set up journeys, or enable the AI agent.
Your bot is now live. The sections below cover notifications, broadcasts, journeys, the inbox, and the AI agent.

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 https://t.me/<bot_username>?start=shop:<shop_id>. Add context to the link for richer linking: The bot response includes the merchant deep link pre-built under connection.merchant_deep_link_url. It binds the Telegram chat to a Shoppex manager, so merchant-only agent flows route safely. List linked users:

Notifications

Shoppex sends Telegram messages automatically for order confirmations, restock alerts, and promotional broadcasts. Each user’s notification_preferences object controls what they receive, and the defaults apply until you change them. Update a single user:
Update multiple users at once:

Broadcasts

A broadcast sends a message to a filtered audience, right away or on a schedule. 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. For product-specific restocks, use the dedicated endpoint. Shoppex builds the message from the product data:

Saved segments

Save a repeated audience filter as a segment:
Reference the saved segment in any broadcast with audience.segment_ids: ["<segment_id>"]. 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:
  1. You send a broadcast with a product button.
  2. Shoppex rewrites the URL to a tracking link.
  3. The customer clicks, and Shoppex records the click before it redirects to the product page.
  4. If the customer completes an order inside the attribution window, the revenue counts back to that broadcast.
The response overview object reports: Each entry in the buttons array reports button_id, text, destination_url, unique_clicked_users, and click_count. Track delivery and bot-level performance with:
  • GET /dev/v1/telegram/bots/:botId/broadcasts — list all broadcasts
  • GET /dev/v1/telegram/bots/:botId/broadcasts/:id — a 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.

Journeys

Journeys are event-driven follow-up flows, such as a post-purchase drip or an abandoned-cart reminder. Shoppex sends each message on its own schedule, so you do not send them by hand. Example post-purchase follow-up:
This journey fires when a customer completes an order. It sends the first message immediately and queues the follow-up for 24 hours later. Test a journey before you turn it on with POST /dev/v1/telegram/bots/:botId/journeys/:journeyId/test.

Support commands 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 commerce tools: product search, order lookup, coupon creation, and payment links. Enable the agent:
When you enable the agent, Shoppex creates a shop-scoped Dev API key for the bot. It stores inbound messages as inbox history, routes each message to the AI model, and sends the response back to Telegram. Check usage:
The response reports calls, completed_calls, failed_calls, rate_limited_calls, conversations, total_tokens, estimated_cost_usd, average_response_time_ms, and last_run_at. A customer asking “Do you have the hoodie in black?” gets a product search and a 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.