إنشاء جلسة دفع
curl --request POST \
--url https://api.truthlocks.com/v1/billing/checkout \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"plan_key": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({plan_key: '<string>'})
};
fetch('https://api.truthlocks.com/v1/billing/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/billing/checkout"
payload = { "plan_key": "<string>" }
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/checkout"
payload := strings.NewReader("{\n \"plan_key\": \"<string>\"\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))
}{
"checkout_url": "<string>",
"activated": true,
"plan_key": "<string>",
"message": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "BILLING_COUNTRY_REVIEW_REQUIRED",
"error": "<string>"
}الفوترة
إنشاء جلسة دفع
بدء جلسة دفع لترقية أو تغيير خطتك.
POST
/
v1
/
billing
/
checkout
إنشاء جلسة دفع
curl --request POST \
--url https://api.truthlocks.com/v1/billing/checkout \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"plan_key": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({plan_key: '<string>'})
};
fetch('https://api.truthlocks.com/v1/billing/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/billing/checkout"
payload = { "plan_key": "<string>" }
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/checkout"
payload := strings.NewReader("{\n \"plan_key\": \"<string>\"\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))
}{
"checkout_url": "<string>",
"activated": true,
"plan_key": "<string>",
"message": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "BILLING_COUNTRY_REVIEW_REQUIRED",
"error": "<string>"
}POST /v1/billing/checkout
activated: true بدون دفع مستضاف؛ لا يزال من الممكن أن تتكبد رسوم استخدام.
يجب على الموظفين الموافقة على بلد الفوترة قبل تفعيل الخطط المدفوعة أو المستويات التجارية القائمة على الاستخدام. يعيد البلد غير الموافق عليه HTTP 409 مع code: BILLING_COUNTRY_REVIEW_REQUIRED. أكمل مراجعة البلد في صفحة الفوترة بعد تسجيل الدخول أولاً.
أرسل مزودًا من visible_providers الخاص بالحساب. لا يمكن لمعامل URL تغيير بلد الفوترة. يجب إدارة الاشتراكات الشخصية المدفوعة الحالية قبل بدء عملية دفع أخرى. ترفض Flutterwave الدفع الشهري إذا كان خطة الدفع المتكررة مفقودة.
رابط الدفع ليس إثباتًا للدفع. قم بتحديث الاشتراك بعد تأكيد المزود.
الاستجابة
الجسم
application/json

