import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const customerResponse = await client.v1.customers.paymentMethod.detach('x');
console.log(customerResponse.data);{
"data": {
"createdAt": "2026-07-01T01:52:05.894Z",
"updatedAt": "2025-12-21T02:59:24.164Z",
"archivedAt": null,
"name": "John Doe",
"email": "john@example.com",
"billingId": "cus_MIhJJFnJL24HFH",
"id": "customer-6e24b4",
"metadata": {},
"integrations": [],
"defaultPaymentMethod": {
"type": "CARD",
"billingId": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"cardLast4Digits": "1234",
"cardExpiryMonth": 12,
"cardExpiryYear": 2025
},
"couponId": "coupon-6e24b4"
}
}Removes the payment method from a customer. Ensure active paid subscriptions have an alternative payment method.
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const customerResponse = await client.v1.customers.paymentMethod.detach('x');
console.log(customerResponse.data);{
"data": {
"createdAt": "2026-07-01T01:52:05.894Z",
"updatedAt": "2025-12-21T02:59:24.164Z",
"archivedAt": null,
"name": "John Doe",
"email": "john@example.com",
"billingId": "cus_MIhJJFnJL24HFH",
"id": "customer-6e24b4",
"metadata": {},
"integrations": [],
"defaultPaymentMethod": {
"type": "CARD",
"billingId": "pm_1Q0PsIJvEtkwdCNYMSaVuRz6",
"cardLast4Digits": "1234",
"cardExpiryMonth": 12,
"cardExpiryYear": 2025
},
"couponId": "coupon-6e24b4"
}
}Server API Key
The unique identifier of the entity
1 - 255The customer object without payment method.
Response object
A customer can be either an organization or an individual
Show child attributes