Transition to the Payment Intents and Payment Methods APIs (2024)

The Payment Methods API replaces the existing Tokens and Sources APIs as the recommended way for integrations to collect and store payment information. It works with the Payment Intents API to create payments for a wide range of payment methods.

We plan to turn off Sources API support for local payment methods. If you currently handle any local payment methods using the Sources API, you must migrate them to the Payment Methods API. We’ll send email communication with more information about this end of support.

While we don’t plan to turn off support for card payment methods, we still recommend that you migrate them to the Payment Methods and Payment Intents APIs. For more information about migrating card payment methods, see Migrating to the Payment Intents API.

Transitioning to the Payment Methods API Transition to the Payment Intents and Payment Methods APIs (1)

The main difference between the Payment Methods and Sources APIs is that Sources describes transaction state through the status property. That means that each Source object must transition to a chargeable state before it can be used for a payment. In contrast, a PaymentMethod is stateless, relying on the PaymentIntent object to represent payment state.

Note

The following table isn’t a comprehensive list of payment methods. If you integrate other payment methods with the Sources API, migrate them to the Payment Methods API as well.

FlowsPayment Methods with Payment Intents API Tokens or Sources with Charges API
CardsSupportedSupported on Tokens; Not recommended on Sources
Dynamic 3D SecureSupportedNot supported
Card presentSupportedNot supported
ACH Direct DebitSupportedSupported on Tokens Not supported on Sources
AffirmSupportedNot supported
Afterpay / ClearpaySupportedNot supported
AlipaySupportedDeprecated; support ends in 2024
Bacs Direct DebitSupportedNot supported
BancontactSupportedDeprecated; support ends in 2024
Bank Transfers (replacement for Credit Transfers)Supported in US, EU, GB, JP, and moreNot supported
BLIKSupportedNot supported
BoletoSupportedNot supported
Canada PADsSupportedNot supported
EPSSupportedNot supported
FPXSupportedNot supported
giropaySupportedDeprecated; support ends in 2024
GrabPaySupportedNot supported
iDEALSupportedDeprecated; support ends in 2024
KlarnaSupportedDeprecated; support ends early 2024
KonbiniSupportedNot supported
MultibancoPlannedDeprecated Beta; support ends in 2024
OXXOSupportedNot supported
PayNowSupportedNot supported
PixSupportedNot supported
PromptPaySupportedNot supported
Przelewy24SupportedDeprecated; support ends in 2024
SEPA Direct DebitSupportedDeprecated; support ends in 2024
SofortSupportedNot supported
WeChat PaySupportedDeprecated; support ends in 2024

After you choose the API to integrate with, our guide to payment methods can help you determine the right payment method types to support for your customers.

This guide includes detailed descriptions of each payment method and describes the differences in the customer-facing flows, along with the geographic regions where they are most relevant. You can enable any payment method available to you within the Dashboard. Activation is generally instantaneous and does not require additional contracts nor include a lengthy process.

Migrate local payment methods from the Sources API to the Payment Intents API Transition to the Payment Intents and Payment Methods APIs (2)

To migrate your integration for local payment methods, update your server and front end to use the PaymentIntents API. There are three typical integration options:

  • Redirect to Stripe Checkout for your payment flow.
  • Use the Stripe Payment Element on your own payment page.
  • Build your own form and use the Stripe JS SDK to complete the payment.

If you use Stripe Checkout or the Payment Element, you can add and manage most payment methods from the Stripe Dashboard without making code changes.

For specific information about integrating a local payment method using the Payment Methods API, see the instructions for that payment method in the payment methods documentation. The following table provides a high-level comparison of the different payment types.

Old integrationStripe CheckoutPayment ElementOwn form

Low complexity

Medium complexity

High complexity

Create a Source on the front end or on the serverCreate a Checkout Session on the serverCreate a PaymentIntent on the serverCreate a PaymentIntent on the server
Authorize payment by loading a widget or redirecting to a third partyNot neededPass the client secret to the front end and use the Stripe JS SDK to render a Payment Element to complete the paymentPass the client secret to the front end, use your own form to collect details from your customer, and complete the payment according to the payment method
Confirm the source is chargeable and charge the SourceNot neededNot neededNot needed
Confirm the Charge succeeded asynchronously with the charge.succeeded webhookConfirm the Checkout session succeeded with the payment_intent.succeeded webhookConfirm the PaymentIntent succeeded with the payment_intent.succeeded webhookConfirm the PaymentIntent succeeded with the payment_intent.succeeded webhook

Caution

A PaymentIntent object represents a payment in the new integration, and it creates a Charge when you confirm the payment on the front end. If you previously stored references to the Charge, you can continue to do so by fetching the Charge ID from the PaymentIntent after the customer completes the payment. However, we also recommend that you store the PaymentIntent ID.

