curl --request POST \
--url https://api.interchange.io/api/v2/billing/payment-methods/setup \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.interchange.io/api/v2/billing/payment-methods/setup"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.interchange.io/api/v2/billing/payment-methods/setup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"attemptId": "<string>",
"clientSecret": "<string>",
"publishableKey": "<string>"
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Start adding a card (admin)
Create a card-capture session for the organization and return the client secret the embedded card form needs, plus the publishable key to mount it. The saved method appears (via webhook-verified confirmation) in the payment-methods list and on the billing-account document; it is never inferred from the client-side confirmation alone. Org-admin humans only — service tokens are denied. 403 FEATURE_NOT_ENABLED until the buyer-card-collection flag is on for the organization.
curl --request POST \
--url https://api.interchange.io/api/v2/billing/payment-methods/setup \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.interchange.io/api/v2/billing/payment-methods/setup"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.interchange.io/api/v2/billing/payment-methods/setup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"attemptId": "<string>",
"clientSecret": "<string>",
"publishableKey": "<string>"
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Authorizations
API key or access token
Response
Start adding a card (admin)
Everything the client needs to mount an embedded card-capture form. The resulting payment method is NOT returned here — it appears once the card rail webhook confirms it (spec §6: never inferred from a client callback).
Vendor-neutral setup-attempt id used to report that embedded confirmation was submitted.
The capture-session client secret. The UI passes this to the embedded card form (no redirect) to collect and confirm the card.
The card rail's publishable key, for mounting the embedded card form client-side. Not secret.