API reference · Billing
Saved cards
/v1/orgs/{org_id}/billing/payment-methods- TypeScript
client.billing.listPaymentMethods()- Python
client.billing.list_payment_methods()- CLI
hayonix billing payment-methods
Returns the organization’s active saved cards; removed cards are not listed.
Project API key (Authorization: Bearer sk_…), or a console session. Requires the billing:read permission (a key's scope, or a role that includes it).
Examples
The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.
# The org of your key: GET /v1/caller
ORG_ID=$(curl -sS "$API_BASE_URL/caller" -H "Authorization: Bearer $API_KEY" | jq -r .org_id)
curl -sS "$API_BASE_URL/orgs/$ORG_ID/billing/payment-methods" \
-H "Authorization: Bearer $API_KEY"Request
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
Path parameters
org_idstringYour organization. The SDKs and the CLI fill it in from the API key.
ID with prefix org_
Query parameters
limitinteger1–200, default 50
1–200
cursorstring`next_cursor` of the previous page
up to 200 characters
Response
200 a page of results — A page of saved cards
The items of this page.
ShowHide 10 fields of
dataobjectstringrequiredAlways `payment_method`: the type of this object
One of
payment_methodidstringrequiredUnique ID (`pmth_…`)
ID with prefix pmth_
org_idstringrequiredOrganization it belongs to
ID with prefix org_
driverstringrequired`stripe` for a card saved with the payment processor, `development` for a test card that takes no money
One of
stripedevelopmentbrandstring | nullrequiredCard brand, for example `visa`; null when unknown
last4string | nullrequiredLast four digits of the card; null when unknown
exp_monthinteger | nullrequiredExpiry month (1–12); null when unknown
exp_yearinteger | nullrequiredExpiry year (four digits); null when unknown
statusstringrequired`active` (can be charged) or `detached` (removed; never charged again)
One of
activedetachedcreated_atstring (date-time)requiredWhen it was created (ISO 8601, UTC)
next_cursorstring | nullrequiredPass as `cursor` for the next page; null on the last page.
Example response
{
"data": [
{
"object": "payment_method",
"id": "pmth_01jc5zq4m8k3v6x9t2w7r0b1e4",
"org_id": "org_01jc5zq4m8k3v6x9t2w7r0b1e4",
"driver": "stripe",
"brand": "string",
"last4": "string",
"exp_month": 1,
"exp_year": 1,
"status": "active",
"created_at": "2026-01-01T00:00:00.000Z"
}
],
"next_cursor": "string"
}Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
400 | invalid_request_error | A parameter or body field is missing or not allowed; param names it. |
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |