إرفاق إضافة
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
}الفوترة
إرفاق إضافة
يرفق إضافة فوترة باشتراك المستأجر.
POST
/
v1
/
billing
/
addons
/
attach
إرفاق إضافة
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
}قدم
addon_key و quantity صريحًا بين 1 و 10000. لا يقوم المعالج بتعيين الكمية المحذوفة إلى واحد افتراضيًا.
لإضافة مدفوعة، يتضمن الرد checkout_url و status: pending_payment. لا يُعد عنوان URL للدفع دليلاً على اكتمال الدفع. تُرجع الإضافات المجانية HTTP 200 بدون نص JSON. استخدم استحقاقات مساحة العمل الحالية لتأكيد التفعيل.
فصل إضافة هو طلب منفصل. يعتمد توفر الكتالوج والتسعير والتزامات الدعم على اتفاقيتك ومزود الفواتير المكون.
