Is it possible to retrieve the items, price, and quantity from the shopping cart in my Python code when using a Stripe Gateway checkout on Webflow for integration with iDeal in the Netherlands?

TL;DR
  • Webflow doesn't expose cart data via API, so use JavaScript to extract cart contents client-side.  
  • Send cart data to a Python backend, which creates a Stripe Checkout session (with iDeal support), and redirect users to the returned Checkout URL.

You cannot directly retrieve cart items, prices, and quantities from Webflow into Python code when using Stripe Checkout, because Webflow does not give access to its cart data via an API before the transaction.

However, there are workarounds depending on your integration goals.

1. Understand How Webflow Ecommerce Works with Stripe

  • Webflow Commerce internally uses Stripe as the payment processor, but it doesn't expose the shopping cart data via API or form submission that you can access server-side.
  • The shopping cart is client-side JavaScript, and when checkout is triggered, the contents are not sent in a way your Python backend can intercept.

2. iDeal Integration Limitation

  • Webflow currently does not support iDeal as a Stripe payment method via its native ecommerce checkout.
  • Stripe Checkout (hosted separately from Webflow) supports iDeal, but using it requires custom Stripe Checkout session creation, which Webflow doesn't natively support.

3. Workaround: Bypass Webflow’s Native Checkout

To gain full control and support iDeal via Stripe:

  • Use Webflow for the storefront only (product presentation).
  • Replace Webflow’s native checkout with a custom Stripe Checkout session launched by your Python backend.
  • On button click (e.g., “Buy Now”), you collect cart data using custom JavaScript and send it to your Python server to create a Stripe Checkout session.

4. How to Capture Cart Details from Webflow

  • Use JavaScript to read the cart contents from the Webflow cart object (e.g., window.fsAttributes.items if using Finsweet or Webflow.require('cart').items() if available).
  • Example fields:
  • product name
  • price
  • quantity
  • Then send this data via AJAX or a fetch() request to your Python backend.

5. Create Stripe Checkout Session in Python

  • On your server, process the cart payload to build a Stripe Checkout session that includes:
  • line_items: names, quantities, prices
  • paymentmethodtypes=['ideal']
  • Return the Checkout URL to the frontend.
  • Redirect the user to that URL.

Summary

You cannot retrieve cart data from Webflow using Python code directly while using Webflow’s native Stripe checkout. To support iDeal and access cart data, you must bypass Webflow checkout, extract cart data using JavaScript, send it to your Python server, and create a custom Stripe Checkout session.

Rate this answer

Other Webflow Questions