Customer API

Purchase a phone number

Purchase an SMS verification number. Balance is deducted immediately.

After purchase, poll GET /api/v1/customer/order/{orderId} every 3-5 seconds for SMS, or connect to wss://virtualsms.io/ws/orders for real-time delivery.

Cancel/swap policy: Orders can be cancelled or swapped after a 2-minute hold period from the time of purchase. This prevents abuse.

post/api/v1/customer/purchase

Request

  • Base URL: https://virtualsms.io
  • URL: https://virtualsms.io/api/v1/customer/purchase
  • Auth: API key in header X-API-Key

Request body

servicestring required

Service code (e.g. tg, wa, ig)

countrystring required

ISO country code (e.g. ID, PH, US)

Example request

{
  "service": "tg",
  "country": "ID"
}

Response

Number purchased successfully

successboolean
order_idstring uuid
phone_numberstring
servicestring
countrystring
pricenumber float
statusstring
expires_atstring date-time

Example response

{
  "success": true,
  "order_id": "550e8400-e29b-41d4-a716-446655440000",
  "phone_number": "628123456789",
  "service": "tg",
  "country": "ID",
  "price": 0.4,
  "status": "waiting",
  "expires_at": "2026-03-14T16:00:00+08:00"
}

Changes

No recorded changes to this operation across all 1 revision of this API.