Targeted Virtual Number Purchase
POST
/api/v1/purchase
Alias: /api/purchase
X-NexNum-Key
Acquires a NexNum number, runs a silent platform check, queues mismatches for refund, and returns the NexNum order_id upon matching target_status.
Request
Parameters
| Field | Type | Default | Description |
|---|---|---|---|
platform Req |
string |
— |
Active slug from /api/platforms. |
target_status Opt |
string |
"NOT_REGISTERED" |
NOT_REGISTERED (fresh) or REGISTERED. |
service_code Opt |
string |
Auto | NexNum service override. |
country_code Opt |
string |
"22" |
NexNum country ID (22 = India). |
max_attempts Opt |
int |
5 |
Max cycles (1..20). |
api_key Cond |
string |
null |
Caller's NexNum key (or via X-NexNum-Key header). |
200 OK Response
JSON
Poll OTPs (action=getStatus) or complete activation (action=setStatus&status=6) via NexNum API Docs.
Deferred Cancel Queue (api/cancel_queue.py)
| Parameter | Value | Behavior |
|---|---|---|
CANCEL_MIN_AGE | 60s | Cooldown before background worker fires setStatus=8. |
CANCEL_POLL_SECS | 30s | Sweep interval running matured cancellations via asyncio.gather. |
max_retry | 4 cycles | Max retries (~2 min) before dropping. |
CANCEL_TERMINAL | BAD_STATUS, BAD_KEY, BANNED, ACCESS_ACTIVATION | Terminal states drop immediately from queue. |
Checker Engines (checkers/)
| Platform | Status | Code |
|---|---|---|
| Loading... | ||
Rules & Notes
Rules:
BAD_KEY (400) & NO_BALANCE/BANNED (402) stop immediately. Two consecutive inconclusive checks (ERROR/TIMEOUT/UNKNOWN/DISABLED) abort with 422 CHECKER_INCONCLUSIVE. Keep max_attempts within Nginx 60s timeout.
Test Bypass:
ENVIRONMENT=testing or X-Test-Bypass: 1 injects tg_99999999. Never enable in production.