Extend a membership
curl --request POST \
--url https://api.1club.ai/v1/platform/memberships/{id}/extensions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"days": 0,
"reason": "<string>"
}
'import requests
url = "https://api.1club.ai/v1/platform/memberships/{id}/extensions"
payload = {
"days": 0,
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({days: 0, reason: '<string>'})
};
fetch('https://api.1club.ai/v1/platform/memberships/{id}/extensions', 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/memberships/{id}/extensions",
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([
'days' => 0,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/memberships/{id}/extensions"
payload := strings.NewReader("{\n \"days\": 0,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.1club.ai/v1/platform/memberships/{id}/extensions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"days\": 0,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/memberships/{id}/extensions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"days\": 0,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"membershipId": 123,
"membershipUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contactId": 123,
"planId": 123,
"planName": "<string>",
"clubId": 123,
"status": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"renewalDate": "2023-11-07T05:31:56Z",
"autoRenew": true,
"price": 123,
"billingFrequency": "<string>",
"customPeriod": 123,
"customPeriodUnit": "<string>",
"maxUses": 123,
"usesRemaining": 123,
"usesAdjustment": 123,
"allowances": [
{
"allowanceId": 123,
"validFor": {},
"maxUses": 123,
"usesRemaining": 123,
"usesAdjustment": 123,
"sessionUnit": "<string>"
}
],
"sessionLengthMinutes": 123,
"shareWithAccount": true,
"commitmentEndsAt": "2023-11-07T05:31:56Z",
"commitmentMonths": 123,
"createdAt": "2023-11-07T05:31:56Z"
}{
"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
Extend a membership
Moves a membership’s end by whole days, with a reason, recorded on the membership as staff extensions in 1club are: the end date of a membership that stops, the next billing date of one that renews. A negative number takes back an earlier extension. An expired membership whose new end is still ahead becomes active again. To move the end to a date, send the days between the current end (endDate, or renewalDate on a renewing membership) and that date.
Supports the Idempotency-Key header.
POST
/
v1
/
platform
/
memberships
/
{id}
/
extensions
Extend a membership
curl --request POST \
--url https://api.1club.ai/v1/platform/memberships/{id}/extensions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"days": 0,
"reason": "<string>"
}
'import requests
url = "https://api.1club.ai/v1/platform/memberships/{id}/extensions"
payload = {
"days": 0,
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({days: 0, reason: '<string>'})
};
fetch('https://api.1club.ai/v1/platform/memberships/{id}/extensions', 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/memberships/{id}/extensions",
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([
'days' => 0,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/memberships/{id}/extensions"
payload := strings.NewReader("{\n \"days\": 0,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.1club.ai/v1/platform/memberships/{id}/extensions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"days\": 0,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/memberships/{id}/extensions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"days\": 0,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"membershipId": 123,
"membershipUuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contactId": 123,
"planId": 123,
"planName": "<string>",
"clubId": 123,
"status": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"renewalDate": "2023-11-07T05:31:56Z",
"autoRenew": true,
"price": 123,
"billingFrequency": "<string>",
"customPeriod": 123,
"customPeriodUnit": "<string>",
"maxUses": 123,
"usesRemaining": 123,
"usesAdjustment": 123,
"allowances": [
{
"allowanceId": 123,
"validFor": {},
"maxUses": 123,
"usesRemaining": 123,
"usesAdjustment": 123,
"sessionUnit": "<string>"
}
],
"sessionLengthMinutes": 123,
"shareWithAccount": true,
"commitmentEndsAt": "2023-11-07T05:31:56Z",
"commitmentMonths": 123,
"createdAt": "2023-11-07T05:31:56Z"
}{
"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
Headers
Body
application/json
Response
The extended membership
A customer's membership on a plan. The plan is snapshotted onto it at creation, so allowance and coverage behave exactly as they do for a membership sold in 1club.
Was this page helpful?