stripe / stripe-cli

A command-line tool for Stripe
https://stripe.com/docs/stripe-cli
Apache License 2.0
1.57k stars 362 forks source link

Can't update enabled_events for webook_endpoints #1134

Closed roldengarm closed 2 months ago

roldengarm commented 7 months ago

The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply

Issue

I'm trying to update the enabled_events property on a webhook_endpoint. I'm getting this error: unknown flag: --enabled_events

Documentation is here

wh_id=<webhook_id>
stripe webhook_endpoints update $wh_id --enabled_events='["account.updated", "customer.subscription.deleted", "customer.subscription.updated", "customer.updated", "invoice.payment_failed"]'

I've also tried --enabled_events="['*']"

Expected Behavior

Enabled events is updated to the events I pass in.

Steps to reproduce

Run script above.

Environment

Select one of: macOS, Linux, Windows, Other

Windows, version 1.18 of the CLI

roldengarm commented 7 months ago

After trying a bit more and checking the help, found out it's a documentation error. The parameter is enabled-events. Also had to trial & error to pass in multiple events as an array did not work. In the end landed with this:

stripe webhook_endpoints update $wh_id --enabled-events='account.updated' --enabled-events='customer.subscription.deleted'  --enabled-events='customer.subscription.updated' --enabled-events='customer.updated' --enabled-events='invoice.payment_failed'
tomer-stripe commented 2 months ago

Ah yea, sorry about that! The API reference only lists the fields for the API request/response itself, it doesn't change based on the CLI or API ref. Will pass this feedback on to the team