Adjuntar complemento
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
}Facturación
Adjuntar un complemento
Adjunta un complemento de facturación a la suscripción del inquilino.
POST
/
v1
/
billing
/
addons
/
attach
Adjuntar complemento
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
}Suministre
addon_key y una quantity explícita entre 1 y 10000. El controlador no establece por defecto una cantidad omitida a uno.
Para un complemento de pago, la respuesta incluye checkout_url y status: pending_payment. Una URL de pago no es prueba de que el pago se haya completado. Los complementos gratuitos devuelven HTTP 200 sin cuerpo JSON. Utilice los derechos actuales del espacio de trabajo para confirmar la activación.
Desvincular un complemento es una solicitud separada. La disponibilidad del catálogo, los precios y los compromisos de soporte dependen de su acuerdo y del proveedor de facturación configurado.
