Billing
List Plans
List available subscription plans with pricing and trial eligibility
GET
/
v1
/
billing
/
plans
List Plans
curl --request GET \
--url https://api.example.com/v1/billing/plansimport requests
url = "https://api.example.com/v1/billing/plans"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/billing/plans', 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/plans",
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/plans"
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/plans")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/billing/plans")
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_bodyReturns all available plans, the company’s current plan, credit balance, and trial eligibility.
Response
{
"plans": [
{
"id": "starter",
"name": "Starter",
"credits_per_month": 500,
"price": "$49/mo",
"trial_days": 7,
"features": ["500 credits/month", "All primitives", "System email domain"]
},
{
"id": "pro",
"name": "Pro",
"credits_per_month": 2000,
"price": "$149/mo",
"trial_days": 7,
"features": ["2000 credits/month", "All primitives", "Custom domains", "Priority support"]
}
],
"current_plan": "free",
"credits_remaining": 12.5,
"trial_eligible": true,
"can_upgrade": true,
"hint": "First-time subscribers get a 7-day free trial."
}
⌘I
List Plans
curl --request GET \
--url https://api.example.com/v1/billing/plansimport requests
url = "https://api.example.com/v1/billing/plans"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/billing/plans', 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/plans",
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/plans"
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/plans")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/billing/plans")
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