curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/attach/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"addon_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 1,
"metadata": {}
}
'import requests
url = "https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/attach/"
payload = {
"addon_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 1,
"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({addon_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', quantity: 1, metadata: {}})
};
fetch('https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/attach/', 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}/addons/attach/",
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([
'addon_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 1,
'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}/addons/attach/"
payload := strings.NewReader("{\n \"addon_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 1,\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}/addons/attach/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"addon_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 1,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/attach/")
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 \"addon_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 1,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"addon_subscription_id": "<string>",
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"addon": {
"addon_name": "<string>",
"addon_id": "<string>",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"parent": {
"fully_billed": true,
"plan_detail": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"subscription_id": "<string>",
"metadata": {},
"subscription_filters": [
{
"value": "<string>",
"property_name": "<string>"
}
],
"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
}
],
"is_new": true,
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"billing_plan": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"auto_renew": true
},
"fully_billed": true,
"auto_renew": true,
"metadata": {}
}Attach an Add-On
Add an addon to a customer’s subscription
curl --request POST \
--url https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/attach/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"addon_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 1,
"metadata": {}
}
'import requests
url = "https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/attach/"
payload = {
"addon_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 1,
"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({addon_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', quantity: 1, metadata: {}})
};
fetch('https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/attach/', 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}/addons/attach/",
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([
'addon_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 1,
'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}/addons/attach/"
payload := strings.NewReader("{\n \"addon_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 1,\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}/addons/attach/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"addon_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 1,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselotus.io/api/subscriptions/{subscription_id}/addons/attach/")
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 \"addon_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 1,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"addon_subscription_id": "<string>",
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"addon": {
"addon_name": "<string>",
"addon_id": "<string>",
"addon_type": "flat",
"billing_frequency": "one_time"
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"parent": {
"fully_billed": true,
"plan_detail": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"subscription_id": "<string>",
"metadata": {},
"subscription_filters": [
{
"value": "<string>",
"property_name": "<string>"
}
],
"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
}
],
"is_new": true,
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"billing_plan": {
"plan_name": "<string>",
"plan_id": "<string>",
"version_id": "<string>",
"version": 123
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"auto_renew": true
},
"fully_billed": true,
"auto_renew": true,
"metadata": {}
}lotus.attach_addon(
subscription_id='sub_e953bfbf42a442ca90079c8f1656d306',
addon_id='addon_5af61a194ca144478fb2721dd34c9049',
quantity=3,
)
await lotus.attachAddon({
subscription_id: "sub_e953bfbf42a442ca90079c8f1656d306",
addon_id: "addon_5af61a194ca144478fb2721dd34c9049",
quantity: 3,
});
Authorizations
Token-based authentication with required prefix "Token"
Path Parameters
The ID of the subscription to add an addon to.
Body
The add-on to be applied to the subscription.
The quantity of the add-on to be applied to the subscription. Flat fees of add-ons will be multiplied by this quantity. Usage-based components of add-ons will be unaffected by the quantity.
x >= 1A JSON object containing additional information about the add-on subscription. This will be returned in the response when you retrieve the add-on subscription.
Show child attributes
Show child attributes
Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.
Show child attributes
Show child attributes
Whether the subscription automatically renews. Defaults to true.
Show child attributes
Show child attributes