Reseller API
Authenticate with X-Api-Key or Authorization: Bearer. Manage keys in Settings.
Endpoints
- GET /api/v1/countries
- GET /api/v1/services?country=US&q=whatsapp
- POST /api/v1/purchase
- POST /api/buy-number (5SIM → SMS-Activate fallback; debit on success)
- GET /api/v1/otp/:orderId
- GET /api/stream/otp/:orderId (SSE; client may poll as fallback)
- POST /api/v1/cancel/:orderId
- GET /api/v1/balance
Wallet debits use interactive DB transactions (ACID). Order TTL and cancel windows are server settings. Live OTP prefers SSE with polling fallback in the portal.
cURL
curl -s "https://tempempire.com/api/v1/countries" \ -H "X-Api-Key: te_live_YOUR_API_KEY"
Python
import requests
headers = {"X-Api-Key": "te_live_YOUR_API_KEY"}
countries = requests.get("https://tempempire.com/api/v1/countries", headers=headers).json()
services = requests.get("https://tempempire.com/api/v1/services", params={"country": "US"}, headers=headers).json()
order = requests.post("https://tempempire.com/api/v1/purchase", json={
"countryCode": "US", "serviceSlug": "whatsapp", "server": 1
}, headers=headers).json()
otp = requests.get(f"https://tempempire.com/api/v1/otp/{order['order']['id']}", headers=headers).json()
balance = requests.get("https://tempempire.com/api/v1/balance", headers=headers).json()JavaScript
const headers = { "X-Api-Key": "te_live_YOUR_API_KEY", "Content-Type": "application/json" };
const countries = await fetch("https://tempempire.com/api/v1/countries", { headers }).then(r => r.json());
const order = await fetch("https://tempempire.com/api/v1/purchase", {
method: "POST", headers,
body: JSON.stringify({ countryCode: "US", serviceSlug: "telegram", server: 1 })
}).then(r => r.json());
const otp = await fetch(`https://tempempire.com/api/v1/otp/${order.order.id}`, { headers }).then(r => r.json());PHP
<?php
$headers = ["X-Api-Key: te_live_YOUR_API_KEY", "Content-Type: application/json"];
$ch = curl_init("https://tempempire.com/api/v1/balance");
curl_setopt_array($ch, [CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true]);
echo curl_exec($ch);