Shipping options
If you need to ship a good, Flex can collect shipping details for you. Set theshipping_address_collection parameter to true as part of the payload.
If you additionally want to charge a shipping rate then you can do so by either:
Creating a fixed shipping rate
shipping_rate_id as part of the payload when creating a checkout session.
Creating a dynamic shipping rate
If your shipping varies based on the cart items, pass the shipping data in the checkout session payload. Flex creates the shipping rate from it.Setting a tax amount
If you need to pass along a tax amount to charge a customer you can do so by setting a tax_rate. It’s important to note that Flex does not currently calculate tax. This is an amount that you have previously calculated.Add a discount
To add a discount when charging a customer, create a coupon. Then set the discounts parameter as part of the payload.Creating a coupon
Iframe embedding
The checkout may be embedded on a page or within a modal by placing the checkout within an iframe:checkout.session.completed Webhook Event. However, unlike webhooks, the event from the client
is not guaranteed to fire. Therefore it’s recommended to listen to the webhooks to ensure that the message is
received.
The message could be customized by creating a redirect to your own site and having that page
post a message to the parent: