Criar sessão de 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>"
}Faturamento
Criar sessão de checkout
Iniciar uma sessão de pagamento para atualizar ou alterar seu plano.
POST
/
v1
/
billing
/
checkout
Criar sessão de 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 sem um checkout hospedado; eles ainda podem incorrer em cobranças de uso.
A equipe deve aprovar o país de faturamento antes que os planos pagos ou as camadas de negócios baseadas em uso sejam ativados. Um país não aprovado retorna HTTP 409 com code: BILLING_COUNTRY_REVIEW_REQUIRED. Conclua a revisão do país na página de faturamento logada primeiro.
Envie um provedor dos visible_providers da conta. Um parâmetro de URL não pode alterar o país de cobrança. Assinaturas pessoais pagas existentes devem ser gerenciadas antes de iniciar outro checkout. O Flutterwave recusa o checkout mensal se o plano de pagamento recorrente estiver ausente.
Um link de checkout não é prova de pagamento. Atualize a assinatura após a confirmação do provedor.
Resposta
A URL da página de checkout hospedada. Redirecione o usuário para esta URL para concluir o pagamento.
Corpo
application/json

