Advanced Billing Events include various activity that happens around a Site. This information is especially useful to track down issues that arise when subscriptions are not created due to errors.
Within the Advanced Billing UI, "Events" are referred to as "Site Activity". Full documentation on how to record view Events / Site Activty in the Advanced Billing UI can be located here.
This method will retrieve a list of events for a site. Use query string filters to narrow down results. You may use the key
filter as part of your query string to narrow down results.
The following keys are no longer supported.
payment_failure_recreated
payment_success_recreated
renewal_failure_recreated
renewal_success_recreated
zferral_revenue_post_failure
- (Specific to the deprecated Zferral integration)zferral_revenue_post_success
- (Specific to the deprecated Zferral integration)The event type is identified by the key property. You can check supported keys here.
Different event types may include additional data in event_specific_data
property.
While some events share the same schema for event_specific_data
, others may not include it at all.
For precise mappings from key to event_specific_data, refer to Event.
Here’s an example event for the subscription_product_change
event:
{
"event": {
"id": 351,
"key": "subscription_product_change",
"message": "Product changed on Marky Mark's subscription from 'Basic' to 'Pro'",
"subscription_id": 205,
"event_specific_data": {
"new_product_id": 3,
"previous_product_id": 2
},
"created_at": "2012-01-30T10:43:31-05:00"
}
}
Here’s an example event for the subscription_state_change
event:
{
"event": {
"id": 353,
"key": "subscription_state_change",
"message": "State changed on Marky Mark's subscription to Pro from trialing to active",
"subscription_id": 205,
"event_specific_data": {
"new_subscription_state": "active",
"previous_subscription_state": "trialing"
},
"created_at": "2012-01-30T10:43:33-05:00"
}
}
GET /events.json
This endpoint requires BasicAuth
OK
[
{
"event": {
"id": 343087780,
"key": "subscription_state_change",
"message": "State changed on Test subscription to Monthly Product from active to past_due",
"subscription_id": 14950962,
"customer_id": 12345678,
"created_at": "2016-10-27T16:42:22-04:00",
"event_specific_data": {
"previous_subscription_state": "active",
"new_subscription_state": "past_due"
}
}
},
{
"event": {
"id": 343087742,
"key": "billing_date_change",
"message": "Billing date changed on Test's subscription to Monthly Product from 11/27/2016 to 10/27/2016",
"subscription_id": 14950962,
"customer_id": 12345678,
"created_at": "2016-10-27T16:42:19-04:00",
"event_specific_data": null
}
},
{
"event": {
"id": 343085267,
"key": "statement_closed",
"message": "Statement 79401838 closed (but not settled) for Test's subscription to ANNUAL product",
"subscription_id": 14950975,
"customer_id": 87654321,
"created_at": "2016-10-27T16:40:40-04:00",
"event_specific_data": null
}
},
{
"event": {
"id": 4481,
"key": "custom_field_value_change",
"message": "Custom field (Extra support included) changed for Subscription 117 from 'Yes' to 'No'.",
"subscription_id": 117,
"customer_id": 22334455,
"created_at": "2022-03-24T07:55:06-04:00",
"event_specific_data": {
"event_type": "updated",
"metafield_name": "Extra support included",
"metafield_id": 2,
"old_value": "Yes",
"new_value": "No",
"resource_type": "Subscription",
"resource_id": 117
}
}
}
]
curl -X GET -G \
--url 'https://subdomain.chargify.com/events.json' \
-H 'Accept: application/json' \
-d 'page=2' \
-d 'per_page=50' \
-d 'direction=desc' \
-d 'filter=custom_field_value_change%2Cpayment_success' \
-d 'date_field=created_at'