Documentación de la API

Una API REST limpia para números, códigos y eSIMs. Autentica, compra, consulta — tres llamadas y tienes tu código.

Autenticación

Crea una clave de API en tu panel y envíala en cada petición:

Authorization: Bearer sk_live_your_api_key

Límite: 60 peticiones/minuto por clave (por defecto). Las respuestas incluyen headers X-RateLimit-*.

GET/api/v1/balance

Get balance

Returns your wallet balance in USD.

Petición

curl https://tempsmsnow.com/api/v1/balance \
  -H "Authorization: Bearer sk_live_..."

Respuesta

{
  "balance": 12.50,
  "available": 12.10,
  "reserved": 0.40,
  "currency": "USD"
}
GET/api/v1/sms/prices

List services & prices

Without params, lists all services. With ?service=whatsapp, lists countries with live price and stock.

Petición

curl "https://tempsmsnow.com/api/v1/sms/prices?service=whatsapp" \
  -H "Authorization: Bearer sk_live_..."

Respuesta

{
  "service": "whatsapp",
  "countries": [
    { "country": "US", "name": "United States", "price": 0.35, "available": 12043 },
    { "country": "BR", "name": "Brazil", "price": 0.10, "available": 98220 }
  ]
}
GET/api/v1/sms/routes

List servers for a route (price + measured delivery)

Every server that can sell this service in this country, with its own price, stock and the delivery rate WE measured on real orders (not the provider's claim). delivery.level: high ≥ 80%, good ≥ 60%, fair ≥ 30%, low < 30%, unknown = no sample yet; scope "route" = measured on this exact service+country, "server" = borrowed from the server's other routes. Use `server` in the purchase call to buy through a specific one and get predictable pricing.

Petición

curl "https://tempsmsnow.com/api/v1/sms/routes?service=whatsapp&country=US" \
  -H "Authorization: Bearer sk_live_..."

Respuesta

{
  "service": "whatsapp",
  "country": "US",
  "servers": [
    { "server": 2, "label": "Server 2", "price": 0.35, "available": 12043,
      "delivery": { "level": "high", "min_rate": 80, "scope": "route" } },
    { "server": 5, "label": "Server 5", "price": 0.24, "available": 310978,
      "delivery": { "level": "unknown", "min_rate": null, "scope": null } }
  ]
}
POST/api/v1/sms/purchase

Buy a number

Buys a number for the given service and country. Balance is reserved and only charged when the SMS code arrives. Optional `server` (from /sms/routes) buys through that server only — you pay exactly its price and we never deliver through another one; without it, we route automatically with fallback. The response tells you which server was used.

Petición

curl -X POST https://tempsmsnow.com/api/v1/sms/purchase \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"service": "whatsapp", "country": "US", "server": 2}'

Respuesta

{
  "order": {
    "id": "3f7c9e0a-...",
    "service": "whatsapp",
    "country": "US",
    "phone": "+12025550123",
    "status": "active",
    "price": 0.35,
    "server": 2,
    "server_label": "Server 2",
    "expires_at": "2026-08-10T22:20:00.000Z"
  }
}
GET/api/v1/sms/orders/{id}

Check order / get code

Poll this endpoint (every 2-5s) until status becomes `completed` — the SMS code will be in `code`.

Petición

curl https://tempsmsnow.com/api/v1/sms/orders/3f7c9e0a-... \
  -H "Authorization: Bearer sk_live_..."

Respuesta

{
  "order": {
    "id": "3f7c9e0a-...",
    "status": "completed",
    "phone": "+12025550123",
    "server": 2,
    "code": "482913",
    "text": "Your WhatsApp code is 482913"
  }
}
POST/api/v1/sms/orders/{id}/cancel

Cancel order

Cancels an active order before the code arrives. The reserved amount is fully released back to your balance.

Petición

curl -X POST https://tempsmsnow.com/api/v1/sms/orders/3f7c9e0a-.../cancel \
  -H "Authorization: Bearer sk_live_..."

Respuesta

{
  "order": { "id": "3f7c9e0a-...", "status": "cancelled", "refunded": true }
}
GET/api/v1/esim/packages

List eSIM packages

Without params, lists destination country codes. With ?destination=US, lists available data packages.

Petición

curl "https://tempsmsnow.com/api/v1/esim/packages?destination=US" \
  -H "Authorization: Bearer sk_live_..."

Respuesta

{
  "packages": [
    {
      "id": "85d45f33-...",
      "name": "USA 5GB · 30 days",
      "data_mb": 5120,
      "validity_days": 30,
      "countries": ["US"],
      "price": 13.50
    }
  ]
}
POST/api/v1/esim/purchase

Buy an eSIM

Buys the package and charges your balance. Poll the order for the QR code.

Petición

curl -X POST https://tempsmsnow.com/api/v1/esim/purchase \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"package_id": "85d45f33-..."}'

Respuesta

{
  "order": { "id": "b8a1c2d3-...", "status": "provisioning", "price": 13.50 }
}
GET/api/v1/esim/orders/{id}

Get eSIM / QR code

Poll until status becomes `delivered` — then `qr_code_url` and `activation_code` are available.

Petición

curl https://tempsmsnow.com/api/v1/esim/orders/b8a1c2d3-... \
  -H "Authorization: Bearer sk_live_..."

Respuesta

{
  "order": {
    "id": "b8a1c2d3-...",
    "status": "delivered",
    "iccid": "8910001234567890",
    "qr_code_url": "https://...",
    "activation_code": "LPA:1$rsp.example.com$ABC-123"
  }
}

Errores

  • 401 unauthorized — Clave de API ausente o inválida.
  • 402 insufficient_balance — Saldo insuficiente — recarga tu cartera.
  • 404 no_offers / not_found — Sin stock para esa combinación, o recurso no encontrado.
  • 429 rate_limited — Límite excedido — reduce el ritmo.
  • 502 purchase_failed — Fallo del proveedor — no se te cobró.