curl -X GET 'https://verification.didit.me/v3/billing/balance/' \
-H 'x-api-key: YOUR_API_KEY'import os
from decimal import Decimal
import requests
resp = requests.get(
'https://verification.didit.me/v3/billing/balance/',
headers={'x-api-key': os.environ['DIDIT_API_KEY']},
timeout=10,
)
resp.raise_for_status()
data = resp.json()
balance = Decimal(data['balance'])
if balance < Decimal('50'):
print(f'Low balance: ${balance} - top up before launching new sessions.')
else:
print(f'Balance OK: ${balance}')const resp = await fetch('https://verification.didit.me/v3/billing/balance/', {
headers: { 'x-api-key': process.env.DIDIT_API_KEY },
});
if (!resp.ok) throw new Error(`Billing balance failed: ${resp.status}`);
const { balance, auto_refill_enabled, auto_refill_threshold } = await resp.json();
console.log({ balance, auto_refill_enabled, auto_refill_threshold });<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://verification.didit.me/v3/billing/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 => [
"x-api-key: <api-key>"
],
]);
$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://verification.didit.me/v3/billing/balance/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://verification.didit.me/v3/billing/balance/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://verification.didit.me/v3/billing/balance/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balance": "1234.5600",
"auto_refill_enabled": true,
"auto_refill_amount": "500.00",
"auto_refill_threshold": "100.00"
}Get Credit Balance
Get current pre-paid credit balance in USD (organization-wide) plus auto-refill config. Amounts are decimal strings — parse with a decimal library.
curl -X GET 'https://verification.didit.me/v3/billing/balance/' \
-H 'x-api-key: YOUR_API_KEY'import os
from decimal import Decimal
import requests
resp = requests.get(
'https://verification.didit.me/v3/billing/balance/',
headers={'x-api-key': os.environ['DIDIT_API_KEY']},
timeout=10,
)
resp.raise_for_status()
data = resp.json()
balance = Decimal(data['balance'])
if balance < Decimal('50'):
print(f'Low balance: ${balance} - top up before launching new sessions.')
else:
print(f'Balance OK: ${balance}')const resp = await fetch('https://verification.didit.me/v3/billing/balance/', {
headers: { 'x-api-key': process.env.DIDIT_API_KEY },
});
if (!resp.ok) throw new Error(`Billing balance failed: ${resp.status}`);
const { balance, auto_refill_enabled, auto_refill_threshold } = await resp.json();
console.log({ balance, auto_refill_enabled, auto_refill_threshold });<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://verification.didit.me/v3/billing/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 => [
"x-api-key: <api-key>"
],
]);
$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://verification.didit.me/v3/billing/balance/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://verification.didit.me/v3/billing/balance/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://verification.didit.me/v3/billing/balance/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balance": "1234.5600",
"auto_refill_enabled": true,
"auto_refill_amount": "500.00",
"auto_refill_threshold": "100.00"
}Authorizations
Response
Current credit balance plus the organization's auto-refill configuration.
Current pre-paid credit balance in USD, as a fixed-point decimal string. Decreases as verifications are billed and increases when a top-up settles.
When true, Didit will automatically charge the saved Stripe payment method to add credits once the balance crosses auto_refill_threshold. Configured from Console → Billing.
USD amount that will be charged on each auto-refill. null when auto-refill is disabled or unset.
Trigger threshold in USD. Auto-refill fires when balance falls below this value. null when auto-refill is disabled or unset.