Checkout Purchase Fulfillment Beta

    Learn how to fulfill purchases with Checkout.

    When your customer successfully completes their payment using Checkout, Stripe redirects them to the destination that you specified in the success_url parameter. Typically, it’s a page on your website that informs your customer that their payment was successful.

    Fulfilling purchases with the Dashboard

    When the user successfully completes payment, it is recorded as a new entry in the Dashboard’s list of payments. When you click an entry in the list, it takes you to the payment detail page. In the Checkout summary section, you can find the customer’s billing information and the list of items that they purchased. You can use this information to manually fulfill the customer’s purchase.

    Dashboard fulfillment is only practical for digital goods that you can send to the customer via e-mail. If you intend to fulfill purchases that include physical goods, your application should collect shipping details.

    Fulfilling purchases with webhooks

    Stripe can send webhook events to your server to notify you when a customer completes their payment. You can create a handler for the event and use it to execute any code that you need to fulfill the customer’s purchase. To handle a webhook event, create an HTTP endpoint on your server and configure the webhook endpoint in the Dashboard.

    Stripe sends the checkout.session.completed event when a Checkout payment is successful. The webhook payload includes an array of SKUs or plans purchased by the customer, the ID of the PaymentIntent created by Checkout, and optionally a clientReferenceId if it was provided in the redirectToCheckout call. The clientReferenceId is used to associate the successful payment with an purchase. The following example demonstrates how to create a webhook event handler that prints the SKU for each item purchased:

    require "json"
    require "sinatra"
    post '/' do
      event = JSON.parse(
      if event['type'] == 'checkout.session.completed'
        for item in event['data']['object']['display_items']
          client_reference_id = event['data']['object']['client_reference_id']
          # Fulfill the purchase using the client_reference_id...
      status 200

    This following table documents the keys and values present in the checkout.session.completed webhook:

    The ID of the created subscription if a plan was used.
    The ID of the confirmed PaymentIntent used for the customer's payment.
    An array of objects representing the items that your customer purchased.
    sku, plan
    The ID of the SKU that the customer purchased, or the ID of the plan that the customer subscribed to.
    The quantity of units for the item.
    The three-letter currency code used for the customer's payment.
    The amount used at time of payment for the SKU or plan.
    These are set to the values "sku" or "plan" which are based on the presence of the sku or plan keys.
    The URL Stripe redirected your customer to after they completed the payment.
    The URL Stripe redirected your customer when payment was canceled.
    A unique string to reference the Checkout session. This can be a customer ID, a cart ID, or similar. This can be used to fulfill the purchase.
    A boolean representing whether the live mode or test mode key was used.

    You can obtain the customer’s e-mail address and billing information by retrieving the payment_intent property of the webhook payload and inspecting the PaymentIntent’s source.owner property.


    We're always happy to help with code or other questions you might have! Search our documentation, contact support, or connect with our sales team. You can also chat live with other developers in #stripe on freenode

    Was this page helpful? Yes No


    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.