Recarga da carteira (cartão ou Pix) / adicionar cartão
Recarrega a carteira pré-paga ou salva um cartão — nada é cobrado até uma pessoa pagar. purpose:“wallet_topup” (exige amount > 0, na moeda da conta) com method “card” (padrão) devolve uma url hospedada do Stripe; com method “pix” (só BRL) devolve orderId e pix { transactionId, copyPaste, qrCode, expiresAt } — o Pix expira em 1 hora. Acompanhe o pedido com GET /v1/billing/topups/{orderId}. purpose:“add_card” devolve uma página hospedada para salvar um cartão no workspace, que passa a cobrir a carteira em toda cobrança. Ação de conta: requer key escopada a TENANT (403 NUMBER_SCOPE_NOT_ALLOWED para key de número); só Proprietário com chave de conta ou token OAuth.
Requer uma chave com escopo de tenant — uma chave de workspace, ou uma chave de conta com x-workspace-id.
Os erros são bilíngues (English | Português) desde 29/10/2026: INVALID_PURPOSE, INVALID_AMOUNT, NO_BILLING_EMAIL (400) e CHECKOUT_FAILED (500) eram só em inglês. Os códigos e os status não mudaram — decida pelo code.
curl --request POST \
--url https://pilotstatus.com.br/v1/billing/checkout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"purpose": "wallet_topup",
"amount": "50",
"successUrl": "https://app.acme.com/billing/ok",
"cancelUrl": "https://app.acme.com/billing",
"method": "pix"
}
'import requests
url = "https://pilotstatus.com.br/v1/billing/checkout"
payload = {
"purpose": "wallet_topup",
"amount": "50",
"successUrl": "https://app.acme.com/billing/ok",
"cancelUrl": "https://app.acme.com/billing",
"method": "pix"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purpose: 'wallet_topup',
amount: '50',
successUrl: 'https://app.acme.com/billing/ok',
cancelUrl: 'https://app.acme.com/billing',
method: 'pix'
})
};
fetch('https://pilotstatus.com.br/v1/billing/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pilotstatus.com.br/v1/billing/checkout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'purpose' => 'wallet_topup',
'amount' => '50',
'successUrl' => 'https://app.acme.com/billing/ok',
'cancelUrl' => 'https://app.acme.com/billing',
'method' => 'pix'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/billing/checkout"
payload := strings.NewReader("{\n \"purpose\": \"wallet_topup\",\n \"amount\": \"50\",\n \"successUrl\": \"https://app.acme.com/billing/ok\",\n \"cancelUrl\": \"https://app.acme.com/billing\",\n \"method\": \"pix\"\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))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/billing/checkout")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"purpose\": \"wallet_topup\",\n \"amount\": \"50\",\n \"successUrl\": \"https://app.acme.com/billing/ok\",\n \"cancelUrl\": \"https://app.acme.com/billing\",\n \"method\": \"pix\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/billing/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purpose\": \"wallet_topup\",\n \"amount\": \"50\",\n \"successUrl\": \"https://app.acme.com/billing/ok\",\n \"cancelUrl\": \"https://app.acme.com/billing\",\n \"method\": \"pix\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://checkout.stripe.com/c/pay/cs_live_...",
"purpose": "wallet_topup",
"method": "card",
"orderId": "cmh2b5m2p0002to8example6r",
"amount": 50,
"currency": "BRL"
}Autorizações
Sua chave de API ps_
Cabeçalhos
Só com chave de conta (ps_account_): o workspace em que agir, obtido em GET /v1/workspaces. Sem ele, uma chave de conta recebe 400 WORKSPACE_ID_REQUIRED.
Corpo
Finalidade da página de checkout.
"wallet_topup"
Valor a creditar na carteira, na moeda da conta (obrigatório para wallet_topup).
"50"
URL de redirecionamento após o sucesso.
"https://app.acme.com/billing/ok"
URL de redirecionamento se cancelar.
"https://app.acme.com/billing"
Só para wallet_topup. card (padrão) devolve uma página hospedada do Stripe; pix (só workspaces em BRL; senão 400 PIX_NOT_ELIGIBLE) devolve um código Pix copia e cola e um QR code (data:image/png;base64,…). successUrl/cancelUrl com pix, ou method com add_card → 400 FIELD_NOT_APPLICABLE.
card, pix "pix"
Resposta
Checkout criado
Esta página foi útil?
curl --request POST \
--url https://pilotstatus.com.br/v1/billing/checkout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"purpose": "wallet_topup",
"amount": "50",
"successUrl": "https://app.acme.com/billing/ok",
"cancelUrl": "https://app.acme.com/billing",
"method": "pix"
}
'import requests
url = "https://pilotstatus.com.br/v1/billing/checkout"
payload = {
"purpose": "wallet_topup",
"amount": "50",
"successUrl": "https://app.acme.com/billing/ok",
"cancelUrl": "https://app.acme.com/billing",
"method": "pix"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purpose: 'wallet_topup',
amount: '50',
successUrl: 'https://app.acme.com/billing/ok',
cancelUrl: 'https://app.acme.com/billing',
method: 'pix'
})
};
fetch('https://pilotstatus.com.br/v1/billing/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pilotstatus.com.br/v1/billing/checkout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'purpose' => 'wallet_topup',
'amount' => '50',
'successUrl' => 'https://app.acme.com/billing/ok',
'cancelUrl' => 'https://app.acme.com/billing',
'method' => 'pix'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/billing/checkout"
payload := strings.NewReader("{\n \"purpose\": \"wallet_topup\",\n \"amount\": \"50\",\n \"successUrl\": \"https://app.acme.com/billing/ok\",\n \"cancelUrl\": \"https://app.acme.com/billing\",\n \"method\": \"pix\"\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))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/billing/checkout")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"purpose\": \"wallet_topup\",\n \"amount\": \"50\",\n \"successUrl\": \"https://app.acme.com/billing/ok\",\n \"cancelUrl\": \"https://app.acme.com/billing\",\n \"method\": \"pix\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/billing/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purpose\": \"wallet_topup\",\n \"amount\": \"50\",\n \"successUrl\": \"https://app.acme.com/billing/ok\",\n \"cancelUrl\": \"https://app.acme.com/billing\",\n \"method\": \"pix\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://checkout.stripe.com/c/pay/cs_live_...",
"purpose": "wallet_topup",
"method": "card",
"orderId": "cmh2b5m2p0002to8example6r",
"amount": 50,
"currency": "BRL"
}