Shipping options
If you need to ship a good, then you can have Flex collect shipping details for you by setting 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 is variable based off of the cart items then you can pass along the shipping data to create the shipping rate as part of the checkout session payload.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 is important to note that Flex does not currently calculate tax. This is an amount that you have previously calculated.Add a discount
If you’d like to add a discount when charging a customer you can do so by creating a coupon then setting 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 is recommended to listen to the webhooks in order 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: