Iniciar el guardado de una tarjeta (Stripe Elements)
Crea un SetupIntent de Stripe en el cliente del workspace, para un formulario de tarjeta en tu propia página. Monta el Payment Element con clientSecret, carga Stripe.js con publishableKey, llama a stripe.confirmSetup() y luego a POST /v1/billing/card/setup-intent/{id}/sync. Sin cuerpo (cualquier campo → 400 UNKNOWN_FIELDS). Solo Owner (billing:payment_method:manage) con una clave de cuenta o token OAuth. Los datos de la tarjeta van del navegador del pagador directamente a Stripe (Payment Element) y nunca llegan a Pilot Status. El clientSecret permite a quien lo tenga confirmar el intent: no lo almacenes en caché ni lo registres en logs. Se envía con Cache-Control: no-store.
Requiere una clave con alcance de tenant: una clave de workspace, o una clave de cuenta con 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_..."
}clientSecret es para Stripe.js en su página. Consulte Checkout transparente.¿Esta página le ayudó?
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_..."
}