DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

Build a Vue 3 Telegram Mini App Storefront with Pinia and Native Invoices

Use Vue 3 and Pinia for the Mini App storefront, then let a trusted bot backend create invoices, validate Telegram launch data, and confirm payment before fulfillment.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build the storefront in Vue 3, use Pinia for catalog, cart, and shared checkout state, and let a trusted bot backend create invoices and confirm payment. The payment path depends on what you sell: digital goods and services sold inside Telegram apps must use Telegram Stars (XTR); physical goods use a provider-based payment flow.

Choose the Telegram payment flow for your product

Decide whether the item is digital or physical before designing checkout. Telegram’s rules distinguish the two:

As an Amazon Associate I earn from qualifying purchases.

What you sell Payment method inside Telegram What to account for
Digital goods or services Telegram Stars, currency code XTR. Telegram requires Stars for these sales inside Telegram apps, even if the merchant also sells through a website or another external provider. Telegram Stars payments The bot creates the Stars invoice; a third-party provider token is not required for this digital-goods flow. Telegram Stars payments
Physical goods A provider-based payment flow. Telegram’s payment documentation distinguishes physical goods from digital goods, and its Mini Apps introduction describes physical products purchased through third-party providers. Bot payments; Mini Apps A provider token is needed for physical-goods sales. Choose the provider only after establishing your merchant country, accepted methods, currency, fees, settlement, refunds, and integration needs. Bot payments

The documentation establishes the payment distinction, not a universal provider, tax setup, shipping service, or refund policy. Those depend on your product and business location.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I use Pinia with Vue 3?

Install Pinia once on the Vue application, then put state and business logic shared across views into stores. For a storefront, that commonly means catalog data, cart contents, and checkout state that multiple components need. Keep view-only details—such as whether one component’s local dialog is open—in that component rather than promoting every value into global state. Pinia describes stores as a place for state and business logic that extends beyond a single component tree. Pinia introduction

#1 Best Overall
Teacher Record Book
  • Keep track of everything from attendance to test scores
  • Spiral bound
  • Measures 8-1/2" x 11"
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'

const app = createApp(App)
app.use(createPinia())
app.mount('#app')

Vue recommends Pinia for new applications that need state management. If you later add server-side rendering, scope app and store instances per request; a module-level singleton holding per-user state can leak data between requests. Vue state management

How do I accept payments in a Telegram Mini App?

Use the Mini App for the customer-facing catalog and checkout interface, but keep invoice creation, payment validation, and fulfillment on the backend. The browser is not the authority for either the customer’s identity or whether an order was paid.

Rank #2
Elan Publishing Company Oversize Record Book for 6-10 Weeks; Extra-Large Squares (1/4") 42 Student Names (King Record)
  • 11" x 13" Over-sized Teacher Record Book
  • No more squinting!
  • 11" x 13" page size
  • Seating charts
  1. Load Telegram’s Mini App client script. Use the documented WebApp interface for platform integration. Telegram Mini Apps
  2. Send raw launch data to your backend. Send Telegram.WebApp.initData for server-side validation before using Telegram identity or launch parameters for authorization. Do not treat initDataUnsafe as trusted; Telegram warns, “WARNING: Data from this field should not be trusted.” Telegram Mini Apps
  3. Have the backend create or retrieve the invoice link. The server should select the appropriate payment path for the product and generate an invoice using the bot payment flow. Bot payments; Telegram Stars payments
  4. Open the invoice after a user action. Pass the resulting URL to Telegram.WebApp.openInvoice(url[, callback]). Telegram documents this method for opening an invoice from the Mini App. Telegram Mini Apps
  5. Handle pre-checkout on the bot. Implement the pre-checkout query step required by Telegram’s bot payment lifecycle; do not deliver goods merely because the client opened an invoice. Bot payments
  6. Fulfill only after successful payment reaches the server. Process Telegram’s successful-payment update on the backend, associate it with the order, and grant digital access or arrange physical-goods fulfillment there. Store the Telegram payment charge ID, which Telegram says may be needed for a future refund. Bot payments

How do I open a Telegram invoice from a Mini App?

The frontend should request an invoice URL from your backend, then call the Mini App invoice API in response to a deliberate checkout action. The documented openInvoice method presents Telegram’s invoice popup over the Mini App rather than closing the app. Telegram Mini Apps; Mini App events

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
async function startCheckout() {
  const response = await fetch('/api/checkout/invoice', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ productId: selectedProductId }),
  })

  if (!response.ok) throw new Error('Could not create invoice')

  const { url } = await response.json()
  Telegram.WebApp.openInvoice(url, (status) => {
    // Update the interface with the popup result.
    // The backend's successful-payment update remains authoritative.
    console.log(status)
  })
}

