Get Billing Info
curl --request GET \
--url https://api.example.com/api/billing/info \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.example.com/api/billing/info"
headers = {"X-Organization-Id": "<x-organization-id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Organization-Id': '<x-organization-id>'}};
fetch('https://api.example.com/api/billing/info', 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.example.com/api/billing/info",
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-Organization-Id: <x-organization-id>"
],
]);
$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.example.com/api/billing/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
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.example.com/api/billing/info")
.header("X-Organization-Id", "<x-organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/billing/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
response = http.request(request)
puts response.read_body{
"plan": {
"name": "starter",
"platform_fee": 0.03,
"concurrent_calls": 5,
"included_kb_pages_per_month": 100,
"retention_days": 30,
"snapshot": {}
},
"kb_usage": {
"pages_used_this_month": 10,
"pages_included": 100,
"kb_usage_period": "2024-03",
"pages_remaining": 90,
"pages_overage": 0
},
"subscription": {
"status": "active",
"next_billing_date": "2024-04-01T00:00:00Z",
"dodo_subscription_id": "sub_xyz789",
"dodo_customer_id": "cus_abc123"
},
"credits": {
"balance": 500,
"currency": "USD",
"low_balance_threshold": 10,
"last_updated": "2024-03-01T12:00:00Z",
"last_transaction_id": "txn_def456"
},
"transaction_summary": {
"total_credits_added": 1000,
"total_credits_used": 500,
"net_balance": 500,
"transaction_count": 5
},
"recent_transactions": []
}
Billing
Get Billing Info
GET
/
api
/
billing
/
info
Get Billing Info
curl --request GET \
--url https://api.example.com/api/billing/info \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.example.com/api/billing/info"
headers = {"X-Organization-Id": "<x-organization-id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Organization-Id': '<x-organization-id>'}};
fetch('https://api.example.com/api/billing/info', 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.example.com/api/billing/info",
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-Organization-Id: <x-organization-id>"
],
]);
$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.example.com/api/billing/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
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.example.com/api/billing/info")
.header("X-Organization-Id", "<x-organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/billing/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
response = http.request(request)
puts response.read_body{
"plan": {
"name": "starter",
"platform_fee": 0.03,
"concurrent_calls": 5,
"included_kb_pages_per_month": 100,
"retention_days": 30,
"snapshot": {}
},
"kb_usage": {
"pages_used_this_month": 10,
"pages_included": 100,
"kb_usage_period": "2024-03",
"pages_remaining": 90,
"pages_overage": 0
},
"subscription": {
"status": "active",
"next_billing_date": "2024-04-01T00:00:00Z",
"dodo_subscription_id": "sub_xyz789",
"dodo_customer_id": "cus_abc123"
},
"credits": {
"balance": 500,
"currency": "USD",
"low_balance_threshold": 10,
"last_updated": "2024-03-01T12:00:00Z",
"last_transaction_id": "txn_def456"
},
"transaction_summary": {
"total_credits_added": 1000,
"total_credits_used": 500,
"net_balance": 500,
"transaction_count": 5
},
"recent_transactions": []
}
Retrieve comprehensive billing information for your organization, including current plan details, credit balance, and recent transactions.
Request
Response
Details about the organization’s current billing plan.
{
"plan": {
"name": "starter",
"platform_fee": 0.03,
"concurrent_calls": 5,
"included_kb_pages_per_month": 100,
"retention_days": 30,
"snapshot": {}
},
"kb_usage": {
"pages_used_this_month": 10,
"pages_included": 100,
"kb_usage_period": "2024-03",
"pages_remaining": 90,
"pages_overage": 0
},
"subscription": {
"status": "active",
"next_billing_date": "2024-04-01T00:00:00Z",
"dodo_subscription_id": "sub_xyz789",
"dodo_customer_id": "cus_abc123"
},
"credits": {
"balance": 500,
"currency": "USD",
"low_balance_threshold": 10,
"last_updated": "2024-03-01T12:00:00Z",
"last_transaction_id": "txn_def456"
},
"transaction_summary": {
"total_credits_added": 1000,
"total_credits_used": 500,
"net_balance": 500,
"transaction_count": 5
},
"recent_transactions": []
}