Get Company Credits
curl --request GET \
--url https://getbill.io/external-api/v1/company/credits \
--header 'Authorization: <authorization>'import requests
url = "https://getbill.io/external-api/v1/company/credits"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://getbill.io/external-api/v1/company/credits', 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://getbill.io/external-api/v1/company/credits",
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: <authorization>"
],
]);
$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://getbill.io/external-api/v1/company/credits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://getbill.io/external-api/v1/company/credits")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/company/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Success",
"data": {
"current_credits": 847,
"subscription": {
"plan": "Professional",
"status": "active",
"expires_at": "2024-02-15T23:59:59Z"
}
}
}
Company API
Get Company Credits
Retrieve credit balance and subscription information
GET
/
external-api
/
v1
/
company
/
credits
Get Company Credits
curl --request GET \
--url https://getbill.io/external-api/v1/company/credits \
--header 'Authorization: <authorization>'import requests
url = "https://getbill.io/external-api/v1/company/credits"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://getbill.io/external-api/v1/company/credits', 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://getbill.io/external-api/v1/company/credits",
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: <authorization>"
],
]);
$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://getbill.io/external-api/v1/company/credits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://getbill.io/external-api/v1/company/credits")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://getbill.io/external-api/v1/company/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Success",
"data": {
"current_credits": 847,
"subscription": {
"plan": "Professional",
"status": "active",
"expires_at": "2024-02-15T23:59:59Z"
}
}
}
Overview
This endpoint returns information about your company’s credit balance, usage, and subscription details. Credits are used for various operations like making calls and sending SMS. Email campaigns are free and do not consume credits.Authentication
Requires a valid OAuth 2.0 access token with thecompany:read scope.
Request
string
required
Bearer token for authentication
Example Request
curl -X GET "/external-api/v1/company/credits" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"
const response = await fetch('/external-api/v1/company/credits', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
});
const credits = await response.json();
Response
boolean
Always
false for successful requestsstring
Success message
object
Credit and subscription information
Success Response
{
"error": false,
"message": "Success",
"data": {
"current_credits": 847,
"subscription": {
"plan": "Professional",
"status": "active",
"expires_at": "2024-02-15T23:59:59Z"
}
}
}
Usage Notes
- Credits are typically refreshed monthly based on your subscription plan
- Different operations consume different amounts of credits:
- Phone calls: 1-5 credits depending on duration
- SMS messages: 1 credit per message
- Email campaigns: 0 credits (free)
- WhatsApp messages: 1-2 credits per message
- Monitor your credit usage to avoid service interruptions
- Contact support to upgrade your plan if you need more credits
Error Responses
{
"error": true,
"message": "Authentication credentials are missing or invalid",
"code": 401
}
{
"error": true,
"message": "Required scope \"company:read\" not found in token",
"code": 403
}