Iniciar o salvamento de cartão (Stripe Elements)
Cria um SetupIntent do Stripe no cliente do workspace, para um formulário de cartão na sua própria página. Monte o Payment Element com o clientSecret, carregue o Stripe.js com o publishableKey, chame stripe.confirmSetup() e depois POST /v1/billing/card/setup-intent/{id}/sync. Sem corpo (qualquer campo → 400 UNKNOWN_FIELDS). Só Proprietário (billing:payment_method:manage) com chave de conta ou token OAuth. Os dados do cartão vão do navegador de quem paga direto para o Stripe (Payment Element) e nunca chegam à Pilot Status. O clientSecret permite a quem o tiver confirmar o intent: não guarde em cache nem em log. Enviado com Cache-Control: no-store.
Requer uma chave com escopo de tenant — uma chave de workspace, ou uma chave de conta com x-workspace-id.
curl --request POST \
--url https://pilotstatus.com.br/v1/billing/card/setup-intent \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/billing/card/setup-intent"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/billing/card/setup-intent', 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/card/setup-intent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/billing/card/setup-intent"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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/card/setup-intent")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/billing/card/setup-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"clientSecret": "seti_1QabcDEF_secret_xyz",
"setupIntentId": "seti_1QabcDEF",
"publishableKey": "pk_live_..."
}{
"error": "Unknown field(s): customerId. Accepted: (none). | Campo(s) desconhecido(s): customerId. Aceitos: (nenhum).",
"code": "UNKNOWN_FIELDS"
}{
"error": "Invalid API key"
}{
"error": "This endpoint requires a tenant-scoped API key",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "Card payments are not available right now. | Pagamentos com cartão não estão disponíveis no momento.",
"code": "PAYMENTS_NOT_CONFIGURED"
}clientSecret é para o Stripe.js na sua página. Veja Checkout transparente.Esta página foi útil?
curl --request POST \
--url https://pilotstatus.com.br/v1/billing/card/setup-intent \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/billing/card/setup-intent"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/billing/card/setup-intent', 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/card/setup-intent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/billing/card/setup-intent"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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/card/setup-intent")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/billing/card/setup-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"clientSecret": "seti_1QabcDEF_secret_xyz",
"setupIntentId": "seti_1QabcDEF",
"publishableKey": "pk_live_..."
}{
"error": "Unknown field(s): customerId. Accepted: (none). | Campo(s) desconhecido(s): customerId. Aceitos: (nenhum).",
"code": "UNKNOWN_FIELDS"
}{
"error": "Invalid API key"
}{
"error": "This endpoint requires a tenant-scoped API key",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "Card payments are not available right now. | Pagamentos com cartão não estão disponíveis no momento.",
"code": "PAYMENTS_NOT_CONFIGURED"
}