Events
Bias records an event when something happens to an object in your account, such as a bank debit succeeding or a subscription being canceled. The event holds the object before and after the change, in previous_state and state. Bias doesn’t send webhooks. Applications stream events to react as they happen.
The Event object
- Name
object
- Type
- "event",
- Description
- The object's type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
trueif the object is live, orfalseif it's in a sandbox.
- Name
created_at
- Type
- integer,
- Description
- When the object was created, in milliseconds since the Unix epoch.
- Name
context
- Type
- or null,
- Description
- Details about the event, such as the email address an invoice was sent to.
- Properties
- Name
previous_state
- Type
- CheckoutSession, CreditNote, Customer, CustomerBalanceTransaction, Discount, AppliedDiscount, Dispute, File, Invoice, Payment, PaymentMethod, Price, Product, Refund, ShippingRate, Subscription, or Mandate or null,
- Description
- The object before the event, for events that change an existing object.
- Properties
- Name
request
- Type
- string or object or null,
- Description
- Expandable. The request that caused the event.
- Properties
- Name
state
- Type
- CheckoutSession, CreditNote, Customer, CustomerBalanceTransaction, Discount, AppliedDiscount, Dispute, File, Invoice, Payment, PaymentMethod, Price, Product, Refund, ShippingRate, Subscription, or Mandate or null,
- Description
- The object after the event.
- Properties
- Name
type
- Type
- EventType,
- Description
- The event's type, in the form
object.action. - Properties
The Event object
Get an event
Retrieve an event by its ID.
Required parameters
- Name
id
- Type
- string,
- Description
- The ID of the event to retrieve.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
Returns
Returns the event object.
Retrieve an event
Response example
List all events
Retrieve a paginated list of events, most recently created first. With stream: true, the response stays open and streams each matching event as it’s created.
Event types lists every type.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
- Name
ending_before
- Type
- string,
- Description
- The ID of the object to list before, for pagination.
- Name
starting_after
- Type
- string,
- Description
- The ID of the object to list after, for pagination.
- Name
limit
- Type
- integer, at least 1, at most 1000, default is 50
- Description
- The maximum number of objects to return, from 1 to 1000. Defaults to 50.
- Name
stream
- Type
- boolean,
- Description
- Streams matching events as they're created, as newline-separated event objects.
- Name
filters
- Type
- object, object, or object,
- Description
- Properties
Returns
Returns a list of event objects.