The list below is events generated by the following resources:
-
- Articles
-
- Blogs
-
- Custom collections
-
- Comments
-
- Orders
-
- Pages
-
- Price rules
-
- Products
With a new update, an event has 2 parts:
-
- Verb: The nature of the occurrence. Various resources produce various types of occurrences. A list of suitable verbs can be found in the resources section.
-
- Message: A human-readable description of the event. It can contain some HTML formatting.
Example: In a product, there are 4 events:
Verb | Message |
create | New product created: product_title |
destroy | product_name was destroyed. |
published | product_title was published. |
unpublished | product_title was hidden. |
Now, do you understand? Do you wonder why we need to retrieve a list of events?
Now, let’s dive into this subject a little deeper.
What Are Shopify API Events?
Shopify API events are records generated when specific actions occur within Shopify resources, such as creating a blog, fulfilling an order, or adding a product. These events allow your app to track and respond to changes in a Shopify store.
Key Components of an Event
An event consists of two main parts:
- Verb: Describes the type of action (e.g., create, destroy, published, unpublished). Each resource has its own set of applicable verbs.
- Message: A human-readable description of the event, which may include HTML formatting.
Example: Product Events
For a product, the following events might be generated:
Verb | Message |
---|---|
create | New product created: product_title |
destroy | product_name was destroyed |
published | product_title was published |
unpublished | product_title was hidden |
Supported Resources
Events can be generated by the following Shopify resources:
- Articles
- Blogs
- Custom Collections
- Comments
- Orders
- Pages
- Price Rules
- Products
Why Retrieve Events?
Events are enabled by default, but you may need to retrieve a list to:
- Monitor recent activities in your Shopify store.
- Debug or verify actions performed by your app or users.
How to Retrieve a List of Events Using Postman
Below are the steps to fetch a list of Shopify events using Postman.
Step 1: Generate API Credentials
To make API calls, you need to generate credentials from the Shopify Admin:
- Build a custom app in your Shopify store. Refer to Shopify’s guide on building a custom app for detailed instructions.
- After creating the app, note down:
- API Key
- Admin API Access Token
These credentials are required to authenticate your requests in Postman.
Step 2: Retrieve Events Using Postman
Follow these steps to fetch events:
- Open Postman and create a new workspace.
- Create a new GET request with the following URL format: textCopy
https://{API_key}:{admin_API_access_token}@{shop}.myshopify.com/admin/api/{api-version}/events.json
Replace the placeholders:- {API_key}: Your app’s API key.
- {admin_API_access_token}: Your admin API access token.
- {shop}: Your store’s name (e.g., hexasync).
- {api-version}: The API version (e.g., 2022-01).
https://ed86d512a2c95387ffa25f67074a222b:[email protected]/admin/api/2022-01/events.json
- Paste the URL into the request field.
- Click Send.
Step 3: Review the Response
The API will return a JSON response containing a list of events, including details such as:
- id: Unique event identifier.
- subject_id: ID of the resource affected.
- subject_type: Type of resource (e.g., Blog, Product, Collection).
- verb: Action performed.
- message: Description of the event.
- created_at: Timestamp of the event.
- author: Entity that triggered the event.
- path: Admin URL to the resource.
Sample Response:
jsonCopy
{
"events": [
{
"id": 35983479242815,
"subject_id": 49072865343,
"created_at": "2019-11-10T00:07:38+09:00",
"subject_type": "Blog",
"verb": "create",
"arguments": ["News"],
"message": "Blog was created: <a href='https://hexasync.myshopify.com/admin/blogs/49072865343'>News</a>.",
"author": "Shopify",
"description": "Blog was created: News.",
"path": "/admin/pages"
},
{
"id": 35983479767103,
"subject_id": 154864615487,
"created_at": "2019-11-10T00:07:40+09:00",
"subject_type": "Collection",
"verb": "create",
"arguments": ["Home page"],
"message": "Collection was created: <a href='https://hexasync.myshopify.com/admin/collections/154864615487'>Home page</a>.",
"author": "Shopify",
"description": "Collection was created: Home page.",
"path": "/admin/collections/154864615487"
},
{
"id": 35984440721471,
"subject_id": 4356022435903,
"created_at": "2019-11-10T01:01:44+09:00",
"subject_type": "Product",
"verb": "create",
"arguments": ["Acer Laptop Computer", "api_client_id", 1830279],
"message": "Team Beehexa created a new product: <a href='https://hexasync.myshopify.com/admin/products/4356022435903'>Acer Laptop Computer 2019</a>.",
"author": "Team Beehexa",
"description": "Team Beehexa created a new product: Acer Laptop Computer 2019.",
"path": "/admin/products/4356022435903"
}
]
}
Additional Resources
For further details, refer to the Shopify API documentation.
Watch a video tutorial: Shopify API – How to Retrieve a List of Events Using Postman (link to be provided)
For questions or support, leave a comment or contact the Shopify support team.
By following these steps, you can successfully retrieve and monitor events in your Shopify store using Postman.