When the popup closes, the Mini App receives an invoiceClosed event; its status can be paid, cancelled, failed, or pending. Telegram’s web-event documentation names the event invoice_closed and the opening event web_app_open_invoice. Treat the popup result as interface feedback, not proof that the server has received a successful-payment update. Mini App events

Rank #3
Elan Publishing Company Class Record Book for up to 10 Weeks. 50 Names. Extra Large Grade Recording Squares. (R9310)
  • 8 1/2 x 11 Teacher Record Book with unique 7 1/2" fold out flap
  • Grade recording sheets for up to 10 weeks in length
  • Columns for weekly averages, major tests, progress reports, parent conferences, and more
  • Enough lines for 50 students on each page, with extra-large grade recording squares
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What belongs in the frontend, and what must stay on the server?

  • Frontend and Pinia: shared catalog and cart state, checkout progress needed across views, and display of the invoice popup outcome.
  • Backend: validation of raw initData, invoice creation, bot pre-checkout handling, processing successful-payment updates, order status, and fulfillment decisions.
  • Do not trust client state as payment evidence: a browser callback can describe what happened to the popup, but the server-side successful-payment update determines whether the order is paid.

Telegram’s payment documentation describes the bot-side sequence as invoice creation, pre-checkout handling, and a later successful-payment update. Build order fulfillment around that server-side lifecycle, not around a client-side state change. Bot payments

Quick Recap

Bestseller No. 1
Teacher Record Book
Teacher Record Book
Keep track of everything from attendance to test scores; Spiral bound; Measures 8-1/2" x 11"
$4.89
Bestseller No. 2
Elan Publishing Company Oversize Record Book for 6-10 Weeks; Extra-Large Squares (1/4') 42 Student Names (King Record)
Elan Publishing Company Oversize Record Book for 6-10 Weeks; Extra-Large Squares (1/4") 42 Student Names (King Record)
11" x 13" Over-sized Teacher Record Book; No more squinting!; 11" x 13" page size; Seating charts
$11.60
Bestseller No. 3
Elan Publishing Company Class Record Book for up to 10 Weeks. 50 Names. Extra Large Grade Recording Squares. (R9310)
Elan Publishing Company Class Record Book for up to 10 Weeks. 50 Names. Extra Large Grade Recording Squares. (R9310)
8 1/2 x 11 Teacher Record Book with unique 7 1/2" fold out flap; Grade recording sheets for up to 10 weeks in length
$12.95
Bestseller No. 4
Teacher Modern Farmhouse Record Book
Teacher Modern Farmhouse Record Book
8-1/2" x 11", 64 pages; Spiral bound
$14.00
Rank #4
Teacher Modern Farmhouse Record Book
  • Keep all your important information at your fingertips with this inspiring and stylish record book. Plenty of space is provided to record grades for assignments, tests, attendance, or other notations. Each two-page spread allows enough space for 10 weeks worth of record keeping.
  • Convenient, perforated pages allow for easy management of larger classes. An easy-to-use grading chart is also provided.
  • 8-1/2" x 11", 64 pages
  • Spiral bound

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.