Admin Resources
Events
This resource allows a caller to inspect recent events in the store.
6 additions in V2, marked New
Everything marked New also works when you send X-Recharge-Version: 2021-11.
#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. Returned inYYYY-MM-DDTHH:MM:SSformat by default; stores that have been moved to timezone-aware event timestamps receive an ISO 8601 value with a UTC offset. - 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_attributesarray of objectsA 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_idintegerIf 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'Possible values
apicustomer_portalexternal_platformmerchant_portalrecharge_process - user_typestringThe type of user who initiated the event, e.g. 'customer', 'store_admin', 'recharge_admin', 'recharge_process'Possible values
customercustomer_smsrecharge_adminrecharge_admin_smsrecharge_order_mergerecharge_processstore_adminstore_admin_smssupport_session
- custom_attributesarray of objectsA 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
If
read_events scope to a token will expose some details about other Recharge API resources via the Events API.If
created_at_min is not passed (and no cursor is used) it defaults to 7 days ago. A created_at_min older than the store's lookback window (7 days by default) returns 422. The response includes next_cursor and previous_cursor.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.Possible valuesaddressaddress/payment_methodaddress_payment_methodappasync_batchbundle_productbundle_selectioncancellation_flowchargecheckoutcollectioncollection_productcredit_accountcredit_adjustmentcustomerdelivery_profilediscountemailfraud_investigationmembershipmembership_programmembership_program_conditionmonthly_sku_swap_workflow_adapteronetimeorderpayment_methodplanproductpurchase_itemsequence_workflow_adaptershipping_window_workflow_adaptershopstoresubscriptionthemewebhookwidget_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.Possible valuesapicustomer_portalexternal_platformmerchant_portalrecharge_process - Show events with a specific
verb.Possible valuesactivatedapply_discountcancelledcapturedchange_next_charge_datecompletedcreate_contractcreateddeactivateddelayeddeletedexpiredfailedloginmax_retries_reachednotification_activatednotification_deactivatedpaidpausedpayment_capturedpayment_method_updatedprocessedredeemedrefundrefundedremove_discountselling_plans_syncingset_next_charge_dateskippedstartedsuccessswappeduninstalledunskippedupdatedworkflow_updated - Sort order of the results. Defaults to
id-descwhen filtering bycustomer_idand tocreated_at-descotherwise.Possible valuesid-ascid-desccreated_at-asccreated_at-desc - When
true,customerevents with the verbupdatedthat have noupdated_attributesare left out of the results. - Number of results to return. Defaults to 50; the maximum is 250.
- Page to show. Cannot be greater than 300. Page-based pagination can be disabled for a token, in which case cursors must be used.
- Return either the next or previous page of events using the
next_cursororprevious_cursorvalue from a previous response. Whencursoris passed, onlylimitmay be passed with it.
curl 'https://api.rechargeapps.com/events?limit=3' \
-H 'X-Recharge-Version: v2' \
-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"
}
]
}
]
}