Stripe | Financial Infrastructure to Grow Your Revenue

Stripe | Financial Infrastructure to Grow Your Revenue

4466 articles

Enable merchants on your platform to accept payments directly


Enable merchants on your platform to accept payments directly

Facilitate direct payments to businesses on your SaaS platform from their own customers.

Allow your merchant-configured connected account to accept direct charge payments using a Stripe-hosted Checkout page that reflects their branding.

Create a Checkout Session Client-side Server-side

Add a checkout button to your website that calls a server-side endpoint to create a Checkout Session.

checkout.html

<html>
 <head>
 <title>Checkout</title>
 </head>
 <body>
 <form action="/create-checkout-session" method="POST">
 <button type="submit">Checkout</button>
 </form>
 </body>
</html>

On your server, create a Checkout Session that renders the payment form to your customer, including purchase details such as line items, the order amount, and currency. Redirect your customer to the URL returned in the response.

Command Line

Select a language

cURL

Stripe CLI

Ruby

Python

PHP

Java

Node.js

Go

.NET

No results

ParameterDescription
line_itemsRenders up to 100 purchase items in the Stripe-hosted checkout page.
payment_intent_data[application_fee_amount]Specifies the amount your platform deducts from the transaction as an application fee. This amount transfers to your platform balance after the payment completes. See collect fees for more information.
success_urlWhere Stripe redirects the customer following payment completion. Stripe updates the URL with the {the related setting} generated from this request. You can customize redirect behavior with a Stripe-hosted page to: Retrieve the Checkout Session and inspect its status to decide what to show your customer. Append your own query parameters, which persist through the redirect process.
Stripe-AccountA header that identifies your connected account as the transaction merchant of record. Checkout uses the connected account’s branding instead of your platform’s.

Charges that you create directly on the connected account are reported only on that account. These charges aren’t shown in your platform’s Dashboard or exports. Direct charges are included in reports and Sigma for connected accounts that your platform controls. You can always retrieve this information using the Stripe API.

Handle post-payment events Server-side

Stripe sends a checkout.session.completed event when the payment completes. Use a webhook to receive these events and run actions, like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.

Listen for these events rather than waiting on a callback from the client. On the client, the customer could close the browser window or quit the app before the callback executes. Some payment methods also take 2-14 days for payment confirmation. Setting up your integration to listen for asynchronous events enables you to accept multiple payment methods with a single integration.

Stripe recommends handling all of the following events when collecting payments with Checkout:

EventDescriptionNext steps
checkout.session.completedThe customer has successfully authorized the payment by submitting the Checkout form.Wait for the payment to succeed or fail.
checkout.session.async_payment_succeededThe customer’s payment succeeded.Fulfill the purchased goods or services.
checkout.session.async_payment_failedThe payment was declined, or failed for some other reason.Contact the customer through email and request that they place a new order.

These events all include the Checkout Session object. After the payment succeeds, the underlying PaymentIntent status changes from processing to succeeded or a failure status.

Test the integration

Card numberScenarioHow to test
The card payment succeeds and doesn’t require authentication.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.
The card payment requires authentication.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.
The card is declined with a decline code like insufficient_funds.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.
The UnionPay card has a variable length of 13-19 digits.Fill out the credit card form using the credit card number with any expiration, CVC, and postal code.

See Testing for additional information to test your integration.

Next steps

Last verified 2026-09-24

Is this helpful?