List the cards on file.
GET
/billing/payment-methods
const url = 'https://api.siteqwality.com/billing/payment-methods';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.siteqwality.com/billing/payment-methods \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Cards on file
Media type application/json
object
payment_methods
required
Array<object>
object
id
required
string
type
required
Stripe’s payment method type: card, link, us_bank_account, …
string
label
required
How to name it, for example “Visa ending 4242” or “Link (pat@example.com)”.
string
brand
required
Card brand; empty for other types.
string
last4
required
string
exp_month
Cards only.
integer | null format: int64
exp_year
integer | null format: int64
is_default
required
The method Stripe charges: the subscription’s default, else the customer’s.
boolean
is_expired
required
True once the card’s expiry month has passed. Surfaced so the list can flag it before a renewal fails rather than after.
boolean
Example generated
{ "payment_methods": [ { "id": "example", "type": "example", "label": "example", "brand": "example", "last4": "example", "exp_month": 1, "exp_year": 1, "is_default": true, "is_expired": true } ]}Missing or invalid authentication
Caller has no billing role
Account has no Stripe customer
Internal server error