> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).

# Save and present payment methods at checkout for repeat purchases

Let customers save their payment details at checkout, then present customers with their saved payment details when they purchase in the future.

---

## What's new?

We've released saved payment methods. This lets customers save their payment method at checkout. Once saved, you can present customers with their saved payment methods when they make a purchase in the future.

As part of this update, there's a new [saved payment method entity](https://developer.paddle.com/api-reference/payment-methods/overview.md) against customers that holds information about a payment method, as well as changes to Paddle.js to let you present customers with their saved payment methods.

Customers can view and delete payment methods using [the customer portal](https://developer.paddle.com/changelog/2024/customer-portal.md).

## How it works

When customers sign up for a subscription using [Paddle Checkout](https://developer.paddle.com/concepts/sell/self-serve-checkout.md), Paddle saves [the payment method](https://developer.paddle.com/concepts/payment-methods/overview.md) for renewals, upgrades and downgrades, and other charges related to that subscription.

With this update, Paddle now creates a [saved payment method entity](https://developer.paddle.com/api-reference/payment-methods/overview.md) that you can work with using the API when a payment method is saved.

Customers purchasing one-time items can now choose to save their payment method at checkout, too. You can present saved payment methods to returning customers using Paddle.js.

### Customer journey

{% journey level=4 %}

{% journey-step title="Initial purchase" id="journey-details-initial-purchase" %}

When purchasing one-time items and subscriptions, customers may check a box to save their payment method when completing payment.

{% /journey-step %}

{% journey-step title="Repeat purchase" %}

When customers come back in the future, you can securely present them with their saved payment methods to make checkout quick and easy.

{% callout type="info" %}
You can only present saved payment methods when using one-page checkout.
{% /callout %}

{% /journey-step %}

{% journey-step title="Manage saved payment methods" id="journey-details-customer-portal" %}

Customers can view and delete their saved payment methods using [the customer portal](https://developer.paddle.com/concepts/customer-portal.md). Paddle automatically includes a unique link in transaction receipt emails.

{% /journey-step %}

{% /journey %}

### Saved payment method entity

Payment methods are now stored as a new [saved payment method entity against a customer](https://developer.paddle.com/api-reference/payment-methods/overview.md). Saved payment method entities hold information about a saved payment method, including how and when a payment method was saved, as well as details like the card type or other payment method information.

You can [list](https://developer.paddle.com/api-reference/payment-methods/list-payment-methods.md), [get](https://developer.paddle.com/api-reference/payment-methods/get-payment-method.md), and [delete](https://developer.paddle.com/api-reference/payment-methods/delete-payment-method.md) saved payment methods using the API. There are also new events to let you know when a payment method for a customer is [saved](https://developer.paddle.com/webhooks/payment-methods/payment-method-saved.md) or [deleted](https://developer.paddle.com/webhooks/payment-methods/payment-method-deleted.md).

Saved payment method entities have their own Paddle IDs, starting `paymtd_`. This is returned in `transaction.payments[]` as `payment_method_id`, so you can match a saved payment method with a [transaction](https://developer.paddle.com/api-reference/transactions/overview.md) payment attempt.

### Authentication for Paddle Checkout

To present customers with their saved payment methods when they make a repeat purchase, there's a new `customerAuthToken` parameter for the [`Paddle.Checkout.open()`](https://developer.paddle.com/paddlejs/methods/paddle-checkout-open.md) method in [Paddle.js](https://developer.paddle.com/paddlejs/overview.md).

You can generate an authentication token for a customer using [a new operation in the Paddle API](https://developer.paddle.com/api-reference/customers/generate-customer-authentication-token.md), which you can pass to Paddle.js to identify and authenticate a customer.

## Examples

This example opens [an inline checkout](https://developer.paddle.com/concepts/sell/branded-integrated-inline-checkout.md) for a one-time item. `customerAuthToken` is passed to [`Paddle.Checkout.open()`](https://developer.paddle.com/paddlejs/methods/paddle-checkout-open.md), so the customer is presented with any payment methods they previously saved.

<!-- Example showing passing an auth token and saved_payment_methods to Paddle.Checkout.open() -->
```javascript {% highlightLines="[9]" %}
var itemsList = [
  {
    priceId: 'pri_01gm81eqze2vmmvhpjg13bfeqg',
    quantity: 1
  }
];

Paddle.Checkout.open({
  items: itemsList,
  customerAuthToken: "pca_01hwz42rfyaxw721bgkppp66gx_01h282ye3v2d9cmcm8dzpawrd0_otkqbvati3ryh2f6o7zdr6owjsdhkgmm",
  settings: {
    displayMode: "inline",
    frameTarget: "checkout-container",
    frameInitialHeight: "450",
    frameStyle: "width: 100%; min-width: 312px; background-color: transparent; border: none;",
  }
});
```

## Next steps

This change is available in version `1` of the Paddle API.

Paddle automatically creates saved payment method entities for subscriptions. This includes subscriptions created before the release of saved payment methods.

To present and save payment methods for repeat purchases, go to **Paddle > Checkout > Checkout settings**, then check the **Allow buyers to opt in to save their payment methods for future purchases** box.

Once turned on for your account, update your integration to [make a call to the Paddle API to generate a customer authentication token](https://developer.paddle.com/api-reference/customers/generate-customer-authentication-token.md), then pass this to Paddle.js when opening a checkout to present saved payment methods.

See: [Present saved payment methods](https://developer.paddle.com/build/checkout/saved-payment-methods.md)
## Summary of changes

| Name | Type | Change | Entity | Description |
| --- | --- | --- | --- | --- |
| POST Generate an authentication token for a customer | API operation | added | Customers |  |
| GET List payment methods for a customer | API operation | added | Payment methods |  |
| GET Get a payment method for a customer | API operation | added | Payment methods |  |
| DELETE Delete a payment method for a customer | API operation | added | Payment methods |  |
| `customerAuthToken` | Paddle.js param | added | Paddle.Checkout.open() |  |
| `savedPaymentMethodId` | Paddle.js param | added | Paddle.Checkout.open() |  |
| `saved_payment_methods` | Enum value | added | allowedPaymentMethods | Allow customers to pay with a saved payment method at checkout. |
| `payment_method.saved` | Webhook | added | Payment methods |  |
| `payment_method.deleted` | Webhook | added | Payment methods |  |
