SMSVerifier offers dedicated API endpoints to quickly check your account balance and fetch recent transaction history by specifying appropriate action parameters in your API requests.
Overview of Balance and Transaction Endpoints
SMSVerifier provides a streamlined RESTful API interface to manage your virtual phone number verification needs. Among its features, you can programmatically check your current account balance and review recent transaction history. This is accomplished via two main API endpoints exposed through the same handler script, distinguished by the action query parameter.
All API calls require a valid API key passed as a parameter for authentication. Requests are made via HTTP GET method to the handler_api.php endpoint.
The two primary actions relevant here are:
- getBalance: Returns your current account balance.
- getTransactions: Returns a list of recent transactions tied to your account.
These endpoints help you track your spending and ensure you have enough funds for ongoing SMS verifications.
Checking Account Balance
To check your SMSVerifier account balance, you send an HTTP GET request to the API handler with the following parameters:
api_key: Your personal API key (required)action=getBalance: Specifies the balance-check action
The balance is usually returned as a plain number representing your available funds in USD, for example 25.43. This allows your application to programmatically monitor funds and notify you when topping up is needed.
curl "https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance"
Cache the balance response for a short duration (e.g., 1 minute) in your app to avoid excessive API calls and rate limiting.
Retrieving Transaction History
The transaction history endpoint lets you fetch recent transactions made on your SMSVerifier account. This includes purchases and any refunds or credits applied.
To access transaction history, send a GET request with:
api_key: Your API keyaction=getTransactions: Request to retrieve transactions
The response includes transaction IDs, timestamps, amounts, and statuses.
curl "https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getTransactions"
Currently, the transaction endpoint does not support pagination or filters. Responses may be limited to recent transactions only, so plan accordingly.
Response Data Format and Examples
By default, the API returns plain text or simple JSON, depending on the endpoint and parameters used.
For getBalance, the API returns a numeric string representing your balance:
42.75
For getTransactions, a typical JSON response looks like this:
{
"transactions": [
{
"id": "TX123456",
"date": "2024-05-20T14:33:00Z",
"amount": -1.20,
"type": "purchase",
"status": "completed"
},
{
"id": "TX123457",
"date": "2024-05-21T09:15:00Z",
"amount": 1.20,
"type": "refund",
"status": "completed"
}
]
}
Amounts are expressed in USD. Negative values indicate debits; positive values indicate credits or refunds.
Best Practices for API Integration
Secure your API key
Never expose your API key publicly. Store it securely server-side and restrict usage via IP whitelisting if available.
Optimize request frequency
Limit balance and transaction checks to reasonable intervals to prevent hitting rate limits.
Log transactions locally
Maintain a local cache of transaction history for reporting and reconciliation purposes.
Frequently asked questions
How do I check my SMSVerifier account balance using the API?
Is there an API endpoint to retrieve my transaction history?
What format is the response data for balance and transactions?
Can I filter or paginate transaction history via the API?
Where can I find detailed API documentation for these endpoints?
Ready to integrate SMSVerifier account balance and transaction APIs?
Explore our API documentation now and start building automated balance checks and transaction tracking.
Read the API docs