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

# Update a payment method using the API and Paddle.js

Use the new get a transaction to update payment method operation in the Paddle API to build a workflow for updating customer payment details for a subscription.

---

## What's new?

We added the [get a transaction to update payment method operation](https://developer.paddle.com/api-reference/subscriptions/update-payment-method.md) to the Paddle API. You can use it to build a workflow to let customers update their payment details for a subscription.

{% api-endpoint method="GET" path="/subscriptions/{subscription_id}/update-payment-method-transaction"  %}

- **subscription_id** (string): Unique Paddle ID for this subscription entity, prefixed with `sub_`
{% /api-endpoint %}

## How it works

[Paddle Checkout](https://developer.paddle.com/concepts/sell/self-serve-checkout.md) handles securely capturing card details or [other payment method](https://developer.paddle.com/concepts/payment-methods/overview.md). You should use Paddle Checkout to capture updated payment details for a subscription.

To open Paddle Checkout for an existing subscription to update payment details, you need a transaction for that subscription. The new [get a transaction to update payment method operation](https://developer.paddle.com/api-reference/subscriptions/update-payment-method.md) returns a transaction that you can pass to Paddle.js to open a checkout for it.

You can use the new operation to build a workflow to let customers update their payment details.

{% callout type="note" %}
For a more complete guide on how this operation works and how to build an update payment workflow, see: [Update payment details](https://developer.paddle.com/build/subscriptions/update-payment-details.md)
{% /callout %}

## Next steps

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

It's a non-breaking change, meaning it doesn't impact existing integrations.
## Summary of changes

| Name | Type | Change | Entity | Description |
| --- | --- | --- | --- | --- |
| GET Get a transaction to update payment method | API operation | added | Subscriptions |  |
