Billing
Sync a card save
Call after stripe.confirmSetup() resolves. Reads the SetupIntent from Stripe (never trusts the client) and, when it succeeded, makes the card the workspace’s saved card right away, replacing the previous one. Not succeeded yet → saved: false. Idempotent. Never reads a body. Owner only.
Requires a tenant-scoped key — a workspace key, or an account key with x-workspace-id.
POST
/
v1
/
billing
/
card
/
setup-intent
/
{id}
/
sync
Sync a card save
curl --request POST \
--url https://pilotstatus.com.br/v1/billing/card/setup-intent/{id}/sync \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/billing/card/setup-intent/{id}/sync"
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/{id}/sync', 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/{id}/sync",
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/{id}/sync"
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/{id}/sync")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/billing/card/setup-intent/{id}/sync")
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{
"setupIntentId": "seti_1QabcDEF",
"status": "succeeded",
"saved": true,
"card": {
"brand": "visa",
"last4": "4242",
"expMonth": 12,
"expYear": 2030
}
}{
"error": "The id must be a Stripe SetupIntent id (seti_…). | O id deve ser o id de um SetupIntent do Stripe (seti_…).",
"code": "INVALID_SETUP_INTENT_ID"
}{
"error": "Invalid API key"
}{
"error": "This endpoint requires a tenant-scoped API key",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "Setup intent not found for this workspace. | Setup intent não encontrado neste workspace.",
"code": "SETUP_INTENT_NOT_FOUND"
}Authorizations
apiKeyapiKeyId
Your ps_ API key
Headers
Only with an account key (ps_account_): the workspace to act on, from GET /v1/workspaces. Without it an account key gets 400 WORKSPACE_ID_REQUIRED.
Path Parameters
The setupIntentId (seti_…).
Response
Result
Was this page helpful?
⌘I
Sync a card save
curl --request POST \
--url https://pilotstatus.com.br/v1/billing/card/setup-intent/{id}/sync \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/billing/card/setup-intent/{id}/sync"
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/{id}/sync', 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/{id}/sync",
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/{id}/sync"
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/{id}/sync")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/billing/card/setup-intent/{id}/sync")
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{
"setupIntentId": "seti_1QabcDEF",
"status": "succeeded",
"saved": true,
"card": {
"brand": "visa",
"last4": "4242",
"expMonth": 12,
"expYear": 2030
}
}{
"error": "The id must be a Stripe SetupIntent id (seti_…). | O id deve ser o id de um SetupIntent do Stripe (seti_…).",
"code": "INVALID_SETUP_INTENT_ID"
}{
"error": "Invalid API key"
}{
"error": "This endpoint requires a tenant-scoped API key",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "Setup intent not found for this workspace. | Setup intent não encontrado neste workspace.",
"code": "SETUP_INTENT_NOT_FOUND"
}