Trace Stripe Subscription payments and communicate to Bubble

Hei guys,

Contest
I ve successfully set the Webhook between stripe and bubble in order to receive information during customer checkouts. Through Webhook I can trace 2 types of information:

  1. One-off payments in checkout session
  2. First subscription payment but missing the following ones. This happens because the webhook communicate only what receive from the first checkout session.

Problem
How can I trace the following payments (after the first subscription payment) that are automatically withdrown by stripe and communicate them to Bubble?

Thank you

Use invoice.paid event and make sure the billing_reason is “subscription_cycle”

When an invoice is paid and the billing_reason is “subscription_cycle”, it’s an automatic subscription payment

Hei thanks for the answer and I understand what you say. The problem when i accept more than one event I receive this problem I ve already explained here.

That’s why the conditional on the backend workflow you’d be using as webhook

Having a conditional on the backend wf would stop the webhook from running unnecessarily.

So basically i should create another separate webhook that is sending only Invoice event?
Correct?

Hi! I replied to you in your other thread. You can check the type in the webhook payload and use Bubble conditionals to run different workflows based on it. For example, if type = this, do this; etc. You usually just need one webhook endpoint

{
“id”: “evt_1Example”,
“object”: “event”,
“type”: “payment_intent.succeeded”,

}

That’s correct

It makes sense and I understood.
I ve just one problem with it.

I would love to create 2 API Workflow because with the checkout.session event I need to create some workflow (with conditional) while if that’s a invoice payment i need other workflows (with other conditions). But it seems it doesn t let me do it through bubble. Is it normal?

Am I supposed to have only one API?

@kirsnvartem

Hey @gianlucabiancardi96

You can definitely create as many API workflows as you need! Splitting up your workflows for different webhooks (like handling checkout.session and invoice.payment) is actually a pretty standard approach and helps keep things organized.

I don’t see any issues in your screenshot. If you’re having trouble adding a new workflow, try duplicating an existing one by copying and pasting it. This should create a new endpoint with “copy” at the end of the name, which you can then customize for your second webhook.

Just remember to add this second endpoint to your Stripe settings and initialize it to ensure everything’s properly connected.

Let me know if that helps!

Hei @kirsnvartem,

Yes, I got the point. Didn’t know I had to create another endpoint on Stripe that’s why it was not functioning.

Thank you!