Create checkout session
curl --request POST \
--url https://api.kitefrost.ai/v1/billing/checkout \
--header 'Content-Type: application/json' \
--data '
{
"cancel_url": "https://app.example.com/billing?cancel=1",
"plan": "pro",
"success_url": "https://app.example.com/billing?success=1"
}
'import requests
url = "https://api.kitefrost.ai/v1/billing/checkout"
payload = {
"cancel_url": "https://app.example.com/billing?cancel=1",
"plan": "pro",
"success_url": "https://app.example.com/billing?success=1"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cancel_url: 'https://app.example.com/billing?cancel=1',
plan: 'pro',
success_url: 'https://app.example.com/billing?success=1'
})
};
fetch('https://api.kitefrost.ai/v1/billing/checkout', 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.kitefrost.ai/v1/billing/checkout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cancel_url' => 'https://app.example.com/billing?cancel=1',
'plan' => 'pro',
'success_url' => 'https://app.example.com/billing?success=1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kitefrost.ai/v1/billing/checkout"
payload := strings.NewReader("{\n \"cancel_url\": \"https://app.example.com/billing?cancel=1\",\n \"plan\": \"pro\",\n \"success_url\": \"https://app.example.com/billing?success=1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kitefrost.ai/v1/billing/checkout")
.header("Content-Type", "application/json")
.body("{\n \"cancel_url\": \"https://app.example.com/billing?cancel=1\",\n \"plan\": \"pro\",\n \"success_url\": \"https://app.example.com/billing?success=1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kitefrost.ai/v1/billing/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancel_url\": \"https://app.example.com/billing?cancel=1\",\n \"plan\": \"pro\",\n \"success_url\": \"https://app.example.com/billing?success=1\"\n}"
response = http.request(request)
puts response.read_body{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_abc123",
"session_id": "cs_live_abc123"
}{
"error": "Forbidden",
"code": "forbidden",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "Your API key does not have the required scope.",
"doc_url": "https://docs.kitefrost.ai/errors/forbidden"
}{
"error": "Not found",
"code": "not_found",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "The requested resource does not exist.",
"doc_url": "https://docs.kitefrost.ai/errors/not_found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "Internal server error",
"code": "internal_error",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "An unexpected error occurred.",
"doc_url": "https://docs.kitefrost.ai/errors/internal_error"
}billing
Create checkout session
Create a Stripe Checkout Session for upgrading the tenant to a paid plan. Returns a checkout_url that the client should redirect to. When Stripe is not configured (dev mode), returns a placeholder URL.
POST
/
v1
/
billing
/
checkout
Create checkout session
curl --request POST \
--url https://api.kitefrost.ai/v1/billing/checkout \
--header 'Content-Type: application/json' \
--data '
{
"cancel_url": "https://app.example.com/billing?cancel=1",
"plan": "pro",
"success_url": "https://app.example.com/billing?success=1"
}
'import requests
url = "https://api.kitefrost.ai/v1/billing/checkout"
payload = {
"cancel_url": "https://app.example.com/billing?cancel=1",
"plan": "pro",
"success_url": "https://app.example.com/billing?success=1"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cancel_url: 'https://app.example.com/billing?cancel=1',
plan: 'pro',
success_url: 'https://app.example.com/billing?success=1'
})
};
fetch('https://api.kitefrost.ai/v1/billing/checkout', 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.kitefrost.ai/v1/billing/checkout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cancel_url' => 'https://app.example.com/billing?cancel=1',
'plan' => 'pro',
'success_url' => 'https://app.example.com/billing?success=1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kitefrost.ai/v1/billing/checkout"
payload := strings.NewReader("{\n \"cancel_url\": \"https://app.example.com/billing?cancel=1\",\n \"plan\": \"pro\",\n \"success_url\": \"https://app.example.com/billing?success=1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kitefrost.ai/v1/billing/checkout")
.header("Content-Type", "application/json")
.body("{\n \"cancel_url\": \"https://app.example.com/billing?cancel=1\",\n \"plan\": \"pro\",\n \"success_url\": \"https://app.example.com/billing?success=1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kitefrost.ai/v1/billing/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancel_url\": \"https://app.example.com/billing?cancel=1\",\n \"plan\": \"pro\",\n \"success_url\": \"https://app.example.com/billing?success=1\"\n}"
response = http.request(request)
puts response.read_body{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_abc123",
"session_id": "cs_live_abc123"
}{
"error": "Forbidden",
"code": "forbidden",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "Your API key does not have the required scope.",
"doc_url": "https://docs.kitefrost.ai/errors/forbidden"
}{
"error": "Not found",
"code": "not_found",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "The requested resource does not exist.",
"doc_url": "https://docs.kitefrost.ai/errors/not_found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "Internal server error",
"code": "internal_error",
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message": "An unexpected error occurred.",
"doc_url": "https://docs.kitefrost.ai/errors/internal_error"
}Body
application/json
POST /v1/billing/checkout
Target plan: 'pro', 'studio', or 'enterprise', optionally versioned (e.g. 'pro_v1')
Pattern:
^(pro|studio|enterprise)(_v[0-9]+)?$URL to redirect to after successful checkout
Minimum string length:
1URL to redirect to if the user cancels checkout
Minimum string length:
1⌘I