Off Session Checkouts
Learn how session checkouts work.
When a customer completes a checkout, you can include the setup_future_use
parameter and Flex will save the customer’s payment method for later usage.
Then at any point in the future you may use the Off Session API to charge the customer using that saved payment method, without requiring the customer to be present in the flow or re-enter their payment details.
Initial (on session) checkout session
This follows the normal checkout flow, with the only difference being that when you create the checkout session your request should include the parameter setup_future_use
with a value of off_session
Verify the customer’s payment method
To find your customer’s available payment methods, you can use List Payment Methods API.
You should see the payment method with a value of off_session
: true
. This means that the payment method was successfully saved for future use.
Off session checkout
Now that the customer has a saved payment method, you can use the off session checkout API to submit charges.
The request payload should look similar to a normal checkout, with a few differences.
- Set the parameter
mode
tooff_session
- Set the parameter
customer
to the customer_id - Set the parameter
payment_method
to be the ID of the saved off session payment method
Restrictions
Off session checkouts have some additional restrictions compared to standard checkouts:
- Letter of Medical Necessity - If any of the items requires a Letter of Medical Necessity, the customer must already have one on file with Flex
- No Split Cart - All the items in the cart must be HSA/FSA eligible in order to pay with an HSA/FSA card