I am trying to automate user subscription tracking in Bubble by parsing Stripe checkout.session.completed webhooks. The goal is to update the User record with stripe_customer_id, stripe_subscription_id, and set is_premium = true..
Current Setup & What Works:
-
Endpoint receives
checkout.session.completedwebhooks with200 OK. -
Search for Userssuccessfully matches the user by email using direct field selection onRequest Data. -
is_premiumconsistently updates totrue. -
Initial Test Behavior: On first setup, live events left the ID fields blank, but manually clicking Resend in Stripe successfully populated
stripe_customer_idandstripe_subscription_id.
The Issue:
-
On live checkouts,
stripe_customer_idandstripe_subscription_idevaluate to(empty)on the User record. -
Server logs show the payload contains the IDs, but for returning customers (who already exist in Stripe and have an old
stripe_customer_idin Bubble), it occasionally pulls a previous subscription ID or leaves the field blank. -
Rebuilt the workflow with a 10-second delay step to rule out database/timing race conditions, but the issue persists.
What is the standard, best-practice Bubble logic to handle checkout.session.completed for both new users (matched by email) and returning customers (matched by existing stripe_customer_id / email) to ensure the current subscription_id always saves reliably?