NextName Kennisbank

Finance : Balance

  • Aangemaakt: 20-07-2026

Omschrijving

Haal het actuele saldo van het account op. Het antwoord verschilt per facturatiewijze: een prepaid account levert het resterende saldo, een postpaid account het openstaande bedrag van de lopende factuurperiode.

Endpoint

URL parameters

Deze call heeft geen URL parameters.

Antwoord

Parameter Type Omschrijving
billing_mode String De facturatiewijze van het account: prepaid of postpaid. Bepaalt welk van de onderstaande objecten aanwezig is
Object: balance (alleen bij billing_mode = prepaid)
currency String Valutacode (ISO 4217) van het saldo
amount Decimal Het resterende prepaid-saldo
Object: current_period (alleen bij billing_mode = postpaid)
start Date Startdatum en tijd van de lopende factuurperiode UTC tijdzone in RFC 3339
end Date Einddatum en tijd van de lopende factuurperiode in UTC tijdzone in RFC 3339
currency String Valutacode (ISO 4217) van het openstaande bedrag
amount Decimal Het tot nu toe openstaande bedrag van de lopende factuurperiode

Voorbeelden

Beschrijving:
Haal het saldo van een prepaid account op. Het antwoord bevat het balance-object met het resterende saldo.

Opdracht in PHP:

<?php
$env      = "live"; // live or test
$api_key  = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$api_url  = "/v2/finance/balance";
$api_host = $env === "live" ? "https://api.nextname.nl" : "https://api-test.nextname.nl";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_host . $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer $api_key"));
$output = curl_exec($ch);
curl_close($ch);

echo $output;

Opdracht in cURL:

curl -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
https://api-test.nextname.nl/v2/finance/balance

Antwoord:

HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
{
  "billing_mode": "prepaid",
  "balance": {
    "currency": "EUR",
    "amount": 82.25
  }
}

Beschrijving:
Haal het saldo van een postpaid account op. In plaats van balance bevat het antwoord het current_period-object met het openstaande bedrag van de lopende factuurperiode.

Opdracht in PHP:

<?php
$env      = "live"; // live or test
$api_key  = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$api_url  = "/v2/finance/balance";
$api_host = $env === "live" ? "https://api.nextname.nl" : "https://api-test.nextname.nl";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_host . $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer $api_key"));
$output = curl_exec($ch);
curl_close($ch);

echo $output;

Opdracht in cURL:

curl -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
https://api-test.nextname.nl/v2/finance/balance

Antwoord:

HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
{
  "billing_mode": "postpaid",
  "current_period": {
    "start": "2026-06-30T22:00:00Z",
    "end": "2026-07-31T21:59:59Z",
    "currency": "EUR",
    "amount": 423.56
  }
}