This tutorial will show you how to add quick checkout to your headless/composable storefront using Stripe and Spree APIs.
Update the checkout
true
indicating that the order is from quick checkout. It is required as the address details you will receive from Apple Pay or Google Pay are not complete and wouldn’t be valid for the standard checkout.CLEAR
to clear the existing billing address (this prevents the order from accidentally advancing to the payment
step).Move the order to the delivery step
true
indicating that the order is from quick checkoutshipping_method_id
if you don’t have it yet, but if you received Shipping Method/Rate changed
event, and you already have the selected shipping method, then you can send it.total_minus_store_credits
for total) and shipping rates.total_minus_store_credits
Confirm that the order is ready for the payment
200
response code means that the order is ready for the payment.Update the address with more data
true
indicating that the order is from quick checkouttrue
so the order does not advance to the next stateMove the order to the payment step
<PAYMENT INTENT ID>
should be Spree’s internal payment intent ID, which you will receive when you create the payment intent. Do not confuse it with Stripe’s payment intent ID.return_url
when confirming the payment intent to <SHOP URL>/stripe/payment_intents/<PAYMENT INTENT ID>
. This will check if the payment intent is confirmed, move the order to the complete state, and redirect the user to the order summary.
If you like to make the order summary page by yourself, then after confirming the payment intent in Stripe, make this request: