Checkout
Checkout Flow
Section titled “Checkout Flow”- Your backend generates a TRP payload with the payment details
- The payload is sent to the frontend as a universal link
- The buyer scans the QR code or clicks the link
- The checkout page detects the platform:
- Telegram User-Agent → redirects to the bot
- Preference cookie → redirects as saved
- No preference → displays page with buttons (Telegram / Web)
- The buyer completes the payment
- Your system checks the status via API
Generating the Checkout
Section titled “Generating the Checkout”Via Web Generator
Section titled “Via Web Generator”Go to trp.tonramp.io and fill in the form with:
- Destination TON wallet
- Merchant ID
- Payment amount
- Currency
- Transaction ID (optional, generated automatically)
Via API
Section titled “Via API”curl -X POST https://api.tonramp.io/api/v1/wallet/trp/generate \ -H "Content-Type: application/json" \ -d '{ "wallet": "UQBJ6gU8gh_jRrzYDlfw9cpCwHaSn2mrK4O-1h8CDENehGYJ", "merchant": "store123", "amount": "100.00", "currency": "BRL", "tx_id": "tx123456" }'Via Code (client-side)
Section titled “Via Code (client-side)”import { generateTrpPayload } from '@/lib/trp'
const payload = generateTrpPayload( 'UQBJ6gU8gh_jRrzYDlfw9cpCwHaSn2mrK4O-1h8CDENehGYJ', 'store123', '100.00', 'BRL', 'tx123456')
const checkoutUrl = `https://trp.tonramp.io/${payload}`Checkout Page
Section titled “Checkout Page”The checkout page at trp.tonramp.io/\{payload\} displays:
- TonRamp logo
- Merchant name
- Formatted amount in the currency
- QR code with the universal link
- “Pay via Telegram” button
- “Pay via Browser” button
- Payment status (polling every 5 seconds)
Checking Status
Section titled “Checking Status”After the buyer accesses the link, you can check the status:
curl https://api.tonramp.io/api/v1/trp/status/{tx_id}Response:
{ "status": "pending", "amount": "10000", "currency": "BRL", "updated_at": "2025-03-05T12:00:00Z"}Possible statuses: pending, paid, completed, expired.