Update plan price
curl --request PUT \
--url https://commet.co/api/v1/plans/{id}/prices/{priceId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"price": 4503599627370495,
"isDefault": true,
"trialDays": 365,
"trialRequiresPaymentMethod": true,
"includedBalance": 0,
"includedCredits": 0,
"introOfferEnabled": true,
"introOfferDiscountValue": 123,
"introOfferDurationCycles": 123
}
'const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
price: 4503599627370495,
isDefault: true,
trialDays: 365,
trialRequiresPaymentMethod: true,
includedBalance: 0,
includedCredits: 0,
introOfferEnabled: true,
introOfferDiscountValue: 123,
introOfferDurationCycles: 123
})
};
fetch('https://commet.co/api/v1/plans/{id}/prices/{priceId}', 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}/prices/{priceId}"
payload = {
"price": 4503599627370495,
"isDefault": True,
"trialDays": 365,
"trialRequiresPaymentMethod": True,
"includedBalance": 0,
"includedCredits": 0,
"introOfferEnabled": True,
"introOfferDiscountValue": 123,
"introOfferDurationCycles": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(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}/prices/{priceId}"
payload := strings.NewReader("{\n \"price\": 4503599627370495,\n \"isDefault\": true,\n \"trialDays\": 365,\n \"trialRequiresPaymentMethod\": true,\n \"includedBalance\": 0,\n \"includedCredits\": 0,\n \"introOfferEnabled\": true,\n \"introOfferDiscountValue\": 123,\n \"introOfferDurationCycles\": 123\n}")
req, _ := http.NewRequest("PUT", 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.put("https://commet.co/api/v1/plans/{id}/prices/{priceId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"price\": 4503599627370495,\n \"isDefault\": true,\n \"trialDays\": 365,\n \"trialRequiresPaymentMethod\": true,\n \"includedBalance\": 0,\n \"includedCredits\": 0,\n \"introOfferEnabled\": true,\n \"introOfferDiscountValue\": 123,\n \"introOfferDurationCycles\": 123\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/plans/{id}/prices/{priceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'price' => 4503599627370495,
'isDefault' => true,
'trialDays' => 365,
'trialRequiresPaymentMethod' => true,
'includedBalance' => 0,
'includedCredits' => 0,
'introOfferEnabled' => true,
'introOfferDiscountValue' => 123,
'introOfferDurationCycles' => 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": {
"id": "<string>",
"planId": "<string>",
"billingInterval": "weekly",
"price": 0,
"isDefault": true,
"trialDays": 0,
"trialRequiresPaymentMethod": true,
"includedBalance": 0,
"includedCredits": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"introOfferEnabled": true,
"introOfferDiscountType": "percentage",
"introOfferDiscountValue": 123,
"introOfferDurationCycles": 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
Update plan price
Update an existing price on a plan.
PUT
/
plans
/
{id}
/
prices
/
{priceId}
Update plan price
curl --request PUT \
--url https://commet.co/api/v1/plans/{id}/prices/{priceId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"price": 4503599627370495,
"isDefault": true,
"trialDays": 365,
"trialRequiresPaymentMethod": true,
"includedBalance": 0,
"includedCredits": 0,
"introOfferEnabled": true,
"introOfferDiscountValue": 123,
"introOfferDurationCycles": 123
}
'const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
price: 4503599627370495,
isDefault: true,
trialDays: 365,
trialRequiresPaymentMethod: true,
includedBalance: 0,
includedCredits: 0,
introOfferEnabled: true,
introOfferDiscountValue: 123,
introOfferDurationCycles: 123
})
};
fetch('https://commet.co/api/v1/plans/{id}/prices/{priceId}', 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}/prices/{priceId}"
payload = {
"price": 4503599627370495,
"isDefault": True,
"trialDays": 365,
"trialRequiresPaymentMethod": True,
"includedBalance": 0,
"includedCredits": 0,
"introOfferEnabled": True,
"introOfferDiscountValue": 123,
"introOfferDurationCycles": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(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}/prices/{priceId}"
payload := strings.NewReader("{\n \"price\": 4503599627370495,\n \"isDefault\": true,\n \"trialDays\": 365,\n \"trialRequiresPaymentMethod\": true,\n \"includedBalance\": 0,\n \"includedCredits\": 0,\n \"introOfferEnabled\": true,\n \"introOfferDiscountValue\": 123,\n \"introOfferDurationCycles\": 123\n}")
req, _ := http.NewRequest("PUT", 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.put("https://commet.co/api/v1/plans/{id}/prices/{priceId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"price\": 4503599627370495,\n \"isDefault\": true,\n \"trialDays\": 365,\n \"trialRequiresPaymentMethod\": true,\n \"includedBalance\": 0,\n \"includedCredits\": 0,\n \"introOfferEnabled\": true,\n \"introOfferDiscountValue\": 123,\n \"introOfferDurationCycles\": 123\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/plans/{id}/prices/{priceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'price' => 4503599627370495,
'isDefault' => true,
'trialDays' => 365,
'trialRequiresPaymentMethod' => true,
'includedBalance' => 0,
'includedCredits' => 0,
'introOfferEnabled' => true,
'introOfferDiscountValue' => 123,
'introOfferDurationCycles' => 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": {
"id": "<string>",
"planId": "<string>",
"billingInterval": "weekly",
"price": 0,
"isDefault": true,
"trialDays": 0,
"trialRequiresPaymentMethod": true,
"includedBalance": 0,
"includedCredits": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"introOfferEnabled": true,
"introOfferDiscountType": "percentage",
"introOfferDiscountValue": 123,
"introOfferDurationCycles": 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ó?