Skip to content
TriedDocs
Account

Delete payment method

Remove a saved card from the workspace.

DELETEhttps://api.tried.com.au/billing/payment-methods/{id}

Needs keys Removes a card. With Stripe (STRIPE_SECRET_KEY), it detaches the payment method from the Stripe customer and, if it was the stored default, clears it. Without Stripe, the stored mock card is cleared whatever the ID. Admin only.

Request#

Field Type Required Description
id string Yes Payment method ID from List payment methods.

Example request#

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

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

Response#

200 OK

{
  "provider": "stripe",
  "payment_methods": []
}

Returns the remaining cards, as in List payment methods. Without a saved card, auto-recharge and Add credits fail with Stripe.

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. A dashboard user without the right role gets Requires role: admin. API keys act as admin.
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.