stripe-cli icon indicating copy to clipboard operation
stripe-cli copied to clipboard

--forward-thin-to does not forward event to localhost

Open TheBaekoning opened this issue 5 months ago • 6 comments

Issue Summary:

In Stripe CLI v1.28, I'm encountering two issues related to thin events:

When using the --forward-thin-to flag with stripe listen, my localhost endpoint does not receive any events. In contrast, --forward-to works as expected for standard events, suggesting that the issue is specific to thin event forwarding.

The documentation here is unclear regarding the correct method for triggering thin events. Attempting to run stripe preview trigger outbound_payment.posted returns a help message indicating the command or arguments are invalid. It's not clear whether this is due to deprecated syntax or changes in CLI behavior in recent versions.


Environment:

Stripe CLI version: 1.28.x

OS: Mac OS

Command used:

stripe listen --forward-thin-to localhost:8080/webhooks/stripe --thin-events "*"

TheBaekoning avatar Jul 14 '25 07:07 TheBaekoning

Ah yea the preview trigger command has been removed. I don't think outbound_payment.posted is a valid trigger atm, but if you try stripe trigger v1.billing.meter.no_meter_found that should create and send thin events.

Let me see what happened to that outbound_payment.posted trigger.

tomer-stripe avatar Jul 15 '25 19:07 tomer-stripe

Running into the same issue. snapshot events locally can be successfully sent to my local host

stripe listen --forward-to http://localhost:5173/webhook/stripe   

However, thin events are not even being sent to the endpoint. Even though the cli is able to listen to incoming events:

stripe listen --forward-thin-to http://localhost:5173/webhook/stripe --skip-verify

Note: I'm not using the stripe cli to trigger event, instead I'm creating real events: e.g. creating real product and price in local environment

liuqiaowei512 avatar Aug 09 '25 16:08 liuqiaowei512

Running into the same issue. snapshot events locally can be successfully sent to my local host

stripe listen --forward-to http://localhost:5173/webhook/stripe   

However, thin events are not even being sent to the endpoint. Even though the cli is able to listen to incoming events:

stripe listen --forward-thin-to http://localhost:5173/webhook/stripe --skip-verify

Note: I'm not using the stripe cli to trigger event, instead I'm creating real events: e.g. creating real product and price in local environment

Never mind, just realized product.created and price.created are not thin events that is why the forwarding is not working. Although, the silent debug message is not helping. Suggesting to explicitly tell user when a forward-thin-to is met with a snapshot event. This way, user will be more aware

liuqiaowei512 avatar Aug 11 '25 19:08 liuqiaowei512

Experiencing the same issue trying to set up Stripe for the first time. Is this an issue only related to local testing or should I rewrite my backend to listen to v1 snapshot events instead?

Context that might help resolving the bug:

Ran this command to listen to thin events: PS C:\Users\xx> stripe listen --thin-events="*" --forward-thin-to=http://localhost:8001/api/payments/webhook

Received my webhook secret: > Ready! You are using Stripe API Version [2025-06-30.basil]. Your webhook signing secret is whsec_9ce...

Completed a successful transaction with these events being sent: 2025-08-26 14:33:52 --> charge.succeeded [evt_3S...] 2025-08-26 14:33:53 --> checkout.session.completed [evt_1S...] 2025-08-26 14:33:53 --> payment_method.attached [evt_1S...] 2025-08-26 14:33:53 --> customer.subscription.created [evt_1S...] 2025-08-26 14:33:53 --> payment_intent.succeeded [evt_3S...] 2025-08-26 14:33:53 --> payment_intent.created [evt_3S...] 2025-08-26 14:33:53 --> invoice.created [evt_1S...] 2025-08-26 14:33:53 --> invoice.paid [evt_1S...] 2025-08-26 14:33:54 --> invoice.finalized [evt_1S...] 2025-08-26 14:33:55 --> invoice.payment_succeeded [evt_1S...]

Looking in my sandbox I'm receiving v1 events and zero v2 events has been sent.

maxfallstrom avatar Aug 26 '25 12:08 maxfallstrom

checkout.session.completed

@maxfallstrom checkout, payment_method all these are part of v1 events. Currently, Stripe only generates "thin events" using /v2 endpoints and resources. Example v2 endpoints

  • /v2/core/accounts - The Accounts v2 API for managing connected accounts
  • /v2/core/event_destinations - For managing event destinations

liuqiaowei512 avatar Aug 26 '25 15:08 liuqiaowei512

It seems thin-event does not support all events?

Tried stripe trigger checkout.session.completed. Stripe listening show many events and end with..

--> charge.updated [evt_......]

But there is no

<-- [200] POST https://localhost/my-webhooks.php

So, webhooks listener PHP not being called and not working.

It's being called PHP if I run command stripe trigger v1.billing.meter.no_meter_found

.

Run with flag --thin-events "*" as documented https://docs.stripe.com/webhooks?snapshot-or-thin=thin&snapshot-or-thin-trigger=thin#test-webhook show notice

INFO Warning: You're attempting to listen for "*", which isn't a valid thin event or preview event

The document is poor, no working example that without notice/error.

If I want to receive webhooks to just fulfill order/subscription (create checkout, check paid, payment failure, refund) ...Maybe is it better to use snapshot events?

ve3 avatar Oct 24 '25 18:10 ve3