Developers

Developer API

Automate buying numbers and fetching OTP codes with a clean REST API and a single key.

Base URLhttps://xthonvirtual.store/api/v2
Get your API key
01

Authentication

Send your personal API key in a header with every request. Get it from the bot under πŸ”‘ API.

X-API-Key: YOUR_API_KEY
02

Quick start

Check your balance, then: list services β†’ buy a number β†’ poll for the code.

curl -X GET "https://xthonvirtual.store/api/v2/balance" \
  -H "X-API-Key: YOUR_API_KEY"
03

Endpoints

GET/balance

Get your current balance and bonus tier.

curl -X GET "https://xthonvirtual.store/api/v2/balance" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "ok": true,
  "data": { "balance": "12.50", "bonus": 10 }
}
GET/services

List active services with their price and live stock.

curl -X GET "https://xthonvirtual.store/api/v2/services" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "ok": true,
  "data": [
    { "id": "8f3c…", "name": "Telegram", "price": "1.20", "stock": 42 }
  ]
}
POST/services/{service_id}/buy

Reserve and buy one number from a service.

curl -X POST "https://xthonvirtual.store/api/v2/services/{service_id}/buy" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "ok": true,
  "data": {
    "id": "tx_91a…", "status": "PENDING",
    "price": "1.20", "number": "+15550001", "code": null
  }
}
GET/transactions/{id}

Fetch a transaction (number) you own.

curl -X GET "https://xthonvirtual.store/api/v2/transactions/{id}" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "ok": true,
  "data": { "id": "tx_91a…", "status": "PENDING", "number": "+15550001", "code": null }
}
GET/transactions/{id}/code

Poll for the OTP code β€” returns null until it arrives.

curl -X GET "https://xthonvirtual.store/api/v2/transactions/{id}/code" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "ok": true,
  "data": { "id": "tx_91a…", "status": "SUCCEEDED", "code": "54321" }
}
POST/transactions/{id}/cancel

Refund a PENDING number that never received a code.

curl -X POST "https://xthonvirtual.store/api/v2/transactions/{id}/cancel" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "ok": true,
  "data": { "refunded": "1.20" }
}

Wholesale via API tokens

Buying at volume? Use API tokens to purchase numbers in bulk programmatically, with the best per-unit pricing and dedicated support for resellers.

Contact us for wholesale
04

Status codes

200Success
401Missing or invalid API key
402Insufficient balance
404Not found
409Out of stock