Update plan metadata
curl --request PATCH \
--url https://api.example.com/api/v1/plans/{plan_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"name": "<string>",
"self_service_rank": 123
}
'import requests
url = "https://api.example.com/api/v1/plans/{plan_id}"
payload = {
"description": "<string>",
"name": "<string>",
"self_service_rank": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', name: '<string>', self_service_rank: 123})
};
fetch('https://api.example.com/api/v1/plans/{plan_id}', 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.example.com/api/v1/plans/{plan_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'name' => '<string>',
'self_service_rank' => 123
]),
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.example.com/api/v1/plans/{plan_id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"self_service_rank\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/api/v1/plans/{plan_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"self_service_rank\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/plans/{plan_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"self_service_rank\": 123\n}"
response = http.request(request)
puts response.read_body{
"available_parameters": {
"billing_periods": {},
"capacity_thresholds": {},
"slot_components": [
"<string>"
]
},
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"id": "plan_7n42DGM5Tflk9n8mt7Fhc7",
"name": "<string>",
"net_terms": 123,
"plan_type": "STANDARD",
"price_components": [
{
"id": "price_7n42DGM5Tflk9n8mt7Fhc7",
"name": "<string>",
"fee": {
"rates": [
{
"price": "<string>",
"term": "MONTHLY"
}
]
},
"product_id": "prd_7n42DGM5Tflk9n8mt7Fhc7"
}
],
"product_family": {
"id": "pf_7n42DGM5Tflk9n8mt7Fhc7",
"name": "<string>"
},
"status": "DRAFT",
"version": 123,
"version_id": "plv_7n42DGM5Tflk9n8mt7Fhc7",
"billing_cycles": 123,
"description": "<string>",
"entitlements": [
{
"created_at": "2023-11-07T05:31:56Z",
"feature_id": "feat_7n42DGM5Tflk9n8mt7Fhc7",
"id": "ent_7n42DGM5Tflk9n8mt7Fhc7",
"updated_at": "2023-11-07T05:31:56Z",
"value": {
"enabled": true
}
}
],
"minimum_commitment": {
"amount": "<string>",
"scope": {}
},
"period_start_day": 123,
"self_service_rank": 123,
"trial": {
"duration_days": 1,
"is_free": true,
"trialing_plan_id": "plan_7n42DGM5Tflk9n8mt7Fhc7"
}
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}Plans
Update plan metadata
Partially update plan-level fields (name, description, self_service_rank). Does not modify version-level configuration or components.
PATCH
/
api
/
v1
/
plans
/
{plan_id}
Update plan metadata
curl --request PATCH \
--url https://api.example.com/api/v1/plans/{plan_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"name": "<string>",
"self_service_rank": 123
}
'import requests
url = "https://api.example.com/api/v1/plans/{plan_id}"
payload = {
"description": "<string>",
"name": "<string>",
"self_service_rank": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', name: '<string>', self_service_rank: 123})
};
fetch('https://api.example.com/api/v1/plans/{plan_id}', 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.example.com/api/v1/plans/{plan_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'name' => '<string>',
'self_service_rank' => 123
]),
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.example.com/api/v1/plans/{plan_id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"self_service_rank\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/api/v1/plans/{plan_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"self_service_rank\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/plans/{plan_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"name\": \"<string>\",\n \"self_service_rank\": 123\n}"
response = http.request(request)
puts response.read_body{
"available_parameters": {
"billing_periods": {},
"capacity_thresholds": {},
"slot_components": [
"<string>"
]
},
"created_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"id": "plan_7n42DGM5Tflk9n8mt7Fhc7",
"name": "<string>",
"net_terms": 123,
"plan_type": "STANDARD",
"price_components": [
{
"id": "price_7n42DGM5Tflk9n8mt7Fhc7",
"name": "<string>",
"fee": {
"rates": [
{
"price": "<string>",
"term": "MONTHLY"
}
]
},
"product_id": "prd_7n42DGM5Tflk9n8mt7Fhc7"
}
],
"product_family": {
"id": "pf_7n42DGM5Tflk9n8mt7Fhc7",
"name": "<string>"
},
"status": "DRAFT",
"version": 123,
"version_id": "plv_7n42DGM5Tflk9n8mt7Fhc7",
"billing_cycles": 123,
"description": "<string>",
"entitlements": [
{
"created_at": "2023-11-07T05:31:56Z",
"feature_id": "feat_7n42DGM5Tflk9n8mt7Fhc7",
"id": "ent_7n42DGM5Tflk9n8mt7Fhc7",
"updated_at": "2023-11-07T05:31:56Z",
"value": {
"enabled": true
}
}
],
"minimum_commitment": {
"amount": "<string>",
"scope": {}
},
"period_start_day": 123,
"self_service_rank": 123,
"trial": {
"duration_days": 1,
"is_free": true,
"trialing_plan_id": "plan_7n42DGM5Tflk9n8mt7Fhc7"
}
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Plan ID
Example:
"plan_7n42DGM5Tflk9n8mt7Fhc7"
Body
application/json
Response
Plan updated
Show child attributes
Show child attributes
Example:
"plan_7n42DGM5Tflk9n8mt7Fhc7"
Available options:
STANDARD, FREE, CUSTOM Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
DRAFT, ACTIVE, INACTIVE, ARCHIVED Example:
"plv_7n42DGM5Tflk9n8mt7Fhc7"
Show child attributes
Show child attributes
Plan-level minimum commitment (period true-up floor). When set, every billing-period
invoice for this plan is guaranteed to be at least minimum_commitment.amount after
discounts, with a "Minimum commitment" line filling any shortfall.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I