Getting Started
Authentication
Every request must include your API key in the Authorization header. Find your key on your Profile page after signing in.
HTTP Header
Authorization: Bearer YOUR_API_KEY
⚠️ Keep your API key private. Anyone with your key can use your account balance. Regenerate it from your Profile page if compromised.
Account
Get Balance
Returns your current account balance in USD.
GET/api/v1/balance
JavaScript
const res = await fetch('https://codeflashnow.com/api/v1/balance', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
})
const data = await res.json()
console.log(data.balance_usd) // e.g. 5.2400
Response 200
{ "balance_usd": 5.2400, "currency": "USD" }
Data
List Countries
Returns all available countries. Use the key (e.g. russia, usa) in Services and Buy requests.
GET/api/v1/countries
JavaScript
const res = await fetch('https://codeflashnow.com/api/v1/countries', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
})
const countries = await res.json()
Response 200
{
"russia": { "text": "Russia" },
"usa": { "text": "United States" },
"england": { "text": "United Kingdom" },
...
}
List Services
Returns all available services for a country with price and stock. Available services are listed first.
GET/api/v1/services?country=russia
ParameterTypeRequiredDescription
countrystringYesCountry code from /countries (e.g. russia, usa)Response 200
[
{ "service": "whatsapp", "qty": 18423, "price_usd": 0.1700, "available": true },
{ "service": "telegram", "qty": 12100, "price_usd": 0.1400, "available": true },
...
]
Orders
Buy OTP Number
Purchase a virtual phone number. Balance is deducted immediately. Insufficient balance returns 422.
POST/api/v1/buy
FieldTypeRequiredDescription
countrystringYesCountry code (e.g. russia)servicestringYesService name (e.g. whatsapp, google)JavaScript
const res = await fetch('https://codeflashnow.com/api/v1/buy', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ country: 'russia', service: 'whatsapp' })
})
const order = await res.json()
// order.order_id, order.phone
Python
import requests
res = requests.post(
'https://codeflashnow.com/api/v1/buy',
headers={ 'Authorization': 'Bearer YOUR_API_KEY' },
json={ 'country': 'russia', 'service': 'whatsapp' }
)
order = res.json()
Response 201 Created
{
"order_id": 1042,
"phone": "+79161234567",
"country": "russia",
"service": "whatsapp",
"cost_usd": 0.1700,
"status": "waiting",
"expires_at": "2026-03-15T14:32:00.000Z"
}
Check OTP Status
Poll every 3–5 seconds until status is received, expired, cancelled, or refunded.
GET/api/v1/status/{order_id}
JavaScript — Polling Loop
async function waitForOtp(orderId) {
const DONE = ['received', 'expired', 'cancelled', 'refunded']
while (true) {
const res = await fetch(`https://codeflashnow.com/api/v1/status/${orderId}`, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
})
const data = await res.json()
if (data.status === 'received') return data.otp_code
if (DONE.includes(data.status)) throw new Error('Ended: ' + data.status)
await new Promise(r => setTimeout(r, 4000))
}
}
Response 200
{
"order_id": 1042,
"phone": "+79161234567",
"status": "received",
"otp_code": "492817",
"sms_text": "Your WhatsApp code: 492817. Do not share.",
"cost_usd": 0.1700,
"expires_at": "2026-03-15T14:32:00.000Z"
}
StatusMeaning
waitingNumber assigned, waiting for SMS
receivedOTP received — check
otp_codeexpired20-minute window passed, no SMS
cancelledCancelled manually, no refund
refundedCancelled within window, balance refunded
Cancel Order
Cancel a pending order. Full refund if cancelled within 20 minutes with no OTP received.
POST/api/v1/cancel/{order_id}
JavaScript
const res = await fetch(`https://codeflashnow.com/api/v1/cancel/${orderId}`, {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
})
const data = await res.json()
// { "refunded": true, "refund_amount": 0.17 }
Order History
Returns your paginated order history.
GET/api/v1/history?limit=20&page=1
ParameterTypeRequiredDescription
limitintegerNoPer page — default 20, max 100pageintegerNoPage number — default 1Response 200
{
"data": [ { "order_id": 1042, "phone": "+79161234567", "status": "received", "otp_code": "492817", ... } ],
"total": 47,
"page": 1,
"pages": 3
}
Reference
Errors & Rate Limits
All errors return JSON with an error field.
HTTP CodeMeaning
401Missing or invalid API key404Order not found or not yours422Validation error or insufficient balance429Rate limit exceeded503Provider temporarily unavailableRate limits per API key per minute:
EndpointLimit
GET /balance, /status, /history60 / minute
GET /countries, /services30 / minute
POST /buy, /cancel10 / minute