API keys and orders

Your keys, a shared TON balance and purchases directly through Fragment.

Create a key

Sign in with Telegram → Dashboard → API keys. Name the key and select its permissions. The secret appears once; store it on your application server. Revoke it in the dashboard when needed. No key from another purchase provider is required.

  • balance:read — read balance
  • orders:read — read your orders
  • orders:write — request quotes and create orders

Balance

Shell
curl https://frefrer.nowavpn.pro/api/v1/balance \
  -H "Authorization: Bearer YOUR_API_KEY"

The response contains wallet: currency, balanceMinor, reservedMinor and availableMinor. Currency is TON; all amounts are integer nanoton. 1 TON = 1,000,000,000 nanoton. The dashboard and API share one balance.

Get a quote

Shell
curl https://frefrer.nowavpn.pro/api/v1/quote \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product":"stars","recipient":"username","quantity":50}'

Stars: 50–100,000. Premium: product="premium", quantity=3, 6 or 12 months. The {quote} response includes id, amountMinor, currency and expiresAt. The price comes from Fragment; the total includes the service fee. No fixed exchange rate is promised.

Confirm an order

Shell
curl https://frefrer.nowavpn.pro/api/v1/orders \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: YOUR_UNIQUE_OPERATION_ID" \
  -d '{"quoteId":"QUOTE_ID_FROM_PREVIOUS_RESPONSE"}'

The first request returns 202 and {order}; funds are reserved. Repeating the same operation key and quoteId returns that order. After a network error, retry the same request with the same Idempotency-Key. Reusing the key with another quote returns 409.

Status and errors

HTTP
GET /api/v1/products
GET /api/v1/orders
GET /api/v1/orders/ORDER_ID
Authorization: Bearer YOUR_API_KEY
  • queued / processing — queued / processing; funds remain reserved.
  • delivered — the transaction and Fragment confirmation were received; balance debited.
  • failed — order failed; reservation released.
  • review — outcome needs reconciliation; funds stay reserved. Do not create a duplicate purchase.
  • 401 invalid_api_key / 403 insufficient_scope / 409 insufficient_funds / 410 quote_expired / 429 rate_limited / 503 purchases_not_configured.

Limit: 120 requests per minute per owner across keys and dashboard; quotes: 12 per minute. Honor Retry-After on 429. Purchases and deposits are currently disabled pending the service account verification on Fragment. Keys and balance reads are available.

API keys and orders · FRAGMENTAPI