Attach addon
curl --request POST \
--url https://api.truthlocks.com/v1/billing/addons/attach \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"addon_key": "<string>",
"quantity": 123
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({addon_key: '<string>', quantity: 123})
};
fetch('https://api.truthlocks.com/v1/billing/addons/attach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/billing/addons/attach"
payload = {
"addon_key": "<string>",
"quantity": 123
}
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://api.truthlocks.com/v1/billing/addons/attach"
payload := strings.NewReader("{\n \"addon_key\": \"<string>\",\n \"quantity\": 123\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))
}{
"addon_id": "<string>",
"status": "<string>",
"effective_at": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Billing
Attach an add-on
Attaches a billing addon to the tenant’s subscription.
POST
/
v1
/
billing
/
addons
/
attach
Attach addon
curl --request POST \
--url https://api.truthlocks.com/v1/billing/addons/attach \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"addon_key": "<string>",
"quantity": 123
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({addon_key: '<string>', quantity: 123})
};
fetch('https://api.truthlocks.com/v1/billing/addons/attach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/billing/addons/attach"
payload = {
"addon_key": "<string>",
"quantity": 123
}
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://api.truthlocks.com/v1/billing/addons/attach"
payload := strings.NewReader("{\n \"addon_key\": \"<string>\",\n \"quantity\": 123\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))
}{
"addon_id": "<string>",
"status": "<string>",
"effective_at": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Supply
addon_key and an explicit quantity between 1 and 10000. The handler does not default an omitted quantity to one.
For a priced add-on, the response includes checkout_url and status: pending_payment. A checkout URL is not evidence that payment completed. Free add-ons return HTTP 200 with no JSON body. Use current workspace entitlements to confirm activation.
Detach an add-on is a separate request. Catalog availability, pricing, and support commitments depend on your agreement and configured billing provider.
