Billing
Start a card save (Stripe Elements)
Creates a Stripe SetupIntent on the workspace’s customer, for a card form on your own page. Mount the Payment Element with clientSecret, load Stripe.js with publishableKey, call stripe.confirmSetup(), then POST /v1/billing/card/setup-intent/{id}/sync. No body (any field → 400 UNKNOWN_FIELDS). Owner only (billing:payment_method:manage) with an account key or OAuth token. Card data goes from the payer’s browser straight to Stripe (Payment Element) and never reaches Pilot Status. The clientSecret lets whoever holds it confirm the intent: do not cache or log it. Sent with Cache-Control: no-store.
Requires a tenant-scoped key — a workspace key, or an account key with x-workspace-id.
POST
/
v1
/
billing
/
card
/
setup-intent
Start a card save (Stripe Elements)
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"
}The
clientSecret is meant for Stripe.js on your page. See Transparent checkout.Was this page helpful?
⌘I
Start a card save (Stripe Elements)
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"
}