Sample - Stripe API
GET/v1/events/{id}

Retrieve an event

Retrieves an event created within the last 30 days. Use id to select the event, optionally requesting expanded fields with expand; event data is rendered according to the API version in effect when the event was created.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
idstringrequired
The event identifier, limited to 5000 characters.
expandarray<string>optional
Fields to expand in the response; each value can contain at most 5000 characters.

2 status codes
200Returns the event object with its creation time, event data, identifier, live-mode state, pending webhook count, request information, type, and object type.
accountstringoptional
The connected account that originates the event.
api_versionstringoptional
The Stripe API version used to render `data` when the event was created. The contents of `data` never change, so this value remains static regardless of the API version currently in use. This property is populated only for events created on or after October 31, 2014.
contextstringoptional
Authentication context needed to fetch the event or related object.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
dataobjectrequired
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:event
pending_webhooksintegerrequired
Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify.
requestobjectoptional
Information on the API request that triggers the event.
typestringrequired
Description of the event (for example, `invoice.created` or `charge.refunded`).
defaultReturned when the API cannot process the retrieval; the response contains an error object.
errorobjectrequired

Error handling

id must identify an event created within the last 30 days and must be a string of no more than 5000 characters. Each value in expand must be a string of no more than 5000 characters.