Order plans
curl --request POST \
--url https://api.custral.com/v1/plans/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"keys": [
"growth"
]
}
'import requests
url = "https://api.custral.com/v1/plans/order"
payload = { "keys": ["growth"] }
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({keys: ['growth']})
};
fetch('https://api.custral.com/v1/plans/order', 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.custral.com/v1/plans/order",
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([
'keys' => [
'growth'
]
]),
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.custral.com/v1/plans/order"
payload := strings.NewReader("{\n \"keys\": [\n \"growth\"\n ]\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.custral.com/v1/plans/order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"keys\": [\n \"growth\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custral.com/v1/plans/order")
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 \"keys\": [\n \"growth\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"key": "growth",
"name": "Growth",
"description": "<string>",
"features": [
"<string>"
],
"highlighted": true,
"ctaLabel": "<string>",
"trialDays": 123,
"monthly": {
"product": "<string>",
"productName": "<string>",
"price": 123,
"unitAmount": 123,
"currency": "<string>",
"interval": "month",
"stripe": "synced"
},
"yearly": {
"product": "<string>",
"productName": "<string>",
"price": 123,
"unitAmount": 123,
"currency": "<string>",
"interval": "month",
"stripe": "synced"
},
"contactSalesUrl": "<string>",
"position": 123
}
],
"reqId": "req_2a1f9c8e7b6d5"
}Billing
Order plans
Set the order customers see plans in. keys must name every plan exactly once (plan_order_mismatch). The key’s creator must be a workspace admin. Requires scope: billing:admin.
POST
/
v1
/
plans
/
order
Order plans
curl --request POST \
--url https://api.custral.com/v1/plans/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"keys": [
"growth"
]
}
'import requests
url = "https://api.custral.com/v1/plans/order"
payload = { "keys": ["growth"] }
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({keys: ['growth']})
};
fetch('https://api.custral.com/v1/plans/order', 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.custral.com/v1/plans/order",
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([
'keys' => [
'growth'
]
]),
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.custral.com/v1/plans/order"
payload := strings.NewReader("{\n \"keys\": [\n \"growth\"\n ]\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.custral.com/v1/plans/order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"keys\": [\n \"growth\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custral.com/v1/plans/order")
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 \"keys\": [\n \"growth\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"key": "growth",
"name": "Growth",
"description": "<string>",
"features": [
"<string>"
],
"highlighted": true,
"ctaLabel": "<string>",
"trialDays": 123,
"monthly": {
"product": "<string>",
"productName": "<string>",
"price": 123,
"unitAmount": 123,
"currency": "<string>",
"interval": "month",
"stripe": "synced"
},
"yearly": {
"product": "<string>",
"productName": "<string>",
"price": 123,
"unitAmount": 123,
"currency": "<string>",
"interval": "month",
"stripe": "synced"
},
"contactSalesUrl": "<string>",
"position": 123
}
],
"reqId": "req_2a1f9c8e7b6d5"
}Authorizations
A Custral API key, created in Settings → Developers → Applications, sent as Authorization: Bearer sk_…. The X-Api-Key header is also accepted and takes precedence. Use a secret key (sk_…) from your server; a publishable key (pk_…) may hold only objects:read and usage:write. Never expose a secret key in a browser.
Body
application/json
Was this page helpful?