Billing
Credit Packs
List available credit top-up packs with prices
GET
/
v1
/
billing
/
packs
Credit Packs
curl --request GET \
--url https://api.example.com/v1/billing/packsimport requests
url = "https://api.example.com/v1/billing/packs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/billing/packs', 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/v1/billing/packs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/v1/billing/packs"
req, _ := http.NewRequest("GET", url, nil)
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/v1/billing/packs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/billing/packs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyResponse
{
"packs": [
{ "id": "small", "credits": 200, "price": "$10", "per_credit": "$0.05" },
{ "id": "medium", "credits": 500, "price": "$23", "per_credit": "$0.046", "badge": "Popular" },
{ "id": "large", "credits": 1000, "price": "$44", "per_credit": "$0.044", "badge": "Best Value" },
{ "id": "xl", "credits": 2500, "price": "$100", "per_credit": "$0.04" }
],
"credits_remaining": 1.2,
"hint": "Larger packs are more cost-effective. Credits never expire."
}
⌘I
Credit Packs
curl --request GET \
--url https://api.example.com/v1/billing/packsimport requests
url = "https://api.example.com/v1/billing/packs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/billing/packs', 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/v1/billing/packs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/v1/billing/packs"
req, _ := http.NewRequest("GET", url, nil)
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/v1/billing/packs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/billing/packs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body