curl --request PATCH \
--url https://api.useplinth.com/v1/plans/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"amount_minor": 123,
"billing_interval_count": 123,
"trial_period_days": 123,
"lookup_key": "<string>",
"active": true
}
'import requests
url = "https://api.useplinth.com/v1/plans/{id}"
payload = {
"name": "<string>",
"amount_minor": 123,
"billing_interval_count": 123,
"trial_period_days": 123,
"lookup_key": "<string>",
"active": True
}
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({
name: '<string>',
amount_minor: 123,
billing_interval_count: 123,
trial_period_days: 123,
lookup_key: '<string>',
active: true
})
};
fetch('https://api.useplinth.com/v1/plans/{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.useplinth.com/v1/plans/{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([
'name' => '<string>',
'amount_minor' => 123,
'billing_interval_count' => 123,
'trial_period_days' => 123,
'lookup_key' => '<string>',
'active' => true
]),
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.useplinth.com/v1/plans/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"amount_minor\": 123,\n \"billing_interval_count\": 123,\n \"trial_period_days\": 123,\n \"lookup_key\": \"<string>\",\n \"active\": true\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.useplinth.com/v1/plans/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"amount_minor\": 123,\n \"billing_interval_count\": 123,\n \"trial_period_days\": 123,\n \"lookup_key\": \"<string>\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useplinth.com/v1/plans/{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 \"name\": \"<string>\",\n \"amount_minor\": 123,\n \"billing_interval_count\": 123,\n \"trial_period_days\": 123,\n \"lookup_key\": \"<string>\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "plan",
"id": "pln_01JABC...",
"plan_group_id": "pg_01JABC...",
"name": "Pro",
"amount_minor": "500000",
"interval": "month",
"interval_count": 1,
"trial_period_days": 14,
"lookup_key": "pro_monthly",
"active": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "Cannot change amount on a plan that already has subscriptions. Create a new plan and migrate subscribers instead."
}Update a plan
Updates a plan. Marketing fields (name, lookup_key, trial days, active) can always be changed. Price and billing interval are immutable once the plan has subscribers — attempting to change them returns 400 (plan_immutable). To change a price, create a new plan and migrate subscribers with a plan change.
curl --request PATCH \
--url https://api.useplinth.com/v1/plans/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"amount_minor": 123,
"billing_interval_count": 123,
"trial_period_days": 123,
"lookup_key": "<string>",
"active": true
}
'import requests
url = "https://api.useplinth.com/v1/plans/{id}"
payload = {
"name": "<string>",
"amount_minor": 123,
"billing_interval_count": 123,
"trial_period_days": 123,
"lookup_key": "<string>",
"active": True
}
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({
name: '<string>',
amount_minor: 123,
billing_interval_count: 123,
trial_period_days: 123,
lookup_key: '<string>',
active: true
})
};
fetch('https://api.useplinth.com/v1/plans/{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.useplinth.com/v1/plans/{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([
'name' => '<string>',
'amount_minor' => 123,
'billing_interval_count' => 123,
'trial_period_days' => 123,
'lookup_key' => '<string>',
'active' => true
]),
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.useplinth.com/v1/plans/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"amount_minor\": 123,\n \"billing_interval_count\": 123,\n \"trial_period_days\": 123,\n \"lookup_key\": \"<string>\",\n \"active\": true\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.useplinth.com/v1/plans/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"amount_minor\": 123,\n \"billing_interval_count\": 123,\n \"trial_period_days\": 123,\n \"lookup_key\": \"<string>\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useplinth.com/v1/plans/{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 \"name\": \"<string>\",\n \"amount_minor\": 123,\n \"billing_interval_count\": 123,\n \"trial_period_days\": 123,\n \"lookup_key\": \"<string>\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "plan",
"id": "pln_01JABC...",
"plan_group_id": "pg_01JABC...",
"name": "Pro",
"amount_minor": "500000",
"interval": "month",
"interval_count": 1,
"trial_period_days": 14,
"lookup_key": "pro_monthly",
"active": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "Cannot change amount on a plan that already has subscriptions. Create a new plan and migrate subscribers instead."
}Authorizations
Use sk_test_ keys for sandbox. Use sk_live_ keys for production. Obtain your key from the dashboard.
Path Parameters
Body
100Only allowed if the plan has no subscribers.
day, week, month, year ^[a-z0-9_]+$Set false to archive.
Response
Plan updated
plan "pln_01JABC..."
"pg_01JABC..."
"Pro"
Amount in kobo as a string. ₦5,000 = "500000".
"500000"
day, week, month, year "month"
1
14
Stable, human-meaningful handle for the plan (e.g. "pro_monthly"). Unique per tenant. Reference this instead of the UUID so your app doesn't hardcode environment-specific ids.
"pro_monthly"
false when the plan is archived — hidden from the default plan list and closed to new subscriptions. Existing subscribers keep billing.
true