Get Balance
curl --request GET \
--url https://api.payviox.com/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.payviox.com/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.payviox.com/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.payviox.com/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.payviox.com/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.payviox.com/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payviox.com/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"balance": 1500000,
"payout_balance": 500000
}
{
"error": "Unauthorized"
}
API - Endpoints
Get Balance
Retrieve your business balance
GET
/
balance
Get Balance
curl --request GET \
--url https://api.payviox.com/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.payviox.com/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.payviox.com/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.payviox.com/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.payviox.com/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.payviox.com/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payviox.com/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"balance": 1500000,
"payout_balance": 500000
}
{
"error": "Unauthorized"
}
Overview
Returns your current business balance and payout balance in cents. Use this endpoint to programmatically check your available funds.All amounts are returned in cents (e.g.,
1500000 = $15,000.00).Authentication
This endpoint requires your Secret API Key (server-side only). See Authentication for details.Authorization: Bearer sk_live_xxxxxxxxxxxx
Never expose your Secret API Key in client-side code. This endpoint should only be called from your backend server.
Example Requests
curl https://api.payviox.com/balance \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxx"
const response = await fetch('https://api.payviox.com/balance', {
headers: {
'Authorization': 'Bearer sk_live_xxxxxxxxxxxx'
}
});
const data = await response.json();
console.log(data.balance);
import requests
response = requests.get(
'https://api.payviox.com/balance',
headers={
'Authorization': 'Bearer sk_live_xxxxxxxxxxxx'
}
)
data = response.json()
print(data['balance'])
<?php
$apiKey = 'sk_live_xxxxxxxxxxxx';
$url = 'https://api.payviox.com/balance';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
echo $result['balance'];
require 'net/http'
require 'json'
uri = URI('https://api.payviox.com/balance')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer sk_live_xxxxxxxxxxxx'
response = http.request(request)
result = JSON.parse(response.body)
puts result['balance']
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.payviox.com/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer sk_live_xxxxxxxxxxxx")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["balance"])
}
Example Response
{
"balance": 1500000,
"payout_balance": 500000
}
{
"error": "Unauthorized"
}
Error Responses
401 — Unauthorized
401 — Unauthorized
Returned when the API key is missing or invalid. This endpoint requires your Secret API Key.How to resolve: Ensure you are sending a valid Secret API key in the
Authorization: Bearer header. Public API keys are not accepted for this endpoint.{
"error": "Unauthorized"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
⌘I