Mapping fieldsTransition to the Payment Intents and Payment Methods APIs (3)

If you use the Payment Element or your own form, you must remap Source fields to PaymentIntent fields. The specific fields depend on the payment method.

Checking payment statusTransition to the Payment Intents and Payment Methods APIs (4)

Previously, your integration should have checked both the status of the Source and the status of the Charge after each API call. You no longer need to check two statuses—you only need to check the status of the PaymentIntent or the Checkout Session after you confirm it on the front end.

payment_intent.statusMeaningNote
succeededThe payment succeeded.
requires_payment_methodThe payment failed.
requires_actionThe customer hasn’t completed authorizing the payment.If the customer doesn’t complete the payment within 48 hours, then the PaymentIntent transitions to requires_payment_method and you can retry the confirmation.

Always confirm the status of the PaymentIntent by fetching it on your server or listening for the webhooks on your server. Don’t rely solely on the user returning to the return_url that’s provided when you confirm the PaymentIntent.

RefundsTransition to the Payment Intents and Payment Methods APIs (5)

You can continue to call the Refunds API with a Charge that the PaymentIntent creates. The ID of the Charge is accessible on the latest_charge parameter.

Alternatively, you can provide the PaymentIntent ID to the Refunds API instead of the Charge.

Error handlingTransition to the Payment Intents and Payment Methods APIs (6)

Previously, you had to handle errors on the Sources. With PaymentIntents, instead of checking for errors on a Source, you check for errors on the PaymentIntent when it’s created and after the customer has authorized the payment. Most errors on the PaymentIntent are of invalid_request_error type, returned in an invalid request.

When you migrate your integration, keep in mind that PaymentIntent error codes can differ from the corresponding error codes for Sources.

WebhooksTransition to the Payment Intents and Payment Methods APIs (7)

If you previously listened to Source events, you might need to update your integration to listen to new event types. The following table shows some examples.

Old webhookNew webhook on CheckoutNew webhook on PaymentIntentsNote
source.chargeableNot applicableNot applicable
source.failedNot applicableNot applicable
source.canceledNot applicableNot applicable
charge.succeededcheckout.session.completedpayment_intent.succeededThe charge.succeeded webhook is also sent, so you don’t have to update your integration to listen to the new webhook.
charge.failedNot applicable - The customer can re-attempt the payment on the same Checkout Session until it expires, at which point you receive a checkout.session.expired event.payment_intent.payment_failedThe charge.failed webhook is also sent, so you don’t have to update your integration to listen to the new webhook.
charge.dispute.createdcharge.dispute.createdcharge.dispute.created

Compatibility with legacy card objects Transition to the Payment Intents and Payment Methods APIs (8)

If you previously collected card customer payment details with Stripe using cards or Sources, you can start using the Payment Methods API immediately without migrating any payment information.

Compatible payment instruments that have been saved to a Customer are usable in any API that accepts a PaymentMethod object. For example, you can use a saved card as a PaymentMethod when creating a PaymentIntent:

Command Line

curl https://api.stripe.com/v1/payment_intents \ -u "

sk_test_4eC39HqLyjWDarjtT1zdp7dc

:" \ -d "payment_method_types[]"=card \ -d amount=1099 \ -d currency=usd \ -d customer=

{{CUSTOMER_ID}}

\ -d payment_method=

{{CARD_ID}}

Remember to provide the customer ID that your compatible payment instrument is saved to when attaching the object to a PaymentIntent.

You can retrieve all saved compatible payment instruments through the Payment Methods API.

{ "id": "card_1EBXBSDuWL9wT9brGOaALeD2", "object": "card", "address_city": "San Francisco", "address_country": "US", "address_line1": "1234 Fake Street", "address_line1_check": null, "address_line2": null, "address_state": null, "address_zip": null,

{ "id": "card_1EBXBSDuWL9wT9brGOaALeD2", "object": "payment_method", "billing_details": { "address": { "city": "San Francisco", "country": "US", "line1": "1234 Fake Street", "line2": null, "postal_code": null,

Note that with this compatibility, no new objects are created; the Payment Methods API provides a different view of the same underlying object. For example, updates to a compatible payment instrument through the Payment Methods API is visible through the Sources API and vice versa.

See alsoTransition to the Payment Intents and Payment Methods APIs (9)

  • Guide to payment methods
  • Connect platforms using the Payment Methods API
  • Payment Methods API reference
Transition to the Payment Intents and Payment Methods APIs (2024)
Top Articles
Latest Posts
Article information

Author: Stevie Stamm

Last Updated:

Views: 5432

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.