Move subscribers to a plan version
curl --request POST \
--url https://commet.co/api/v1/plans/{id}/moves \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"subscriptionIds": [
"<string>"
],
"toVersionId": "<string>",
"changes": [],
"preview": false
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionIds: ['<string>'],
toVersionId: '<string>',
changes: [],
preview: false
})
};
fetch('https://commet.co/api/v1/plans/{id}/moves', 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}/moves"
payload = {
"subscriptionIds": ["<string>"],
"toVersionId": "<string>",
"changes": [],
"preview": False
}
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}/moves"
payload := strings.NewReader("{\n \"subscriptionIds\": [\n \"<string>\"\n ],\n \"toVersionId\": \"<string>\",\n \"changes\": [],\n \"preview\": false\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}/moves")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionIds\": [\n \"<string>\"\n ],\n \"toVersionId\": \"<string>\",\n \"changes\": [],\n \"preview\": false\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/plans/{id}/moves",
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([
'subscriptionIds' => [
'<string>'
],
'toVersionId' => '<string>',
'changes' => [
],
'preview' => false
]),
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>",
"toVersionId": "<string>",
"fromVersionIds": [
"<string>"
],
"effective": "now",
"preview": true,
"status": "checking",
"counts": {
"moving": 0,
"moved": 0,
"needsAChange": 0,
"leftOut": 0,
"canceled": 0,
"keptOnVersion": 0
},
"subscriptions": [
{
"subscriptionId": "<string>",
"status": "moving",
"code": "<string>",
"message": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"object": "subscription",
"livemode": true
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}Plans
Move subscribers to a plan version
Move a list of subscriptions, or every subscription of another version, to a newer version of the plan, at their next renewal or now. Nobody moves unless every one of them fits or has a change in changes; otherwise the response lists each one with what would make it fit. Only active, trialing and past due subscriptions move. Paused ones, and listed subscriptions in another status or already on the destination, are left out. Send preview to check without moving anyone.
POST
/
plans
/
{id}
/
moves
Move subscribers to a plan version
curl --request POST \
--url https://commet.co/api/v1/plans/{id}/moves \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"subscriptionIds": [
"<string>"
],
"toVersionId": "<string>",
"changes": [],
"preview": false
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionIds: ['<string>'],
toVersionId: '<string>',
changes: [],
preview: false
})
};
fetch('https://commet.co/api/v1/plans/{id}/moves', 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}/moves"
payload = {
"subscriptionIds": ["<string>"],
"toVersionId": "<string>",
"changes": [],
"preview": False
}
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}/moves"
payload := strings.NewReader("{\n \"subscriptionIds\": [\n \"<string>\"\n ],\n \"toVersionId\": \"<string>\",\n \"changes\": [],\n \"preview\": false\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}/moves")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionIds\": [\n \"<string>\"\n ],\n \"toVersionId\": \"<string>\",\n \"changes\": [],\n \"preview\": false\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://commet.co/api/v1/plans/{id}/moves",
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([
'subscriptionIds' => [
'<string>'
],
'toVersionId' => '<string>',
'changes' => [
],
'preview' => false
]),
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>",
"toVersionId": "<string>",
"fromVersionIds": [
"<string>"
],
"effective": "now",
"preview": true,
"status": "checking",
"counts": {
"moving": 0,
"moved": 0,
"needsAChange": 0,
"leftOut": 0,
"canceled": 0,
"keptOnVersion": 0
},
"subscriptions": [
{
"subscriptionId": "<string>",
"status": "moving",
"code": "<string>",
"message": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"object": "subscription",
"livemode": true
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"details": "<unknown>"
}
}This reference describes API version
2026-06-10. Send Commet-Version: 2026-06-10 with your request.Encabezados
Cuerpo
application/json
- Option 1
- Option 2
¿Esta página le ayudó?