Get balance
Read the current account balance.
Authentication
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
apikey | header | string | Yes | Your API key |
Parameters
No path or query parameters. No request body.
How to use this method
Check the balance available in your account. The response returns data.balance as a string, so keep that type when displaying the amount.
Request examples
Runtime requirements and environment setup. cURL uses a POSIX shell. JavaScript and TypeScript run in Node.js. Java uses the standard HTTP client and prints raw JSON; use your application’s JSON library to inspect the body.
: "${SMSPVA_API_KEY:?Set SMSPVA_API_KEY}"
curl --fail-with-body --max-time 30 --request GET \
--url "https://api.smspva.com/activation/balance" \
--header "apikey: $SMSPVA_API_KEY"Responses
The examples below show the response format. Prices, stock and account values are sample data; use the API response for current values.
| HTTP | Description |
|---|---|
| 200 | Successful operation |
| 400 | The apikey header is missing, empty or invalid in length. |
HTTP 200
Successful operation
Illustrative response
{
"statusCode": 200,
"data": {
"balance": "10.50"
}
}Response fields
| Name | Type | Description |
|---|---|---|
statusCode | integer | Result status code |
data | object | Response data |
data.balance | string | Balance |
HTTP 400
The apikey header is missing, empty or invalid in length.
Illustrative response
{
"statusCode": 400,
"error": {
"type": "APIKEY_NOT_SET",
"description": "No ApiKey found"
}
}Response fields
| Name | Type | Description |
|---|---|---|
statusCode | integer | |
error | object | |
error.type | string | |
error.description | string |
Related guides
If a connection fails during an order-changing request, check the order before trying again.