curl --request POST \
--url https://app.base44.com/api/billing/create-portal-session \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/billing/create-portal-session"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/billing/create-portal-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/create-portal-session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://app.base44.com/api/billing/create-portal-session"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/create-portal-session")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/billing/create-portal-session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"url": "https://billing.stripe.com/p/session/live_YWNjdF8xTjNYcm1EcjU2TDg5ZGtL"
}Create billing portal session
Creates a link to the Stripe customer portal for your workspace. The link opens a hosted page: open it in a browser, and the workspace owner updates the card, downloads invoices, or manages the plan there. Nothing in the portal can be completed through the API. Only the workspace owner can create the link.
When the person leaves the portal, Stripe sends them back to the Base44 billing page.
Set flow_type to choose what the portal offers. A workspace billed through Wix, or one still on a free migration trial, always gets manage_no_cancel unless you ask for payment_method_update. Manage a Wix-billed plan with Change Wix plan, and its card with Create payment method update session.
The base rate limit is 20 requests per hour per user. See Rate limits for the multiplier your plan gets.
curl --request POST \
--url https://app.base44.com/api/billing/create-portal-session \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/billing/create-portal-session"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/billing/create-portal-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/create-portal-session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://app.base44.com/api/billing/create-portal-session"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/create-portal-session")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/billing/create-portal-session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"url": "https://billing.stripe.com/p/session/live_YWNjdF8xTjNYcm1EcjU2TDg5ZGtL"
}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.
Query Parameters
What the portal offers. default opens the full portal, payment_method_update goes straight to updating the card, and manage_no_cancel hides cancelling and changing the plan. Any other value acts like default.
Response
A link to the Stripe customer portal.
A hosted billing page for a person to open.
Link to a hosted page. Open it in a browser for a person to finish there. Some links work only once or expire, so open it right away and don't store it.
"https://billing.stripe.com/p/session/live_YWNjdF8xTjNYcm1EcjU2TDg5ZGtL"
Was this page helpful?