Account
Balance
Returns the wallet balance of the account. Nothing else changed: the balance is a string in USD, as standard panels expect.
POST
https://notpanel.com/api/v3action=balance- API key required
- Rate limited
- Body:
application/x-www-form-urlencoded
Parameters
Always sent
keystringRequired- Your API key.
actionstringRequiredbalanceMust be the literal string "balance".
curl -X POST https://notpanel.com/api/v3 \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=YOUR_API_KEY&action=balance"const res = await fetch("https://notpanel.com/api/v3", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
key: "YOUR_API_KEY",
action: "balance",
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://notpanel.com/api/v3",
data={
"key": "YOUR_API_KEY",
"action": "balance",
},
)
print(res.json())<?php
$body = http_build_query([
'key' => 'YOUR_API_KEY',
'action' => 'balance',
]);
$response = file_get_contents('https://notpanel.com/api/v3', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $body,
'ignore_errors' => true,
],
]));
print_r(json_decode($response, true));
Replace YOUR_API_KEY with the key from your API page.
{
"balance": "100.84",
"currency": "USD"
}Errors
- 401
{"error":"Invalid API key","error_code":"INVALID_KEY","retryable":false}The key is missing, wrong or revoked.
- 429
{"error":"Rate limit exceeded","error_code":"API_RATE_LIMITED","retryable":true,"retry_after":12}A rate limit was reached. Wait for Retry-After.
Response fields
Response fields
balancestring- The wallet balance in USD, as a string with at least two decimals.
currencystring- Always
USD.
Good to know
- Money is always a string, never a number, so no rounding can creep in. Parse it as a decimal.
- The balance changes when an order is placed, canceled or refunded, and when you add funds.
- Add funds in the dashboard, under
/dashboard/wallet. The API cannot move money.