App öffnen
Moonborn — API · billing

Detach a payment method (cannot detach the default while a paid subscription is active)

DELETE/v1/billing/payment_methods/{id}scope · Bearer (API key or session JWT)
Path parameters
FieldTypeDescription
idreqstringStripe payment method id (`pm_*`).

Responses

204Detached (no content)
401Unauthenticated
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
404Payment method not found
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
409Cannot detach default while paid subscription is active
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring

Examples

cURL
curl -X DELETE https://api.moonborn.co/v1/billing/payment_methods/<id> \
  -H "Authorization: Bearer $MOONBORN_API_KEY"
TypeScript
import Moonborn from '@moonborn/sdk';

const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });

const result = await client.billing.detachPaymentMethod({
  id: '<id>',
});
Python
import os
from moonborn import Moonborn

client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])

result = client.billing.detach_payment_method(
    id="<id>",
)