Managing payment methods
Get payment method
Returns details about the payment method associated with the specified
subscriptionUuid
tip
This is a good way to get the last four digits of the user's card.
- Node SDK
- Fetch
- cURL
import { Salable } from '@salable/node-sdk';
const salable = new Salable('your-salable-api-key', 'v2');
const currentPaymentMethod = await salable.subscription.getPaymentMethod('your-subscription-uuid');
const response = await fetch(
'https://api.salable.app/subscriptions/your-subscription-uuid/payment-method',
{
headers: {
version: 'v2',
'x-api-key': 'your-salable-api-key',
},
}
);
curl
-XGET
-H 'x-api-key: your-salable-api-key'
-H 'version: v2'
'https://api.salable.app/subscriptions/your-subscription-uuid/payment-method'
Get an "update payment method" link
This will return a link to a Stripe portal where the customer can update their payment method.
tip
Useful if a customer's card is about to expire.
- Node SDK
- Fetch
- cURL
import { Salable } from '@salable/node-sdk';
const salable = new Salable('your-salable-api-key', 'v2');
const updatePaymentLink = await salable.subscription.getUpdatePaymentLink('your-subscription-uuid');
const response = await fetch(
'https://api.salable.app/subscriptions/your-subscription-uuid/updatepaymentlink',
{
headers: {
version: 'v2',
'x-api-key': 'your-salable-api-key',
},
}
);
curl
-XGET
-H 'x-api-key: your-salable-api-key'
-H 'version: v2'
'https://api.salable.app/subscriptions/your-subscription-uuid/updatepaymentlink'