BigCommerce
Store Operations
Settings
Store Logs

Store Logs API

The Store Logs API allows merchants to track events in their store. Each event creates an entry in the log. To process events over time, you can configure external systems to retrieve store log entries. For example, you can see how often merchants request shipping quotes from a carrier. You can also learn more about errors that occur on a store.

The store logs track events from all storefront channels. Examples of events include sign-ups for newsletters and changes to order statuses. You can retrieve an entry for 365 days after its timestamp.

This guide demonstrates how to use the Store Logs API. For more info, see the Store Logs API reference.

Get store logs

Send a request to the Get system logs endpoint. The API responds with the earliest 20 entries. The response orders the entries chronologically, from earliest to latest.

Filter by log ID

To filter the entries by log ID, pass a comma-separated list of log IDs to the id:in query parameter.

The following example retrieves entries by log ID:

Example request: Filter by log ID
GET https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/store/systemlogs?id:in=5,7
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

Filter by date created

Filter logs by using the date_created value in the query parameter. The date created must be in Unix Timestamp (opens in a new tab) format.

The following example retrieves entries by the date created:

Example request: Filter by date created
GET https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/store/systemlogs?date_created:min=1657688400&date_created:max=1658379600
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

Filter by type

The store logs categorize entries into various types. For example, requesting shipping quotes at checkout creates a shipping entry. To filter entries by type, use the type query parameter. For a list of log types, see the Get system logs endpoint reference.

The following example retrieves shipping entries:

Example request: Filter by type
GET https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/store/systemlogs?type=shipping
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

Filter by module

To see how often merchants request shipping quotes from a specific carrier, URL-encode the carrier name and pass it to the module query parameter.

The following example retrieves shipping entries by module:

Example request: Filter by module
GET https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/store/systemlogs?module=USPS+%28endicia%29
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

Filter by severity

Each event has an associated outcome, also known as severity. To filter the results by severity, use the severity query parameter. Specify the severity's corresponding integer in the query. For a list of severity values, see the Get system logs endpoint reference.

The following example retrieves notices, which have a severity of 2:

Example request: Filter by severity
GET https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/store/systemlogs?severity=2
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

Filter with pagination

As stated at the beginning of the section, the Get system logs endpoint returns the earliest 20 entries by default. To retrieve newer or differently grouped subsets of entries, use a combination of the page and limit query parameters.

The following example requests page two with two entries per page, which returns the third and fourth oldest entries:

Example request: Filter with pagination
GET https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/store/systemlogs?page=2&limit=2
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

Resources

Endpoint reference

Did you find what you were looking for?