Update plan draft
curl --request PATCH \
--url https://commet.co/api/v1/plans/{id}/drafts/{draftId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"prices": [
{
"price": 4503599627370495,
"includedCredits": 4503599627370495,
"includedBalance": 4503599627370495,
"trialDays": 365,
"trialRequiresPaymentMethod": true,
"isDefault": true
}
]
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prices: [
{
price: 4503599627370495,
includedCredits: 4503599627370495,
includedBalance: 4503599627370495,
trialDays: 365,
trialRequiresPaymentMethod: true,
isDefault: true
}
]
})
};
fetch('https://commet.co/api/v1/plans/{id}/drafts/{draftId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/plans/{id}/drafts/{draftId}"
payload = { "prices": [
{
"price": 4503599627370495,
"includedCredits": 4503599627370495,
"includedBalance": 4503599627370495,
"trialDays": 365,
"trialRequiresPaymentMethod": True,
"isDefault": True
}
] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/plans/{id}/drafts/{draftId}"
payload := strings.NewReader("{\n \"prices\": [\n {\n \"price\": 4503599627370495,\n \"includedCredits\": 4503599627370495,\n \"includedBalance\": 4503599627370495,\n \"trialDays\": 365,\n \"trialRequiresPaymentMethod\": true,\n \"isDefault\": true\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://commet.co/api/v1/plans/{id}/drafts/{draftId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prices\": [\n {\n \"price\": 4503599627370495,\n \"includedCredits\": 4503599627370495,\n \"includedBalance\": 4503599627370495,\n \"trialDays\": 365,\n \"trialRequiresPaymentMethod\": true,\n \"isDefault\": true\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/plans/{id}/drafts/{draftId}",
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([
'prices' => [
[
'price' => 4503599627370495,
'includedCredits' => 4503599627370495,
'includedBalance' => 4503599627370495,
'trialDays' => 365,
'trialRequiresPaymentMethod' => true,
'isDefault' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"id": "<string>",
"fromVersionId": "<string>",
"changes": [
{
"key": "<string>",
"section": "<string>",
"country": "<string>",
"label": "<string>",
"before": "<string>",
"after": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}Plans
Update plan draft
Change a draft’s prices per interval, trials, the interval shown first, countries with their currency and prices, and credit or balance rules, or undo single changes. Each block sent replaces that block; blocks left out stay as they are. Buyers and subscribers see nothing until the draft is published.
PATCH
/
plans
/
{id}
/
drafts
/
{draftId}
Update plan draft
curl --request PATCH \
--url https://commet.co/api/v1/plans/{id}/drafts/{draftId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"prices": [
{
"price": 4503599627370495,
"includedCredits": 4503599627370495,
"includedBalance": 4503599627370495,
"trialDays": 365,
"trialRequiresPaymentMethod": true,
"isDefault": true
}
]
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prices: [
{
price: 4503599627370495,
includedCredits: 4503599627370495,
includedBalance: 4503599627370495,
trialDays: 365,
trialRequiresPaymentMethod: true,
isDefault: true
}
]
})
};
fetch('https://commet.co/api/v1/plans/{id}/drafts/{draftId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/plans/{id}/drafts/{draftId}"
payload = { "prices": [
{
"price": 4503599627370495,
"includedCredits": 4503599627370495,
"includedBalance": 4503599627370495,
"trialDays": 365,
"trialRequiresPaymentMethod": True,
"isDefault": True
}
] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://commet.co/api/v1/plans/{id}/drafts/{draftId}"
payload := strings.NewReader("{\n \"prices\": [\n {\n \"price\": 4503599627370495,\n \"includedCredits\": 4503599627370495,\n \"includedBalance\": 4503599627370495,\n \"trialDays\": 365,\n \"trialRequiresPaymentMethod\": true,\n \"isDefault\": true\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://commet.co/api/v1/plans/{id}/drafts/{draftId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prices\": [\n {\n \"price\": 4503599627370495,\n \"includedCredits\": 4503599627370495,\n \"includedBalance\": 4503599627370495,\n \"trialDays\": 365,\n \"trialRequiresPaymentMethod\": true,\n \"isDefault\": true\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/plans/{id}/drafts/{draftId}",
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([
'prices' => [
[
'price' => 4503599627370495,
'includedCredits' => 4503599627370495,
'includedBalance' => 4503599627370495,
'trialDays' => 365,
'trialRequiresPaymentMethod' => true,
'isDefault' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"id": "<string>",
"fromVersionId": "<string>",
"changes": [
{
"key": "<string>",
"section": "<string>",
"country": "<string>",
"label": "<string>",
"before": "<string>",
"after": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}This reference describes API version
2026-05-18. Send Commet-Version: 2026-05-18 with your request.Headers
Body
application/json
Was this page helpful?