Skip to content

List saved cards

GET /api/v2/billing/cards

Lists the payment cards saved on the account, default card first. The default card has isPrimary: true. Automatic charges use it. Paying an invoice with a saved card also uses it when you choose no other card. Use a card’s id to delete it or make it the default. It is also the savedCardId for paying an invoice.

Authentication: An API key with the scope read:billing. About keys and scopes

Example

GET /api/v2/billing/cards
curl "https://cloud.hostup.se/api/v2/billing/cards" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 Saved cards, default card first. Empty when no card is saved.

Response 200
[
{
"id": "card_01hxa3b4c5d6e7f8g9h0j1k2m3",
"brand": "visa",
"last4": "4242",
"expMonth": 12,
"expYear": 2028,
"cardholderName": "Alex Example",
"isPrimary": true,
"addedAt": "2026-04-27T12:00:00.000Z"
},
{
"id": "card_01hxa3b4c5d6e7f8g9h0j1k2m4",
"brand": "mastercard",
"last4": "4444",
"expMonth": 3,
"expYear": 2027,
"cardholderName": "Alex Example",
"isPrimary": false,
"addedAt": "2025-11-02T09:30:00.000Z"
}
]

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502The saved cards could not be loaded. Try again shortly.