Attacher un module complémentaire
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
}Facturation
Attacher un module complémentaire
Attache un module complémentaire de facturation à l’abonnement du locataire.
POST
/
v1
/
billing
/
addons
/
attach
Attacher un module complémentaire
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
}Fournissez
addon_key et une quantity explicite entre 1 et 10000. Le gestionnaire ne définit pas par défaut une quantité omise à un.
Pour un module complémentaire payant, la réponse inclut checkout_url et status: pending_payment. Une URL de paiement ne constitue pas une preuve que le paiement est terminé. Les modules complémentaires gratuits renvoient HTTP 200 sans corps JSON. Utilisez les droits d’accès de l’espace de travail actuel pour confirmer l’activation.
Détacher un module complémentaire est une requête distincte. La disponibilité du catalogue, les prix et les engagements de support dépendent de votre accord et du fournisseur de facturation configuré.
