Event

Events are our way of letting you know when something interesting happens in your account. When an interesting event occurs, we create a new Event object. For example, when checkout is completed, we create a checkout.session.completed event.

Events occur when the state of another API resource changes. The state of that resource at the time of the change is embedded in the event's data field. For example, a checkout.session.completed event will contain a checkout object.

As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. We also have a separate webhooks system for sending the Event objects directly to an endpoint on your server. Webhooks are managed in your account settings, and our Using Webhooks guide will help you get set up.

Event Object

{
  "id": "evt_1MDpQdJpH8mQ1ZZWYNzu7a30",
  "object": "event",
  "created": 1670764731,
  "data": {
    "object": {
      "id": "cs_a1U7SSk86e6DUcjD9Zg7c26WqxP13PEG0pIt2TvAGPmyK9kDnD4kGR4tri",
      "object": "checkout.session",
      "amount_total": 10.99,
      "cancel_url": "https://example.com/cancel",
      "created": 1671995248,
      "expires_at": 1671995248,
      "payment_link_id": "",
      "status": "completed",
      "success_url": "https://example.com/success",
      "url": "https://fanspay.io/checkout/cs_a1U7SSk86e6DUcjD9Zg7c26WqxP13PEG0pIt2TvAGPmyK9kDnD4kGR4tri",
      "transaction_status": "unconfirmed"
    }
  },
  "type": "checkout.session.completed"
}

Attributes

Types of events

This is a list of all the types of events we currently send. We may add more at any time, so in developing and maintaining your code, you should not assume that only these types exist.

You'll notice that these events follow a pattern: resource.event. Our goal is to design a consistent system that makes things easier to anticipate and code against. NOTE: Events that occur on subresources like checkout.session do not trigger the parent's update event.

💡 Events marked as SELECTION REQUIRED are only created when a webhook has been configured to listen for that type of event specifically. A webhook set to listen to all events will not receive an event requiring explicit selection.

Last updated