Add feature to plan
curl --request POST \
--url https://commet.co/api/v1/plans/{id}/features \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"featureId": "<string>",
"enabled": true,
"includedAmount": 0,
"unlimited": false,
"pricingMode": "fixed",
"overageEnabled": true,
"overageUnitPrice": 123
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
featureId: '<string>',
enabled: true,
includedAmount: 0,
unlimited: false,
pricingMode: 'fixed',
overageEnabled: true,
overageUnitPrice: 123
})
};
fetch('https://commet.co/api/v1/plans/{id}/features', 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}/features"
payload = {
"featureId": "<string>",
"enabled": True,
"includedAmount": 0,
"unlimited": False,
"pricingMode": "fixed",
"overageEnabled": True,
"overageUnitPrice": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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}/features"
payload := strings.NewReader("{\n \"featureId\": \"<string>\",\n \"enabled\": true,\n \"includedAmount\": 0,\n \"unlimited\": false,\n \"pricingMode\": \"fixed\",\n \"overageEnabled\": true,\n \"overageUnitPrice\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://commet.co/api/v1/plans/{id}/features")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"featureId\": \"<string>\",\n \"enabled\": true,\n \"includedAmount\": 0,\n \"unlimited\": false,\n \"pricingMode\": \"fixed\",\n \"overageEnabled\": true,\n \"overageUnitPrice\": 123\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/plans/{id}/features",
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([
'featureId' => '<string>',
'enabled' => true,
'includedAmount' => 0,
'unlimited' => false,
'pricingMode' => 'fixed',
'overageEnabled' => true,
'overageUnitPrice' => 123
]),
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": {
"planId": "<string>",
"featureId": "<string>",
"enabled": true,
"includedAmount": 0,
"unlimited": true,
"creditsPerUnit": 0,
"pricingMode": "fixed",
"margin": 0,
"overageEnabled": true,
"overageUnitPrice": 123
}
}{
"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
Add feature to plan
Attach a feature to a plan with limits, overage, and credits configuration.
POST
/
plans
/
{id}
/
features
Add feature to plan
curl --request POST \
--url https://commet.co/api/v1/plans/{id}/features \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"featureId": "<string>",
"enabled": true,
"includedAmount": 0,
"unlimited": false,
"pricingMode": "fixed",
"overageEnabled": true,
"overageUnitPrice": 123
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
featureId: '<string>',
enabled: true,
includedAmount: 0,
unlimited: false,
pricingMode: 'fixed',
overageEnabled: true,
overageUnitPrice: 123
})
};
fetch('https://commet.co/api/v1/plans/{id}/features', 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}/features"
payload = {
"featureId": "<string>",
"enabled": True,
"includedAmount": 0,
"unlimited": False,
"pricingMode": "fixed",
"overageEnabled": True,
"overageUnitPrice": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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}/features"
payload := strings.NewReader("{\n \"featureId\": \"<string>\",\n \"enabled\": true,\n \"includedAmount\": 0,\n \"unlimited\": false,\n \"pricingMode\": \"fixed\",\n \"overageEnabled\": true,\n \"overageUnitPrice\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://commet.co/api/v1/plans/{id}/features")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"featureId\": \"<string>\",\n \"enabled\": true,\n \"includedAmount\": 0,\n \"unlimited\": false,\n \"pricingMode\": \"fixed\",\n \"overageEnabled\": true,\n \"overageUnitPrice\": 123\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/plans/{id}/features",
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([
'featureId' => '<string>',
'enabled' => true,
'includedAmount' => 0,
'unlimited' => false,
'pricingMode' => 'fixed',
'overageEnabled' => true,
'overageUnitPrice' => 123
]),
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": {
"planId": "<string>",
"featureId": "<string>",
"enabled": true,
"includedAmount": 0,
"unlimited": true,
"creditsPerUnit": 0,
"pricingMode": "fixed",
"margin": 0,
"overageEnabled": true,
"overageUnitPrice": 123
}
}{
"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-12. Send Commet-Version: 2026-05-12 with your request.Encabezados
Cuerpo
application/json
¿Esta página le ayudó?