curl --request POST \
--url https://api.qumo-deploy.com/v1/billing/portal-sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"return_url": "https://console.qumo-deploy.com/settings/billing",
"flow": "subscription_update"
}
'import requests
url = "https://api.qumo-deploy.com/v1/billing/portal-sessions"
payload = {
"return_url": "https://console.qumo-deploy.com/settings/billing",
"flow": "subscription_update"
}
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({
return_url: 'https://console.qumo-deploy.com/settings/billing',
flow: 'subscription_update'
})
};
fetch('https://api.qumo-deploy.com/v1/billing/portal-sessions', 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.qumo-deploy.com/v1/billing/portal-sessions",
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([
'return_url' => 'https://console.qumo-deploy.com/settings/billing',
'flow' => 'subscription_update'
]),
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://api.qumo-deploy.com/v1/billing/portal-sessions"
payload := strings.NewReader("{\n \"return_url\": \"https://console.qumo-deploy.com/settings/billing\",\n \"flow\": \"subscription_update\"\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://api.qumo-deploy.com/v1/billing/portal-sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"return_url\": \"https://console.qumo-deploy.com/settings/billing\",\n \"flow\": \"subscription_update\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qumo-deploy.com/v1/billing/portal-sessions")
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 \"return_url\": \"https://console.qumo-deploy.com/settings/billing\",\n \"flow\": \"subscription_update\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://billing.stripe.com/p/session/live_YWNjdF8xUXhSN2FMa2RJd0h1N2l4"
}{
"error": "organization_id is required"
}{
"error": "organization_id is required"
}{
"error": "organization_id is required"
}{
"error": "organization_id is required"
}{
"error": "organization_id is required"
}Open the billing portal
Creates a Stripe Customer Portal session for the organization and returns
its URL. flow opens the portal directly on a plan change or
cancellation of the live subscription; without a live subscription, or
when the portal does not allow that flow, it opens on the portal’s home
page. Returns 404 when the organization has never started a checkout.
curl --request POST \
--url https://api.qumo-deploy.com/v1/billing/portal-sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"return_url": "https://console.qumo-deploy.com/settings/billing",
"flow": "subscription_update"
}
'import requests
url = "https://api.qumo-deploy.com/v1/billing/portal-sessions"
payload = {
"return_url": "https://console.qumo-deploy.com/settings/billing",
"flow": "subscription_update"
}
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({
return_url: 'https://console.qumo-deploy.com/settings/billing',
flow: 'subscription_update'
})
};
fetch('https://api.qumo-deploy.com/v1/billing/portal-sessions', 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.qumo-deploy.com/v1/billing/portal-sessions",
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([
'return_url' => 'https://console.qumo-deploy.com/settings/billing',
'flow' => 'subscription_update'
]),
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://api.qumo-deploy.com/v1/billing/portal-sessions"
payload := strings.NewReader("{\n \"return_url\": \"https://console.qumo-deploy.com/settings/billing\",\n \"flow\": \"subscription_update\"\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://api.qumo-deploy.com/v1/billing/portal-sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"return_url\": \"https://console.qumo-deploy.com/settings/billing\",\n \"flow\": \"subscription_update\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qumo-deploy.com/v1/billing/portal-sessions")
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 \"return_url\": \"https://console.qumo-deploy.com/settings/billing\",\n \"flow\": \"subscription_update\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://billing.stripe.com/p/session/live_YWNjdF8xUXhSN2FMa2RJd0h1N2l4"
}{
"error": "organization_id is required"
}{
"error": "organization_id is required"
}{
"error": "organization_id is required"
}{
"error": "organization_id is required"
}{
"error": "organization_id is required"
}Authorizations
A personal access token (POST /v1/auth/tokens) or a machine
identity token (POST /v1/projects/{project_id}/identities/{identity_id}/tokens),
both prefixed qumo_pat_. A token's scopes cap what it can do; see
Scopes and permissions. A personal
token names no organization: on a route whose path names no project or
organization, pass ?organization_id=.
Query Parameters
The organization the request acts in. Required with a personal token or a session, which name no organization themselves; an identity token's organization is implied.
Body
Where the portal sends the customer back to.
"https://console.qumo-deploy.com/settings/billing"
Opens the portal on a specific task for the live subscription:
subscription_update (change plan) or subscription_cancel. Empty
or omitted opens the portal's home page.
, subscription_update, subscription_cancel "subscription_update"
Response
The portal session was created.
The portal session URL to redirect the customer to.
"https://billing.stripe.com/p/session/live_YWNjdF8xUXhSN2FMa2RJd0h1N2l4"