Preview a plan change
curl --request GET \
--url https://api.1club.ai/v1/platform/plan-changes/{id}/preview \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.1club.ai/v1/platform/plan-changes/{id}/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.1club.ai/v1/platform/plan-changes/{id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/plan-changes/{id}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/plan-changes/{id}/preview"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.1club.ai/v1/platform/plan-changes/{id}/preview")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/plan-changes/{id}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"currency": "<string>",
"direction": "<string>",
"from": {
"planId": 123,
"name": "<string>",
"price": 123,
"billingFrequency": "<string>"
},
"to": {
"planId": 123,
"name": "<string>",
"price": 123,
"billingFrequency": "<string>"
},
"nextRenewal": {
"available": true,
"effectiveAt": "2023-11-07T05:31:56Z"
},
"now": {
"available": true,
"reason": "no_running_period",
"unusedDays": 123,
"credit": 123,
"charge": 123,
"net": 123,
"total": 123,
"repriced": [
{
"transactionId": 123,
"amount": 123,
"newAmount": 123
}
]
}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Memberships
Preview a plan change
What applying a plan change would do: both plans and their prices, whether it can be applied at the next renewal and from when, and whether it can be applied now and what that charges the member or credits to their Wallet for the unused days of the period already paid for. Nothing is changed.
GET
/
v1
/
platform
/
plan-changes
/
{id}
/
preview
Preview a plan change
curl --request GET \
--url https://api.1club.ai/v1/platform/plan-changes/{id}/preview \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.1club.ai/v1/platform/plan-changes/{id}/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.1club.ai/v1/platform/plan-changes/{id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/plan-changes/{id}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/plan-changes/{id}/preview"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.1club.ai/v1/platform/plan-changes/{id}/preview")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/plan-changes/{id}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"currency": "<string>",
"direction": "<string>",
"from": {
"planId": 123,
"name": "<string>",
"price": 123,
"billingFrequency": "<string>"
},
"to": {
"planId": 123,
"name": "<string>",
"price": 123,
"billingFrequency": "<string>"
},
"nextRenewal": {
"available": true,
"effectiveAt": "2023-11-07T05:31:56Z"
},
"now": {
"available": true,
"reason": "no_running_period",
"unusedDays": 123,
"credit": 123,
"charge": 123,
"net": 123,
"total": 123,
"repriced": [
{
"transactionId": 123,
"amount": 123,
"newAmount": 123
}
]
}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Response
The preview
Was this page helpful?