REST API
Base URL
Section titled “Base URL”https://api.tonramp.ioEndpoints
Section titled “Endpoints”POST /api/v1/wallet/trp/generate
Section titled “POST /api/v1/wallet/trp/generate”Generates a TRP payload and returns the links.
Request:
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" }'Response (200):
{ "success": true, "payload": "trp010148UQBJ6gU8...", "deep_link": "https://trp.tonramp.io/trp01...", "telegram_link": "https://t.me/TonRmpBot/tonramp?startapp=trp01...",}Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
wallet | string | Yes | Destination TON address (10-48 chars) |
merchant | string | Yes | Merchant ID (max 32 chars) |
amount | string | Yes | Amount in the currency (e.g., “100.00”) |
currency | string | No | Currency: BRL, USD, EUR, TON (default: BRL) |
tx_id | string | No | Transaction ID (generated if omitted) |
GET /api/v1/trp/status/{tx_id}
Section titled “GET /api/v1/trp/status/{tx_id}”Checks the status of a TRP transaction.
Request:
curl https://api.tonramp.io/api/v1/trp/status/tx123456Response (200):
{ "status": "pending", "amount": "10000", "currency": "BRL", "updated_at": "2025-03-05T12:00:00Z"}Response (404):
{ "detail": "Transaction not found"}Possible Statuses:
| Status | Description |
|---|---|
pending | Awaiting payment |
paid | Payment received |
completed | Transaction completed |
expired | Transaction expired |
POST /api/v1/trp/preference
Section titled “POST /api/v1/trp/preference”Saves the user’s platform preference in a cookie.
Request:
curl -X POST https://api.tonramp.io/api/v1/trp/preference \ -H "Content-Type: application/json" \ -d '{"platform": "telegram"}'Response (200):
{ "success": true, "platform": "telegram"}Accepted platforms: telegram, google (web)
The tonramp_platform cookie is set with SameSite=None to work cross-origin.
Rate Limiting
Section titled “Rate Limiting”| Endpoint | Limit |
|---|---|
POST /api/v1/wallet/trp/generate | 30/minute |
GET /api/v1/trp/status/\{tx_id\} | 60/minute |
POST /api/v1/trp/preference | 10/minute |
Responses exceeding the rate limit return HTTP 429 Too Many Requests.