Overview
The XeroSMS Developer API lets external platforms access our SMS services programmatically. Generate an API key from your profile page and use it to authenticate all API requests.
All API responses follow a consistent envelope format withsuccess,statusCode, andmessagefields.
Authentication
Before using the API, generate an API key from your profile page. Every request must include the key in the header:
X-Api-Key: xero_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSecurity tip
SMS Service
Base URL:/api/v1/public/sms-service
/api/v1/public/sms-service/servicesGet all services
Retrieve the list of supported SMS services.
{
"success": true,
"statusCode": 200,
"message": "services retrieved successfully",
"data": [
{ "ID": 1, "name": "Service Name", "favourite": 0 }
]
}/api/v1/public/sms-service/services/:serviceId/countriesGet available countries
Retrieve pricing and availability for a specific service by country.
{
"success": true,
"statusCode": 200,
"message": "service countries retrieved successfully",
"data": [
{
"country": 1,
"success_rate": "95.00",
"price": "1.25",
"low_price": "1.10",
"country_id": 1,
"name": "United States",
"short_name": "US"
}
]
}price and low_price already include the service charge markup configured in the system./api/v1/public/sms-service/orderPlace an order
Place a new SMS service order. The cost is deducted atomically from the API key owner's balance.
- Cost is calculated from the displayed country price.
- Balance is deducted atomically from the key owner.
{
"serviceId": "123",
"countryId": "US"
}{
"success": true,
"statusCode": 200,
"message": "order created successfully",
"data": {
"order": {
"id": "uuid",
"serviceId": "123",
"countryId": "US",
"orderId": "sub-order-id",
"phoneNumber": "+1234567890",
"number": "1234567890",
"pool": "1",
"cc": "1",
"country": "United States",
"service": "Service Name",
"status": "pending",
"cost": 1.25,
"createdAt": "...",
"updatedAt": "..."
},
"remainingBalance": 48.75
}
}/api/v1/public/sms-service/ordersList API orders
Returns only orders placed with the authenticated API key.
Optional query params:
searchTerm— search by orderId, country, service, phoneNumber, numberstatus— pending, completed, cancelled, refunded, expiredpage,limit,sortBy,sortOrder
/api/v1/public/sms-service/orders/:orderIdGet single order
Retrieve local order information and live provider details. Pool in every 5s if local status is pending
{
"success": true,
"statusCode": 200,
"message": " order retrieved successfully",
"data": {
"info": { /* local Order record */ },
"details": { /* live info and sms text from provider if available */ }
}
}/api/v1/public/sms-service/orders/:orderIdUpdate order (refund)
Cancel and refund an order placed via the API.
{
"status": "refunded"
}Important Notes
Key Storage
The raw API key is shown only once during creation or regeneration. Store it securely and never expose it in frontend client-side code.
Error Handling
Common errors: 401 Unauthorized, 400 Bad Request (insufficient balance), 502 Bad Gateway (provider failure with auto-refund).