Get Stripe Event's Invoice ID doesn't return the Invoice ID (Bubble Stripe Plugin)

Hi :wave:

I’ve set up a Stripe Webhook to get notified when a subscription is successfully charged with the event " invoice.payment_succeeded" (as advised in this post by @yusaney1 ).

With that event ID I’m successfully retrieving the customer ID via "Get Stripe Event’s Customer ID.

However, Get Stripe Event’s Invoice ID returns an empty value, and therefore everything I’m trying to retrieve via that Invoice ID is empty too.

I know for sure that there was an invoice ID provided since I can see what was sent by Stripe.

What am I missing here? :roll_eyes:

You can try to see what really happened with https://webhook.site
You can redirect your request and see exactly whats going on (as secondary backup test).
I got the same problem, but for description in subscribe action (field is empty).
Still investigating… any news from your last post?

1 Like

Nothing new on the Invoice ID side. I just submitted a bug report. Let’s see.

@Lucien did you ever figure this out? I’m have the same problem.

Hey :wave:

Bubble’s support team required a test workflow, which wasn’t easy to provide since it was using a webhook triggered by Stripe itself…

So instead I provided a workflow retrieving the invoice ID via two different methods (via a custom API call and via Bubble’s plugin) to demonstrate the bug. This was in itself a workaround. And since that workaround works, Bubble didn’t think it was worth investigating further (they have to prioritise our numerous requests :wink:).

The demonstration:

The result of the demonstration in the database:

The custom API call to retrieve the Event:

Then the invoice ID is the Event’s Object ID:

I’m still using this to date. Works fine :slight_smile:

2 Likes

thanks @Lucien! I looked at your flow, but here’s what I’m running into:

I created a webhook for Stripe, for “upcoming.invoice” (all I want to do is show the customer, “your invoice is $xx.xx on [next month’s date]”

I’m fairly certain I’m missing something, but I can’t figure out where I’m going wrong. When the user registers, they begin a subscription, and so Bubble stores their customer ID by default.

All I want to do, is show each user, what next month’s subscription cost will be, using “upcoming.invoice” (Retrieve an upcoming invoice | Stripe API Reference). All I should need is the customer ID and “amount due”. The webhook initializes successfully, and sends tests successfully, but I can’t figure out a simple way to display this to the user.

It should be able to, since when I log into my Stripe dashboard, I can see an upcoming invoice (even if free trial is enabled) for every subscriber.

If I understand correctly, you should not need to wait for a webhook from Stripe. A simple API call should return the information you’re looking for.

I did a quick test, and it seems to work.

The API call:

Then, on the page where you want to display the amount due (the amount is given in cents, so you’ll need to divide by 100):

The result:

1 Like

Thanks @Lucien , that’s what I might end up using to pull all the misc. invoice data I want to display. I feel really stupid, but I found Bubble’s built-in solution for showing next invoice due and it’s actually working for me.

If anyone reads this, it’s found under User:

06%20PM

I will likely run an API call (or try and get the webhook working, since I think that’s what it’s meant for - catching data only when things change) to show them more details that Bubble’s built in features don’t catch

1 Like