Compare the Checkout Sessions and Payment Intents APIs
Learn about the differences between the Checkout Sessions and Payment Intents APIs and when to use them with Stripe Elements.
Stripe offers two core payment APIs that you can use with Elements to enable different levels of customization and control over your payment flows. The Checkout Sessions API supports common checkout workflows with built-in features that eliminate the need for custom code and is recommended for most developers. The Payment Intents API allows you to use custom code for more granular control over the checkout process, but requires more integration code and maintenance.
Notiz
This guide is specific to using APIs with Elements. To explore other use cases, see Design a payments integration.
Choose the right API
It’s important to understand which API is right for your business so that you can access the features you want and decide how much code you want to manage long-term. Checkout Sessions will continue to support new built-in features that won’t be available with PaymentIntents. If you use PaymentIntents, you can manually build a similar feature in your code. Some features, such as Adaptive Pricing, require a large effort to build manually with PaymentIntents.
Checkout Sessions | Payment Intents | |
---|---|---|
Recommended for | Businesses who want less integration code, less code maintenance over time, and access to built-in features that manage the checkout state for you, such as—discounts, line items, sales tax, and Adaptive Pricing. | Businesses who have their own tax engine, subscription engine, and promotion code engine, and need the flexibility to build and manage their own checkout session without built-in features. |
Integration | Use code to add a checkout page and integrate additional products. For example, enable Stripe Tax by setting automatic_ , compared to the Payment Intents API which requires you to manually call the Tax API and link calculations. | The Payment Intents API gives you complete control to build any checkout or payment experience. You calculate the final amount with taxes, discounts, subscriptions, and currency conversion yourself. |
User interface |
| Elements |
Complexity | Built to scale with your business from simple to complex use cases. | Best for large businesses with advanced and complex use cases that require bespoke solutions. |
Feature comparison
Feature | Checkout Sessions API | Payment Intents API |
---|---|---|
Design | Use for complete checkout flows with line items, taxes, and shipping. | Use for complex use cases that require granular payment control with custom business logic. |
Tax calculation | Built-in tax calculation with Stripe Tax. | Requires a separate integration with the Tax API. |
Subscriptions | Built-in subscription creation. | Requires a separate integration with Subscriptions. |
Coupons and discounts | Built-in coupon and discount handling. | Requires calculating discounts manually. |
Shipping costs | Built-in shipping cost calculation. | Requires calculating shipping costs manually. |
UI flexibility | Hosted checkout page, embedded forms, and custom UI. | Custom UI only. |
Address collection | Built-in customer, billing, and shipping address collection. | Requires handling addresses manually. |
Order tracking | Built-in order summary and receipt functionality. | Requires implementing custom order tracking. |
Amount updates | Dynamic inventory and line item updates. | Requires manually updating the amount. |
Session expiration | Automatic expiration after 24 hours. | No automatic expiration. |
Webhook events | Webhook events for the complete checkout lifecycle. | Payment status events only. |