Skip to content
Joshua Harms edited this page Dec 20, 2023 · 1 revision

Events

Events are generated by specific Shopify resources when specific things happen, such as the creation of an article, the placement or fulfillment of an order, the addition or deletion of a product, and so on. By requesting events, your app can get a "log" of important occurrences in the operation of a shop.

Caution: the events returned by the Events API should not be considered to be realtime. Events might not appear in the list returned by the API until a few seconds after they've occurred. In rare cases (<1% of the time) it can take up to a few minutes for some events to appear.

Counting events

var service = new EventService(myShopifyUrl, shopAccessToken);
var count = await service.CountAsync();

Getting an event

var service = new EventService(myShopifyUrl, shopAccessToken);
var event = await service.GetAsync(eventId);

Listing events

var service = new EventService(myShopifyUrl, shopAccessToken);
var events = await service.ListAsync();

Listing events for a specific subject (e.g. Order or Product)

You can filter your event list result to only the events created by a specific "subject"; i.e. you can list all events for one specific Order, Product, Article, etc. When filtering events in this way, you must supply both the "subject" type and its id.

Known subject types are 'Articles', 'Blogs', 'Custom_Collections', 'Comments', 'Orders', 'Pages', 'Products' and 'Smart_Collections'. A current list of subject types can be found at https://help.shopify.com/api/reference/event.

var service = new EventService(myShopifyUrl, shopAccessToken);
var subjectType = "Order";
var orderEvents = await service.ListAsync(orderId, subjectType);
Clone this wiki locally