Get billing checkout history
curl --request GET \
--url https://api.videodb.io/billing/checkouts \
--header 'x-access-token: <api-key>'const options = {method: 'GET', headers: {'x-access-token': '<api-key>'}};
fetch('https://api.videodb.io/billing/checkouts', 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.videodb.io/billing/checkouts",
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-access-token: <api-key>"
],
]);
$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.videodb.io/billing/checkouts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-access-token", "<api-key>")
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.videodb.io/billing/checkouts")
.header("x-access-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/billing/checkouts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-access-token"] = '<api-key>'
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("x-access-token", "<api-key>")
$response = Invoke-WebRequest -Uri 'https://api.videodb.io/billing/checkouts' -Method GET -Headers $headersimport Foundation
let url = URL(string: "https://api.videodb.io/billing/checkouts")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["x-access-token": "<api-key>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/billing/checkouts");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/billing/checkouts");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);const options = {method: 'GET', headers: {'x-access-token': '<api-key>'}};
fetch('https://api.videodb.io/billing/checkouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/billing/checkouts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/billing/checkouts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.videodb.io/billing/checkouts")
.get()
.addHeader("x-access-token", "<api-key>")
.build()
val response = client.newCall(request).execute(){
"success": true,
"data": [
{
"id": "cs_test_xxx",
"amount": 100,
"currency": "usd",
"status": "completed",
"created_at": "2023-11-07T05:31:56Z"
}
]
}List Checkout Sessions
Retrieve a list of all checkout sessions and their status
GET
/
billing
/
checkouts
Get billing checkout history
curl --request GET \
--url https://api.videodb.io/billing/checkouts \
--header 'x-access-token: <api-key>'const options = {method: 'GET', headers: {'x-access-token': '<api-key>'}};
fetch('https://api.videodb.io/billing/checkouts', 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.videodb.io/billing/checkouts",
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-access-token: <api-key>"
],
]);
$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.videodb.io/billing/checkouts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-access-token", "<api-key>")
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.videodb.io/billing/checkouts")
.header("x-access-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/billing/checkouts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-access-token"] = '<api-key>'
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("x-access-token", "<api-key>")
$response = Invoke-WebRequest -Uri 'https://api.videodb.io/billing/checkouts' -Method GET -Headers $headersimport Foundation
let url = URL(string: "https://api.videodb.io/billing/checkouts")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["x-access-token": "<api-key>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/billing/checkouts");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/billing/checkouts");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);const options = {method: 'GET', headers: {'x-access-token': '<api-key>'}};
fetch('https://api.videodb.io/billing/checkouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/billing/checkouts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/billing/checkouts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.videodb.io/billing/checkouts")
.get()
.addHeader("x-access-token", "<api-key>")
.build()
val response = client.newCall(request).execute(){
"success": true,
"data": [
{
"id": "cs_test_xxx",
"amount": 100,
"currency": "usd",
"status": "completed",
"created_at": "2023-11-07T05:31:56Z"
}
]
}Retrieve all checkout sessions initiated through your account, including their status and payment information.
import requests
response = requests.get(
"https://api.videodb.io/billing/checkouts",
headers={"x-access-token": "your_api_key"}
)
checkouts = response.json()
for checkout in checkouts.get('checkouts', []):
print(f"Checkout ID: {checkout.get('id')}")
print(f"Amount: ${checkout.get('amount')}")
print(f"Status: {checkout.get('status')}")
print(f"Created: {checkout.get('created_at')}")
print("---")
const response = await fetch("https://api.videodb.io/billing/checkouts", {
method: "GET",
headers: {
"x-access-token": "your_api_key"
}
});
const data = await response.json();
for (const checkout of data.checkouts || []) {
console.log(`Checkout ID: ${checkout.id}`);
console.log(`Amount: $${checkout.amount}`);
console.log(`Status: ${checkout.status}`);
console.log(`Created: ${checkout.createdAt}`);
console.log("---");
}
- Checkout sessions include both completed and abandoned sessions
- Status values include “completed”, “pending”, and “expired”
- Completed checkouts result in credit additions to your account
- Each checkout session is associated with a specific purchase amount
Create Checkout
Initiate a new checkout session to purchase credits
Top Up Credits
Manually add credits to your account
⌘I