Skip to content

Trigger command

ahlee-stripe edited this page Sep 16, 2020 · 9 revisions

The CLI will allow you to trigger a few test webhook events to conduct local testing. These test webhook events are real objects on the API and may trigger other webhook events as part of the test (e.g. triggering payment_intent.succeeded will also trigger payment_intent.created).

The webhook events we currently support are listed in the CLI ($ stripe help trigger) or in the list below.

To trigger an event, run:

$ stripe trigger <event>

Supported events

Currently, the Stripe CLI supports triggering the following webhooks events:

  balance.available
  charge.captured
  charge.dispute.created
  charge.failed
  charge.refunded
  charge.succeeded
  checkout.session.async_payment_failed (NOTE: needs to be run with a UK Stripe account)
  checkout.session.async_payment_succeeded (NOTE: needs to be run with a UK Stripe account)
  checkout.session.completed
  customer.created
  customer.deleted
  customer.source.created
  customer.source.updated
  customer.subscription.created
  customer.subscription.deleted
  customer.subscription.updated
  customer.updated
  invoice.created
  invoice.finalized
  invoice.payment_failed
  invoice.payment_succeeded
  invoice.updated
  issuing_authorization.request
  issuing_card.created
  issuing_cardholder.created
  payment_intent.amount_capturable_updated
  payment_intent.canceled
  payment_intent.created
  payment_intent.payment_failed
  payment_intent.succeeded
  payment_method.attached
  plan.created
  plan.deleted
  plan.updated
  product.created
  product.deleted
  product.updated
  setup_intent.canceled
  setup_intent.created
  setup_intent.setup_failed
  setup_intent.succeeded
  subscription_schedule.canceled
  subscription_schedule.created
  subscription_schedule.released
  subscription_schedule.updated

Events are triggered by making corresponding requests against the Stripe API, setting up additional objects as necessary. This means that triggering events will have side effects and will have properly backed API objects.

Adding new triggers

All triggers are defined in pkg/fixtures/triggers.go. They are setup as basic API requests so if you're comfortable, feel free to open a pull request adding new ones!

Requesting new triggers

If you're having trouble adding a trigger, please open a feature request that we add one.