1. Webhooks
Documentation
  • Back to home
  • StripeKit
  • Installation
  • Getting Started
  • Choosing a Mode
  • Type Reference
  • Setup
    • Configuration
    • Timezones
    • Storage Adapter
    • Money and Currency
    • Error Handling
  • Stripe
    • Elements
  • Modules
    • Overview
    • Customers
      • Overview
      • List
      • Retrieve
      • Find or Create by Email
      • Create
      • Update
      • Sync
      • Delete
    • Payment Methods
      • Overview
      • Create Setup Intent
      • List
      • Attach
      • Detach
      • Set Default
      • Sync
    • Payments
      • Overview
      • Pay With Saved Method
      • Create
      • Retrieve
      • Confirm
      • Cancel
      • Sync
    • Checkout
      • Overview
      • Get
      • Create
      • Submit Fields
      • Apply Coupon
      • Mark Complete
    • Subscriptions
      • Overview
      • Create
      • Retrieve
      • Cancel
      • Resume
      • Toggle Collection Method
      • Update Fields
      • Apply Promotion Code
      • List By Customer
      • Find By Metadata
      • Sync
    • Invoices
      • Overview
      • Retrieve
      • List By Customer
      • List By Subscription
      • Pay With Saved Method
      • Void
      • Finalize
      • Sync
    • Coupons
      • Overview
      • Create
      • Validate
      • Apply To Subscription
      • List
      • Deactivate
    • Webhooks
      • Overview
      • Process
      • Events Reference
    • Sync
      • Overview
  1. Webhooks

Events Reference

Every Stripe event type StripeKit recognizes, the handler key you can provide for it, and exactly what StripeKit does automatically before calling your handler (when autoSync is not set to false).
Stripe event typeHandler keyAutomatic sync (autoSync: true)
payment_intent.succeededonPaymentSucceeded$kit->payments->sync($paymentIntent->id)
payment_intent.payment_failedonPaymentFailed$kit->payments->sync($paymentIntent->id)
invoice.createdonInvoiceCreated$kit->invoices->sync($invoice->id)
invoice.updatedonInvoiceUpdated$kit->invoices->sync($invoice->id)
invoice.paidonInvoicePaid$kit->invoices->sync($invoice->id)
invoice.payment_failedonInvoicePaymentFailed$kit->invoices->sync($invoice->id)
invoice.voidedonInvoiceVoided$kit->invoices->sync($invoice->id)
invoice.deletedonInvoiceDeleted$storage->markInvoiceDeleted($invoice->id), only if a storage adapter is configured
customer.subscription.createdonSubscriptionCreated$kit->subscriptions->sync($subscription->id)
customer.subscription.updatedonSubscriptionUpdated$kit->subscriptions->sync($subscription->id)
customer.subscription.deletedonSubscriptionDeleted$kit->subscriptions->sync($subscription->id)
setup_intent.succeededonSetupIntentSucceeded$kit->paymentMethods->sync($customerId), where $customerId is read off the SetupIntent
checkout.session.completedonCheckoutSessionCompletedNone. Nothing is synced automatically for this event, since the checkout session itself isn't a persisted Stripe billing object. Handle this event to call $kit->checkout->markComplete() yourself, and to fulfil the order.
Any other event typeonUnhandledEventNone.

Notes#

If you don't provide a handler for a given key, StripeKit still performs the automatic sync (unless autoSync: false), it just doesn't call anything of yours afterwards. This means your database stays correct even if you only implement the handlers you specifically care about.
onUnhandledEvent is a catch-all for any event type not listed above. Use it for logging or for event types you plan to support later. It is not called for event types that do have a specific handler key, even if you didn't provide that specific handler.
Configure which event types Stripe actually sends to your endpoint from the Stripe Dashboard, or when creating the webhook endpoint via the Stripe API. StripeKit's process() safely ignores any event type it doesn't recognize, routing it to onUnhandledEvent, so it's safe to subscribe to more event types than StripeKit explicitly handles.
Previous
Process
Next
Overview
Built with