Skip to main content
DELETE
/
workspaces
/
{workspaceId}
/
billing-accounts
/
{billingAccountId}
/
payment-methods
/
{paymentMethodId}
Detach a payment method
curl --request DELETE \
  --url https://api.altostrat.io/workspaces/{workspaceId}/billing-accounts/{billingAccountId}/payment-methods/{paymentMethodId} \
  --header 'Authorization: Bearer <token>'
{
  "type": "unprocessable_entity",
  "code": "cannot_detach_default_with_subscriptions",
  "message": "Cannot delete the default payment method while active subscriptions exist. Please set another payment method as default first.",
  "doc_url": "https://docs.altostrat.io/errors/cannot_detach_default_with_subscriptions"
}

Authorizations

Authorization
string
header
required

Enter your JWT in the format: Bearer {token}

Path Parameters

workspaceId
string
required

The ID of the workspace.

Example:

"ws_a1b2c3d4e5f6g7h8"

billingAccountId
string
required

The ID of the billing account, which corresponds to a Stripe Customer ID (cus_...).

Example:

"cus_a1b2c3d4e5f6g7h8"

paymentMethodId
string
required

The ID of the Stripe Payment Method (pm_...).

Example:

"pm_a1b2c3d4e5f6g7h8"

Response

The payment method was detached successfully.