Admin Resources
Events
This resource allows a caller to inspect recent events in the store.
#The event object
An
Event record represents an action that took place at a point in time.Attributes
- idintegerUnique numeric identifier for the
Event. - object_idintegerThe unique numeric identifier of the object associated with the
Event. - customer_idintegerThe unique numeric identifier of the customer associated with the
Event.This value can benullfor events not directly associated with a customer. - created_atdatetimeThe date and time when the
Eventwas created. - object_typestringThe resource type of the object associated with the
Event, e.g. 'customer' or 'subscription' - verbstringThe action describing the
Event, e.g. 'created' or 'updated' - descriptionstringThe short description that summarizes the
Event. - updated_attributesobjectA list of objects describing attributes that were changed during the
Event.Show child attributesHide child attributes3
- attributestringThe key of an attribute updated on the object during this
Event. - previous_valuestringThe previous value of the updated attribute.
- valuestringThe new value of the updated attribute.
- sourceobjectAn object containing details about the origin of the
Event.Show child attributesHide child attributes6
- account_idstringIf the event resulted from action by a Store Admin, the account id of the store admin.
- api_token_idstringIf the event resulted from action by an external API call, the primary key of the API token used to take the action.
- api_token_namestringIf the event resulted from action by an external API call, the name of the API token used to take the action, as it is saved in Recharge Merchant Admin portal.
- account_emailstringIf the event resulted from action by a Store Admin, the email associated with the store admin account.
- originstringThe origin of the event, e.g. 'api', 'customer_portal', 'merchant_portal', 'recharge_process'
- user_typestringThe type of user who initiated the event, e.g. 'customer', 'store_admin', 'recharge_admin', 'recharge_process'
- custom_attributesobjectA list of objects passed explicitly to a Recharge API call that created the
Event.This field will only be populated on events created using the Recharge API.
{
"event": {
"id": 7160141294,
"object_id": 362310818,
"customer_id": 36885098,
"created_at": "2023-05-31T14:16:07",
"object_type": "subscription",
"verb": "updated",
"description": "Updated subscription #362310818",
"updated_attributes": [
{
"attribute": "price",
"previous_value": "12.00",
"value": "15.00"
},
{
"attribute": "quantity",
"previous_value": "3",
"value": "5"
}
],
"source": {
"account_id": null,
"api_token_id": 987654321,
"api_token_name": "Subscription API token",
"account_email": null,
"origin": "api",
"user_type": null
},
"custom_attributes": [
{
"key": "ab_testing_flag",
"value": "a"
}
]
}
}#List events
GET/events
Returns all events associated with the store. The Events API is limited to events that occurred in the last 7 days
Scope
read_eventsGranting the
read_events scope to a token will expose some details about other Recharge API resources via the Events API.Query parameters
- created_at_minstringShow events that occurred after a certain date
- created_at_maxstringShow events that occurred before a certain date
- object_typestringFilter events by specific
object_type, such asaddress,customer, orsubscription.
For a full list of available object types, refer to the list below.Show child attributesHide child attributes1
- object_typestring
address,address/payment_method,app,async_batch,bundle_product,bundle_selection,cancellation_flow,charge,checkout,collection_product,collection,credit_account,credit_adjustment,customer,delivery_profile,discount,email,fraud_investigation,membership_program_condition,membership_program,membership,monthly_sku_swap_workflow_adapter,onetime,order,payment_method,plan,product,purchase_item,sequence_workflow_adapter,shipping_window_workflow_adapter,shop,store,subscription,theme,webhook,widget_settings
- object_idintegerShow events with a specific
object_id. This filter should be used with theobject_typefilter. - verbsstringShow events with a specific
verbor comma-separated list ofverbs - customer_idintegerShow events related to a specific
customerusing the customer's primary identifier - originstringFilter events by specific source origin.
Available origins:api,customer_portal,merchant_portal,recharge_process,external_platform.
curl 'https://api.rechargeapps.com/events?limit=3' \
-H 'X-Recharge-Version: 2021-11' \
-H 'X-Recharge-Access-Token: your_api_token'{
"events": [
{
"id": 7160141294,
"object_id": 362310818,
"customer_id": 36885098,
"created_at": "2023-05-31T14:16:07",
"object_type": "subscription",
"verb": "updated",
"description": "Updated subscription #362310818",
"updated_attributes": [
{
"attribute": "price",
"previous_value": "12.00",
"value": "15.00"
},
{
"attribute": "quantity",
"previous_value": "3",
"value": "5"
}
],
"source": {
"account_id": null,
"api_token_id": 987654321,
"api_token_name": "Subscription API token",
"account_email": null,
"origin": "api",
"user_type": null
},
"custom_attributes": [
{
"key": "ab_testing_flag",
"value": "a"
}
]
}
]
}