cURL
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/update/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"turn_off_auto_renew": true,
"end_date": "2023-11-07T05:31:56Z",
"metadata": {}
}
'import requests
url = "https://api.uselotus.io/api/subscriptions/{subscription_id}/update/"
payload = {
"turn_off_auto_renew": True,
"end_date": "2023-11-07T05:31:56Z",
"metadata": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({turn_off_auto_renew: true, end_date: '2023-11-07T05:31:56Z', metadata: {}})
};
fetch('https://api.uselotus.io/api/subscriptions/{subscription_id}/update/', 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.uselotus.io/api/subscriptions/{subscription_id}/update/",
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([
'turn_off_auto_renew' => true,
'end_date' => '2023-11-07T05:31:56Z',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.uselotus.io/api/subscriptions/{subscription_id}/update/"
payload := strings.NewReader("{\n \"turn_off_auto_renew\": true,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.uselotus.io/api/subscriptions/{subscription_id}/update/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"turn_off_auto_renew\": true,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselotus.io/api/subscriptions/{subscription_id}/update/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"turn_off_auto_renew\": true,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"subscription_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"auto_renew": true,
"is_new": true,
"subscription_filters": [
{
"value": "<string>",
"property_name": "<string>"
}
],
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"billing_plan": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"fully_billed": true,
"addons": [
{
"addon_subscription_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"addon": {
"addon_name": "<string>",
"addon_id": "<string>",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"fully_billed": true
}
],
"metadata": {}
}Subscriptions
Update a subscription
Cancel auto-renew or change the end date of a subscription.
POST
/
api
/
subscriptions
/
{subscription_id}
/
update
/
cURL
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/update/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"turn_off_auto_renew": true,
"end_date": "2023-11-07T05:31:56Z",
"metadata": {}
}
'import requests
url = "https://api.uselotus.io/api/subscriptions/{subscription_id}/update/"
payload = {
"turn_off_auto_renew": True,
"end_date": "2023-11-07T05:31:56Z",
"metadata": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({turn_off_auto_renew: true, end_date: '2023-11-07T05:31:56Z', metadata: {}})
};
fetch('https://api.uselotus.io/api/subscriptions/{subscription_id}/update/', 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.uselotus.io/api/subscriptions/{subscription_id}/update/",
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([
'turn_off_auto_renew' => true,
'end_date' => '2023-11-07T05:31:56Z',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.uselotus.io/api/subscriptions/{subscription_id}/update/"
payload := strings.NewReader("{\n \"turn_off_auto_renew\": true,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.uselotus.io/api/subscriptions/{subscription_id}/update/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"turn_off_auto_renew\": true,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselotus.io/api/subscriptions/{subscription_id}/update/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"turn_off_auto_renew\": true,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"subscription_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"auto_renew": true,
"is_new": true,
"subscription_filters": [
{
"value": "<string>",
"property_name": "<string>"
}
],
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"billing_plan": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"fully_billed": true,
"addons": [
{
"addon_subscription_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"addon": {
"addon_name": "<string>",
"addon_id": "<string>",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"fully_billed": true
}
],
"metadata": {}
}lotus.update_subscription(
subscription_id='sub_a623349004cd4947aca1851c64aa6fbd',
turn_off_auto_renew=True
)
lotus.update_subscription(
subscription_id='sub_a623349004cd4947aca1851c64aa6fbd',
end_date='2022-02-23 03:30:00+00:00',
)
await lotus.updateSubscription({
subscription_id: "sub_a623349004cd4947aca1851c64aa6fbd",
turn_off_auto_renew: true,
end_date: "2022-02-23 03:30:00+00:00",
});
Authorizations
knoxTokenAuthOrganizationApiKeyAuth
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
200 - application/json