Crear sesión de pago
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>"
}Facturación
Crear sesión de pago
Inicie una sesión de pago para actualizar o cambiar su plan.
POST
/
v1
/
billing
/
checkout
Crear sesión de pago
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 sin un pago alojado; aún pueden incurrir en cargos por uso.
El personal debe aprobar el país de facturación antes de que se habiliten los planes de pago o los niveles de negocio basados en el uso. Un país no aprobado devuelve HTTP 409 con code: BILLING_COUNTRY_REVIEW_REQUIRED. Complete primero la revisión del país en la página de facturación con sesión iniciada.
Envíe un proveedor desde la visible_providers de la cuenta. Un parámetro de URL no puede cambiar el país de facturación. Las suscripciones personales pagas existentes deben gestionarse antes de iniciar otra compra. Flutterwave rechaza el pago mensual si falta su plan de pago recurrente.
Un enlace de pago no es prueba de pago. Actualice la suscripción después de la confirmación del proveedor.
Respuesta
Cuerpo
application/json

