Events
Events are a log of changes in API object state. Use them to handle asynchronous updates from Bias in your application code.
The Event object
- Name
object
- Type
- "event",
- Description
- Literal representing the object’s type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
- Has the value
trueif the object exists in a production environment or the valuefalseif the object exists in a sandbox environment.
- Name
created_at
- Type
- integer,
- Description
- Time at which the object was created. Measured in milliseconds since the Unix epoch.
- Name
previous_state
- Type
- CheckoutSession, Customer, Discount, Dispute, File, object, Payment, PaymentMethod, Price, Product, or Refund or null,
- Description
- The full object state before the event occurred.
- Name
request
- Type
- string or object or null,
- Description
- Expandable. The request, if any, that triggered the event.
- Properties
- Name
state
- Type
- CheckoutSession, Customer, Discount, Dispute, File, object, Payment, PaymentMethod, Price, Product, or Refund or null,
- Description
- The full object state after the event occurred.
- Name
type
- Type
- enum,
- Description
- The type of event that occurred. Follows the format of
object.action.
The Event object
Get a event
Retrieve a event by its ID.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Optional object that allows you to expand certain ID fields to include related resources.
- Properties
Returns
Returns the event object.
Retrieve a event
Response example
List all events
Retrieve a paginated list of events or stream them as they come in.
Optional parameters
- Name
expand
- Type
- object,
- Properties
- Name
ending_before
- Type
- string,
- Description
- A cursor for use in pagination.
ending_beforeis an object ID that results will end before. Used to move backward through the list.
- Name
starting_after
- Type
- string,
- Description
- A cursor for use in pagination.
starting_afteris an object ID that results will start after. Used to move forward through the list.
- Name
limit
- Type
- number, at least 1, at most 1000, default is 50
- Description
- Maximum number of objects to return.
- Name
stream
- Type
- boolean,
- Description
- Stream events matching the provided parameters as they are created. If true, the response will be a stream of events, separated by a newline. Space characters are sent periodically to keep the stream alive.
- Name
filters
- Type
- object, object, or object,
- Description
- Filters to apply to the list. Combine multiple conditions with
andandor. - Properties
Returns
Returns a list of event objects.