For the complete documentation index, see llms.txt. This page is also available as Markdown.

Event stores

The event store object and how to fetch event stores

Event stores are associated with all the other resources and generated upon every creation, update, or cancellation of the related resource to help you track the history of each resource's data changes by providing paginated event access via API.

Each event store object contains information about the event that generated it (one of create or update), the type of resource that was created or updated, the request involved, the application, worker, or user that triggered the change, and more. You can find the change history inside the payload object, which shows, for each modified attribute, the values before and after the change.

You can retrieve a single event store by ID. No other direct CRUD operation is permitted on the event stores resource. You can fetch the paginated list of event stores associated with a specific resource as a relationship the resource itself.

Data retention policy

The retention period of an event store record depends on the state of the resource it refers to:

  • Test resources — Events related to resources in test mode are retained for 1 month.

  • All other resources — Events are retained for 1 year.

For exports and imports, only the create event is stored — update events are not tracked.

Fetching the event stores of a resource

To fetch all the events involving a specific resource, send a GET request to the /api/{{resource_name}}/:id/event_stores endpoint, where {{resource_name}} is the name of the resource (e.g. skus, customers, orders, etc.). You need to use integration API credentials.

Example

The following request fetches the event stores associated with the SKU identified by the ID xYZkjABcde:

curl -g -X GET \
  'https://yourdomain.commercelayer.io/api/skus/xYZkjABcde/event_stores' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token'

Pagination

When you fetch the event stores of a resource, you get paginated results.

No record or page count is available in the meta attribute. Unless you're requesting the last page, you can find the URL of the next page in the links attribute:

If no query parameter is specified, pagination starts from the first page, and the default page size is 10. The maximum page size allowed is 25, but we recommend using a lower value unless strictly necessary.

If you need to modify the default page size, use the page[size] query parameter in your request. To navigate through the paginated results, use the page[after] query parameters in your request:

Last updated