Create add-on
curl --request POST \
--url https://commet.co/api/v1/addons \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"basePrice": 4503599627370495,
"featureId": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', basePrice: 4503599627370495, featureId: '<string>'})
};
fetch('https://commet.co/api/v1/addons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/addons"
payload = {
"name": "<string>",
"basePrice": 4503599627370495,
"featureId": "<string>"
}
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/addons"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"basePrice\": 4503599627370495,\n \"featureId\": \"<string>\"\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/addons")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"basePrice\": 4503599627370495,\n \"featureId\": \"<string>\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/addons",
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([
'name' => '<string>',
'basePrice' => 4503599627370495,
'featureId' => '<string>'
]),
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>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"basePrice": 0,
"featureCode": "<string>",
"featureName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"consumptionModel": "boolean",
"includedUnits": 0,
"overageRate": 0,
"creditCost": 0
}
}{
"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>"
}{
"success": false,
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}Add-ons
Create add-on
Create a new add-on linked to a feature. Each feature can only be assigned to one add-on.
POST
/
addons
Create add-on
curl --request POST \
--url https://commet.co/api/v1/addons \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"basePrice": 4503599627370495,
"featureId": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', basePrice: 4503599627370495, featureId: '<string>'})
};
fetch('https://commet.co/api/v1/addons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://commet.co/api/v1/addons"
payload = {
"name": "<string>",
"basePrice": 4503599627370495,
"featureId": "<string>"
}
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/addons"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"basePrice\": 4503599627370495,\n \"featureId\": \"<string>\"\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/addons")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"basePrice\": 4503599627370495,\n \"featureId\": \"<string>\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/addons",
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([
'name' => '<string>',
'basePrice' => 4503599627370495,
'featureId' => '<string>'
]),
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>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"basePrice": 0,
"featureCode": "<string>",
"featureName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"consumptionModel": "boolean",
"includedUnits": 0,
"overageRate": 0,
"creditCost": 0
}
}{
"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>"
}{
"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.Autorizaciones
Encabezados
API version used by this reference. Send this header to select this contract explicitly.
Cuerpo
application/json
Required string length:
1 - 100Rango requerido:
0 <= x <= 9007199254740991Minimum string length:
1Opciones disponibles:
boolean, metered, credits, balance Maximum string length:
255Rango requerido:
0 <= x <= 9007199254740991Rango requerido:
0 <= x <= 9007199254740991Rango requerido:
0 <= x <= 9007199254740991¿Esta página le ayudó?