Skip to content

REST API

https://api.tonramp.io

To use the partner REST API you need an API key in the format tonr_<prefix>_<secret>, created in the partner console.

Console access is via magic link:

  1. Send POST /v1/partner/auth/request-link with the registered e-mail.
  2. You receive a link by e-mail; opening it makes the session issue a JWT token.
  3. With the owner session, create an API key via POST /v1/partner/api-keys. The raw key is shown only once — store it securely. It can be revoked at any time.

Send the API key in authenticated calls in the header:

Authorization: Bearer tonr_<prefix>_<secret>

Endpoints under /v1/partner/... (such as GET /v1/partner/transactions) use the partner’s session JWT token, also sent as Authorization: Bearer ....

Generates a TRP payload and returns the links.

Request:

Terminal window
curl -X POST https://api.tonramp.io/v1/wallet/trp/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer tonr_YOUR_API_KEY" \
-d '{
"wallet": "UQBJ6gU8gh_jRrzYDlfw9cpCwHaSn2mrK4O-1h8CDENehGYJ",
"merchant": "store123",
"amount": 100.00,
"currency": "USDT",
"tx_id": "tx123456"
}'

Response (200):

{
"success": true,
"payload": "trp010148UQBJ6gU8...",
"deep_link": "https://trp.tonramp.io/trp/trp01...",
"telegram_link": "https://t.me/TonRmpBot/tonramp?startapp=trp01...",
}

Parameters:

FieldTypeRequiredDescription
walletstringYesDestination TON address (10-48 chars)
merchantstringYesMerchant ID (max 32 chars)
amountstringYesAmount in USDT (e.g., “100.00” = 100.00 USDT)
currencystringNoFixed currency: USDT (default). Other values are rejected.
tx_idstringYesTransaction ID (max 64 chars)

Decodes a TRP payload and returns its fields.

Request:

Terminal window
curl -X POST https://api.tonramp.io/v1/wallet/trp/parse \
-H "Content-Type: application/json" \
-d '{"payload": "trp010148UQBJ6gU8gh_jRrzYDlfw9cpCwHaSn2mrK4O-1h8CDENehGYJ0208store1230305100000404USDT0508tx12345699045D57"}'

Response (200):

{
"success": true,
"data": {
"wallet": "UQBJ6gU8gh_jRrzYDlfw9cpCwHaSn2mrK4O-1h8CDENehGYJ",
"merchant": "store123",
"amount": 10000,
"currency": "USDT",
"tx_id": "tx123456",
"crc_valid": true
}
}

Validates the CRC of a TRP payload.

Terminal window
curl -X POST https://api.tonramp.io/v1/wallet/trp/validate \
-H "Content-Type: application/json" \
-d '{"payload": "trp010148UQBJ6gU8gh_jRrzYDlfw9cpCwHaSn2mrK4O-1h8CDENehGYJ0208store1230305100000404USDT0508tx12345699045D57"}'

Response: {"valid": true} or {"valid": false}


Checks the status of a TRP transaction.

Request:

Terminal window
curl "https://api.tonramp.io/v1/trp/status/tx123456?token=abc123def456"

Response (200):

{
"status": "pending",
"amount": "10000",
"currency": "USDT",
"updated_at": "2025-03-05T12:00:00Z"
}

Response (403): Invalid or missing token.

Response (404):

{
"detail": "Transaction not found"
}

Possible Statuses:

StatusDescription
pendingAwaiting payment
errorProcessing failure
paidPayment received, processing delivery
completedUSDT delivered, transaction completed
expiredExpired without payment

Saves the user’s platform preference in a cookie.

Request:

Terminal window
curl -X POST https://api.tonramp.io/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.


Paginated list of the partner’s TRP transactions. Use it for reconciliation.

Query params:

ParameterDescription
statusFilter by status (optional)
searchText search (optional)
limitItems per page, 1 to 200 (default per server)
offsetPagination offset

Request:

Terminal window
curl "https://api.tonramp.io/v1/partner/transactions?status=completed&limit=50&offset=0" \
-H "Authorization: Bearer <token>"

Response (200):

{
"items": [
{
"id": 123,
"parent_tx_id": "tx123456",
"partner_id": 7,
"partner_name": "store123",
"amount_brl": null,
"amount_usdt": 100.00,
"status": "completed",
"status_label": "completed",
"paid": true,
"completed": true,
"payer_wallet": "UQBJ6gU8gh_jRrzYDlfw9cpCwHaSn2mrK4O-1h8CDENehGYJ",
"unit_price": 1.0,
"service_fee": 1.0,
"created_at": "2026-03-26T12:00:00Z",
"expiration_time": "2026-03-26T12:30:00Z",
"close_time": "2026-03-26T12:05:00Z"
}
],
"total": 1,
"limit": 50,
"offset": 0
}

Each item contains the fields: id, parent_tx_id, partner_id, partner_name, amount_brl, amount_usdt, status, status_label, paid, completed, payer_wallet, unit_price, service_fee, created_at, expiration_time, close_time.

EndpointLimit
POST /v1/wallet/trp/generate30/minute
POST /v1/wallet/trp/parse30/minute
POST /v1/wallet/trp/validate30/minute
GET /v1/trp/status/\{tx_id\}60/minute
POST /v1/trp/preference10/minute

Responses exceeding the rate limit return HTTP 429 Too Many Requests.