Methods to manage and update credit cards stored on a customer's account.

Use to get a list of credit cards on file for the account. These are stored automatically when a non-guest user checks out and chooses to save their information for later.

Returns all addresses, with offset pagination using limit and page.

List saved credit cards
await swell.account.listCards()

Use to save a tokenized credit card to the account for future use. Credit card tokens can be created using swell.card.createToken or Stripe.js.

Create a new credit card
await swell.account.createCard({
  token: '...'
})

Used to update information on an existing card on file by ID.

Update an existing card
await swell.account.updateCard('5c15505200c7d14d851e510f'){
  exp_month: 11,
  exp_year: 2050
})

Use to remove a saved credit card from the account by ID.

Delete a credit card
await swell.account.deleteCard('5c15505200c7d14d851e510f')