curl --request PATCH \
--url https://api.paygentic.io/v0/plans/{id}/versions/{versionNumber} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"default": true
}
'import requests
url = "https://api.paygentic.io/v0/plans/{id}/versions/{versionNumber}"
payload = { "default": 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({default: true})
};
fetch('https://api.paygentic.io/v0/plans/{id}/versions/{versionNumber}', 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.paygentic.io/v0/plans/{id}/versions/{versionNumber}",
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([
'default' => 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.paygentic.io/v0/plans/{id}/versions/{versionNumber}"
payload := strings.NewReader("{\n \"default\": 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.paygentic.io/v0/plans/{id}/versions/{versionNumber}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"default\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/plans/{id}/versions/{versionNumber}")
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 \"default\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "plan_version",
"versionNumber": 2,
"status": "published",
"isDefault": true,
"subscriptionCount": 1,
"updatedAt": "2023-11-07T05:31:56Z",
"prices": [
{
"id": "<string>",
"object": "price",
"merchantId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"invoiceDisplayName": "<string>",
"model": "standard",
"paymentTerm": "in_arrears",
"properties": {},
"updatedAt": "2023-11-07T05:31:56Z",
"quantity": 1,
"priceDeleted": true,
"billableMetricId": "<string>",
"feeId": "<string>",
"billingCadence": "<string>",
"currency": "<string>",
"description": "<string>",
"unitAmount": "<string>",
"features": [
{
"id": "<string>",
"featureId": "<string>",
"entitlementTemplate": {},
"feature": {
"key": "<string>",
"name": "<string>",
"type": "metered"
}
}
],
"grantDiscountEnabled": false,
"isObligation": false
}
],
"publishedAt": "2023-11-07T05:31:56Z",
"basedOnVersionId": "<string>"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Set the default version
Point the plan’s default at this version, so its floating subscriptions bill from it. Any version may become default, in either direction — this is how you roll a plan back to (or forward to) an earlier price set. Idempotent when the version is already the default.
curl --request PATCH \
--url https://api.paygentic.io/v0/plans/{id}/versions/{versionNumber} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"default": true
}
'import requests
url = "https://api.paygentic.io/v0/plans/{id}/versions/{versionNumber}"
payload = { "default": 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({default: true})
};
fetch('https://api.paygentic.io/v0/plans/{id}/versions/{versionNumber}', 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.paygentic.io/v0/plans/{id}/versions/{versionNumber}",
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([
'default' => 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.paygentic.io/v0/plans/{id}/versions/{versionNumber}"
payload := strings.NewReader("{\n \"default\": 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.paygentic.io/v0/plans/{id}/versions/{versionNumber}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"default\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/plans/{id}/versions/{versionNumber}")
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 \"default\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "plan_version",
"versionNumber": 2,
"status": "published",
"isDefault": true,
"subscriptionCount": 1,
"updatedAt": "2023-11-07T05:31:56Z",
"prices": [
{
"id": "<string>",
"object": "price",
"merchantId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"invoiceDisplayName": "<string>",
"model": "standard",
"paymentTerm": "in_arrears",
"properties": {},
"updatedAt": "2023-11-07T05:31:56Z",
"quantity": 1,
"priceDeleted": true,
"billableMetricId": "<string>",
"feeId": "<string>",
"billingCadence": "<string>",
"currency": "<string>",
"description": "<string>",
"unitAmount": "<string>",
"features": [
{
"id": "<string>",
"featureId": "<string>",
"entitlementTemplate": {},
"feature": {
"key": "<string>",
"name": "<string>",
"type": "metered"
}
}
],
"grantDiscountEnabled": false,
"isObligation": false
}
],
"publishedAt": "2023-11-07T05:31:56Z",
"basedOnVersionId": "<string>"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Path Parameters
Unique identifier for a plan
^plan_[a-zA-Z0-9]+$The version number within the plan (1-based).
x >= 1Body
Sets this version as the plan's default.
Set to true to point the plan's default at this version. Idempotent on the already-default version.
Response
The transitioned plan version
A single plan version, including its price slots. Extends the list summary with the version's prices.
Unique identifier for a plan version
^pver_[a-zA-Z0-9]+$plan_version Monotonic version number within the plan, starting at 1.
x >= 1Lifecycle status of the version.
published, archived Whether this version is the plan's current default (live) version.
Number of committed-status subscriptions pinned to this version at creation time. Not a live-billing cohort.
x >= 0When this version was last modified.
The price slots that make up this version.
Show child attributes
Show child attributes
When this version was published.
The version this one follows on from — the version that was live when this one was created, and whose prices it was built from. Absent for versions created before this field existed.
^pver_[a-zA-Z0-9]+$Was this page helpful?