Skip to content
TriedDocs
Account

List payment methods

List the cards saved for the workspace.

GEThttps://api.tried.com.au/billing/payment-methods

Needs keys Lists saved cards. With Stripe (STRIPE_SECRET_KEY), these are the card payment methods on the workspace's Stripe customer, and is_default marks the customer's default. Without Stripe, the mock stores at most one card per workspace. Any role can call it.

Request#

This endpoint takes no path, query or body parameters.

Example request#

curl https://api.tried.com.au/billing/payment-methods \
  -H "Authorization: Bearer $TRIED_API_KEY"
const res = await fetch("https://api.tried.com.au/billing/payment-methods", {
  headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const methods = await res.json();
import os, requests

res = requests.get(
    "https://api.tried.com.au/billing/payment-methods",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
methods = res.json()

Response#

200 OK

{
  "provider": "stripe",
  "payment_methods": [
    {
      "id": "pm_1QxYz2AbCdEfGhIj",
      "brand": "mastercard",
      "last4": "4444",
      "exp": "08/29",
      "is_default": true
    }
  ]
}

With Stripe and no Stripe customer yet, payment_methods is empty. In mock mode the stored card is listed, or the list is empty when none is saved.

Field Type Description
provider string stripe or mock.
payment_methods object[] Saved cards: id, brand, last4, exp (MM/YY) and is_default.

Errors#

Status When
401 Missing or invalid API key.
403 The key's IP allowlist or scopes reject the request. This route needs the admin scope.
429 Rate limit exceeded. See Rate limits.
500 Stripe rejected the request. Outside production the message is Stripe's error text.

See Errors for the body format.