Skip to main content

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.

import { Salable } from '@salable/node-sdk';

const salable = new Salable('your-salable-api-key', 'v2');
const currentPaymentMethod = await salable.subscription.getPaymentMethod('your-subscription-uuid');

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.

import { Salable } from '@salable/node-sdk';

const salable = new Salable('your-salable-api-key', 'v2');
const updatePaymentLink = await salable.subscription.getUpdatePaymentLink('your-subscription-uuid');