Créer une session de paiement
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>"
}Facturation
Créer une session de paiement
Lancer une session de paiement pour mettre à niveau ou modifier votre plan.
POST
/
v1
/
billing
/
checkout
Créer une session de paiement
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 sans paiement hébergé ; ils peuvent toujours entraîner des frais d’utilisation.
Le personnel doit approuver le pays de facturation avant que les plans payants ou les niveaux d’affaires basés sur l’utilisation ne soient activés. Un pays non approuvé renvoie HTTP 409 avec code: BILLING_COUNTRY_REVIEW_REQUIRED. Complétez d’abord l’examen du pays dans la page de facturation connectée.
Envoyez un fournisseur depuis le visible_providers du compte. Un paramètre d’URL ne peut pas modifier le pays de facturation. Les abonnements personnels payants existants doivent être gérés avant de commencer un autre paiement. Flutterwave refuse le paiement mensuel si son plan de paiement récurrent est manquant.
Un lien de paiement n’est pas une preuve de paiement. Actualisez l’abonnement après confirmation du fournisseur.
Réponse
L’URL de la page de paiement hébergée. Redirigez l’utilisateur vers cette URL pour finaliser le paiement.
Corps
application/json

