Adds support for retrieving thin events
What’s new
You can now retrieve thin Event objects for each notification from the /v2/core/events
endpoint.
Thin events are lightweight events you can access through the API v2 API. Thin events have a more granular permissions model and their payloads contain no API-versioned data. This makes it easier to update integrations that receive events and are built with a well-typed Stripe SDK. Thin Event objects include a data
property that can include additional information about the event.
The Meters API is the first API to use thin events. Currently, you can only retrieve the following Events v2 related to usage-based billing:
Here’s an example of an v1.
event. The related_
field includes the id
of the object, but doesn’t include the object record itself.
{ "id": "evt_test_65R9Ijk8dKEYZcXeRWn16R9A7j1FSQ3w3TGDPLLGSM4CW0", "object": "v2.core.event", "type": "v1.billing.meter.error_report_triggered", "livemode": false, "created": "2024-09-17T06:20:52.246Z", "related_object": { "id": "mtr_test_61R9IeP0SgKbYROOx41PEAQhH0qO23oW", "type": "billing.meter", "url": "/v1/billing/meters/mtr_test_61R9IeP0SgKbYROOx41PEAQhH0qO23oW" } }
Learn more about events.
Impact
Thin events have several benefits. They make it easier to maintain future webhook integrations because the payloads are unversioned. You can send thin events to event destinations. Thin events are fully typed in the SDKs for API v2. Finally, if your application needs a corresponding API object related to an event (for example, the Meter), you must call the Stripe API for the object’s latest state. This helps prevent application errors caused by outdated object data (for example, race conditions). The SDKs for API v2 contain helper methods that allow you to retrieve records associated with an event.