# Event
Events are generated by some Shopify resources when certain actions are completed, such as the creation of an article, the fulfillment of an order, or the addition of a product. By requesting events, your app can know when certain actions have occurred in the shop.
The events returned by the Event resource should not be considered to be realtime. Events might not be created until a few seconds after the action occurs. In rare cases it can take up to a few minutes for some events to appear.
Events are generated by the following resources:
Verb | Message | Description |
---|---|---|
create |
New article created: article_url |
The article was created. |
destroy |
article_url was destroyed. |
The article was deleted. |
published |
article_url was published. |
The article was published. |
unpublished |
article_url was unpublished. |
The article was unpublished. |
update |
article_url was updated (but its published state was not changed). |
The article was updated. |
Verb | Message | Description |
---|---|---|
create |
New blog created: new_blog_url |
The blog was created. |
destroy |
blog_name was destroyed. |
The blog was deleted. |
update |
blog_name was updated. |
The blog was updated. |
Verb | Message | Description |
---|---|---|
create |
New collection created: collection_url |
The collection was created. |
destroy |
collection_url was destroyed. |
The collection was deleted. |
published |
collection_url was published. |
The collection was published. |
unpublished |
collection_url was hidden. |
The collection was hidden. |
update |
collection_url was updated. |
The collection was updated. |
Verb | Message | Description |
---|---|---|
create |
New comment for article_url : comment_excerpt |
The comment was created. |
Order events can be divided into the following categories:
Verb | Message | Description |
---|---|---|
authorization_failure |
The customer, unsuccessfully, tried to authorize: money_amount |
Authorization failed. The funds cannot be captured. |
authorization_pending |
Authorization for money_amount is pending. |
Authorization failed. The funds cannot be captured. |
authorization_success |
The customer successfully authorized us to capture: money_amount |
Authorization was successful and the funds are available for capture. |
cancelled |
Order was cancelled by shop_staff_name . |
The order was cancelled. |
capture_failure |
We failed to capture: money_amount |
The capture failed. The funds cannot be transferred to the shop. |
capture_pending |
Capture for money_amount is pending. |
The capture is in process. The funds are not yet available to the shop. |
capture_success |
We successfully captured: money_amount |
The capture was successful and the funds are now available to the shop. |
closed |
Order was closed. | The order was closed. |
confirmed |
Received a new order: order_number by customer_name . |
The order was confirmed. |
fulfillment_cancelled |
We cancelled number_of_line_items from being fulfilled by the third party fulfillment service. |
Fulfillment for one or more of the line_items failed. |
fulfillment_pending |
We submitted number_of_line_items to the third party service. |
One or more of the line_items has been assigned to a third party service for fulfillment. |
fulfillment_success |
We successfully fulfilled line_items. | Fulfillment was successful for one or more line_items. |
mail_sent |
message_type email was sent to the customer. |
An email was sent to the customer. |
placed |
Order was placed. | An order was placed by the customer. |
re_opened |
Order was re-opened. | The order was re-opened. |
refund_failure |
We failed to refund money_amount . |
The refund failed. The funds are still with the shop. |
refund_pending |
Refund of money_amount is still pending. |
THe refund is in process. The funds are still with shop. |
refund_success |
We successfully refunded money_amount . |
The refund was successful. The funds have been transferred to the customer. |
restock_line_items |
We restocked number_of_line_items . |
One or more of the order's line items have been restocked. |
sale_failure |
The customer failed to pay money_amount . |
The sale failed. The funds are not available to the shop. |
sale_pending |
The money_amount is pending. |
The sale is in process. The funds are not yet available to the shop. |
sale_success |
We successfully captured money_amount . |
The sale was successful. The funds are now with the shop. |
update |
order_number was updated. |
The order was updated. |
void_failure |
We failed to void the authorization. | Voiding the authorization failed. The authorization is still valid. |
void_pending |
Authorization void is pending. | Voiding the authorization is in process. The authorization is still valid. |
void_success |
We successfully voided the authorization. | Voiding the authorization was successful. The authorization is no longer valid. |
Verb | Message | Description |
---|---|---|
create |
New page created: page_url |
The page was created. |
destroy |
page_url was destroyed. |
The page was deleted. |
published |
page_url was published. |
The page was published. |
unpublished |
page_url was hidden. |
The page was hidden. |
update |
page_url was updated. |
The page was updated. |
Verb | Message | Description |
---|---|---|
create |
New price rule created: price_rule |
The price rule was created. |
destroy |
price_rule was destroyed. |
The price rule was deleted. |
update |
price_rule was updated. |
The price rule was updated. |
Verb | Message | Description |
---|---|---|
create |
New product created: product_title |
The product was created. |
destroy |
product_name was destroyed. |
The product was deleted. |
published |
product_title was published. |
The product was published. |
unpublished |
product_title was hidden. |
The product was hidden. |
The type of the resource that generated the event. Valid values:
Article
Blog
Collection
Comment
Order
Page
PriceRule
Product
ApiPermission
since_id
Request:
```
GET /admin/api/unstable/orders/450789469/events.json
```
Response:
```
HTTP/1.1 200 OK
{"events":[{"id":852065041,"subject_id":450789469,"created_at":"2008-01-10T09:00:00-05:00","subject_type":"Order","verb":"placed","arguments":[],"body":null,"message":"This order was created for Bob Norman from draft order #D1.","author":"Shopify","description":"This order was created for Bob Norman from draft order #D1.","path":"/admin/orders/450789469"}]}
```
## Retrieves a single event
Retrieves a single event by its ID
### Endpoint
/admin/api/#{api_version}/events/{event_id}.json (GET)
### Parameters
* api_version (required):
* event_id (required):
* fields: Show only certain fields, specified by a comma-separated list of field names.
### Responses
#### 200
Retrieves a single event
Examples:
##### Retrieves a single event by its ID
Request:
```
GET /admin/api/unstable/events/677313116.json
```
Response:
```
HTTP/1.1 200 OK
{"event":{"id":677313116,"subject_id":921728736,"created_at":"2008-01-10T08:00:00-05:00","subject_type":"Product","verb":"create","arguments":["IPod Touch 8GB"],"body":null,"message":"Product was created: IPod Touch 8GB.","author":"Shopify","description":"Product was created: IPod Touch 8GB.","path":"/admin/products/921728736"}}
```
## Retrieves a count of events
Retrieves a count of events
### Endpoint
/admin/api/#{api_version}/events/count.json (GET)
### Parameters
* api_version (required):
* created_at_max: Count only events created at or before this date and time. (format: 2014-04-25T16:15:47-04:00)
* created_at_min: Count only events created at or after this date and time. (format: 2014-04-25T16:15:47-04:00)
### Responses
#### 200
Retrieves a count of events
Examples:
##### Count all events
Request:
```
GET /admin/api/unstable/events/count.json
```
Response:
```
HTTP/1.1 200 OK
{"count":3}
```
##### Count of the number of events since a particular time
Request:
```
GET /admin/api/unstable/events/count.json
```
Response:
```
HTTP/1.1 200 OK
{"count":1}
```