Skip to content

List a company's saved cards

GET
/clients/{id}/saved-cards
Code sample: Shell / cURL
curl --request GET \
--url https://example.com/api/v1/clients/example/saved-cards \
--header 'Authorization: Bearer <token>'

Lists the cards saved on the company’s Stripe customer (brand, last four digits, expiry) from Stripe, and says what a charge with no card named does: ready (it charges the card marked isDefault), choice_required (the customer has several cards and none is the default, so POST /invoices/{id}/charge needs a paymentMethodId from this list) or none (no card can be charged, with the reason). Reads Stripe on every call. Requires the invoices.manage permission and a company the caller reaches.

id
required

Resource identifier (CUID2).

string
>= 1 characters

Resource identifier (CUID2).

The company’s saved cards.

Media typeapplication/json
object
data
required

The saved cards of a client company and what a charge with no card named does.

object
cards
required
Array<object>

A card saved on a client’s Stripe customer.

object
brand
required

Stripe’s card brand, e.g. visa, mastercard, amex; unknown when it has none.

string
expMonth
required

Expiry month, 1 to 12.

integer
>= -9007199254740991 <= 9007199254740991
expYear
required
integer
>= -9007199254740991 <= 9007199254740991
expired
required

True once the card’s expiry month has passed.

boolean
id
required

The card’s Stripe payment method id; send it as paymentMethodId to charge this card.

string
isDefault
required

True for the card a charge uses when no card is named: the customer’s default, the card its Stripe subscription is charged with, or its only card.

boolean
last4
required
string
reason
required

Why no card qualifies; null otherwise.

string | null
status
required

ready: a charge picks a card itself (isDefault). choice_required: the customer has several cards and none is the default, so a charge needs paymentMethodId. none: no card can be charged; see reason.

string
Allowed values: ready choice_required none

Example

{
"data": {
"status": "ready"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.