curl --request POST \
--url https://app.base44.com/api/billing/topup/create-checkout-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message_credits": 100,
"integration_credits": 1000
}
'import requests
url = "https://app.base44.com/api/billing/topup/create-checkout-session"
payload = {
"message_credits": 100,
"integration_credits": 1000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message_credits: 100, integration_credits: 1000})
};
fetch('https://app.base44.com/api/billing/topup/create-checkout-session', 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://app.base44.com/api/billing/topup/create-checkout-session",
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([
'message_credits' => 100,
'integration_credits' => 1000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.base44.com/api/billing/topup/create-checkout-session"
payload := strings.NewReader("{\n \"message_credits\": 100,\n \"integration_credits\": 1000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.base44.com/api/billing/topup/create-checkout-session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message_credits\": 100,\n \"integration_credits\": 1000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/billing/topup/create-checkout-session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message_credits\": 100,\n \"integration_credits\": 1000\n}"
response = http.request(request)
puts response.read_body{
"session_id": "cs_live_a1B2c3D4e5F6g7H8i9J0",
"url": "https://checkout.stripe.com/c/pay/cs_live_a1B2c3D4e5F6g7H8i9J0"
}{
"detail": [
{
"type": "int_parsing",
"loc": [
"body",
"message_credits"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "fifty"
}
]
}Create top-up checkout
Creates a Stripe Checkout page where the card owner reviews and pays for top-up credits for your workspace. Nothing is charged until they pay on that page.
Open url in a browser and let the card owner complete the payment. Stripe then returns them to the Base44 billing page, and the credits are added to the workspace shortly after the payment goes through. Get the amounts and prices from List top-up packs. Send at least one of message_credits (a multiple of 50, up to 400) or integration_credits (a multiple of 1,000, up to 8,000). Prices are in the workspace’s billing currency, US dollars or Israeli shekels, and shekel prices have VAT added at checkout.
Only the workspace owner can buy top-ups, and the workspace needs a paid plan other than Enterprise that isn’t past due. A workspace with an open payment dispute can’t buy top-ups, and neither can one whose plan is paid through the App Store or Google Play. Checkout isn’t available on a workspace billed through Wix. Where Base44 has turned on Wix top-ups, those workspaces buy with Buy top-up with saved card instead.
This endpoint is limited to 8 requests an hour per user, and requests it rejects count toward the limit. Some workspaces have a different limit. A read-only token is refused, and workspace API keys aren’t accepted.
curl --request POST \
--url https://app.base44.com/api/billing/topup/create-checkout-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message_credits": 100,
"integration_credits": 1000
}
'import requests
url = "https://app.base44.com/api/billing/topup/create-checkout-session"
payload = {
"message_credits": 100,
"integration_credits": 1000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message_credits: 100, integration_credits: 1000})
};
fetch('https://app.base44.com/api/billing/topup/create-checkout-session', 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://app.base44.com/api/billing/topup/create-checkout-session",
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([
'message_credits' => 100,
'integration_credits' => 1000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.base44.com/api/billing/topup/create-checkout-session"
payload := strings.NewReader("{\n \"message_credits\": 100,\n \"integration_credits\": 1000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.base44.com/api/billing/topup/create-checkout-session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message_credits\": 100,\n \"integration_credits\": 1000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/billing/topup/create-checkout-session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message_credits\": 100,\n \"integration_credits\": 1000\n}"
response = http.request(request)
puts response.read_body{
"session_id": "cs_live_a1B2c3D4e5F6g7H8i9J0",
"url": "https://checkout.stripe.com/c/pay/cs_live_a1B2c3D4e5F6g7H8i9J0"
}{
"detail": [
{
"type": "int_parsing",
"loc": [
"body",
"message_credits"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "fifty"
}
]
}Authorizations
Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.
Body
Response
The checkout page to send the card owner to.
Was this page helpful?