Skip to main content

Get subscription events

Endpoint for getting Subscription Events.

info

Please be aware that this endpoint requires a Manage Transactions API Key.

GET /api/v1/groups/{group_id}/revere_pay/{linked_account_id}/recurring/subscription/{subscription_id}/events

Query Parameters

NameDescriptionType
limitOptional parameter to limit the number of results in the queryuint64
offsetThe number of items to skip before starting to collect the result set.uint64

Response Fields

NameDescriptionType
idUnique identifier of the event.string
event_typeType of the subscription event. See Event Types below.string
initiated_byWho or what initiated the event. Possible values: merchant, end_user, plan, customer, recurring_system.string
user_idID of the user who initiated the event, when applicable.string
user_nameName of the user who initiated the event, when applicable.string
changesThe subscription fields that changed, each with their old and new value.object
detailsAdditional details about the event, depending on its type.object
created_atTimestamp of when the event was recorded.string

Event Types

ValueDescription
createdRecorded when the subscription has been created.
updatedRecorded when the subscription has been updated.
chargedRecorded when the subscription has been successfully charged.
charge_failedRecorded when a subscription charge attempt has failed.
completedRecorded when the subscription has completed after its duration is exhausted.
declinedRecorded when the subscription has been declined after exceeding the maximum retry count.
canceledRecorded when the subscription has been canceled.
cancel_scheduledRecorded when the subscription has been scheduled to cancel at the next bill date.
pausedRecorded when the subscription has been paused.
resumedRecorded when the subscription has been resumed after having been paused.
deletedRecorded when the subscription has been deleted.
proration_createdRecorded when a proration event has been created for the subscription.
plan_propagatedRecorded when subscription changes have been propagated from the plan.
notification_sentRecorded when a subscription notification has been sent.
notification_failedRecorded when a subscription notification failed to send.

Details Fields

The details object's fields depend on the event's event_type. It is omitted entirely for event types not listed below (created, updated, canceled, paused, resumed, deleted, completed, declined, plan_propagated).

FieldDescriptionPopulated for
amountThe monetary amount associated with the event, in cents.charged, proration_created, charge_failed
currencyThe currency of amount.charged, proration_created, charge_failed
amount_kindThe kind of amount charged (standard, initial, proration, or trial).charged, proration_created, charge_failed
base_amountThe base amount before any proration adjustment.charged
prorate_amountThe proration adjustment amount included in the charge.charged, proration_created, charge_failed
transaction_idID of the transaction related to the event.charged, proration_created (when the immediate proration charge succeeds), charge_failed
proration_event_idID of the related proration event.proration_created, charge_failed (when caused by a proration charge)
proration_triggerWhat triggered the proration (amount_change, plan_change, resume, cancel, plan_propagation).proration_created, charge_failed (when caused by a proration charge)
proration_behaviorThe proration behavior applied (create_prorations, immediate_action).proration_created, charge_failed (when caused by a proration charge)
credit_amountThe credit portion of the proration adjustment.proration_created, charge_failed (when caused by a proration charge)
charge_amountThe charge portion of the proration adjustment.proration_created, charge_failed (when caused by a proration charge)
days_remainingDays remaining in the billing period when the proration was calculated.proration_created, charge_failed (when caused by a proration charge)
days_in_periodTotal days in the billing period used for the proration calculation.proration_created, charge_failed (when caused by a proration charge)
error_messageThe error returned by the failed charge attempt, or the failed notification send.charge_failed, notification_failed
attemptThe current retry attempt number for the charge.charge_failed (except when caused by a proration charge)
max_retry_countThe maximum number of charge retry attempts allowed.charge_failed (except when caused by a proration charge)
cancel_at_dateThe date the subscription is scheduled to cancel.cancel_scheduled
notification_typeThe type of notification sent.notification_sent, notification_failed
notification_channelThe channel the notification was sent through.notification_sent, notification_failed
notification_recipient_emailThe recipient email address of the notification.notification_sent, notification_failed
error_reasonThe reason the notification failed to send.notification_failed

Response

CodeDescription
200Success
400Bad Request
500Internal Error

Example Usage

plans.js
var headers = new Headers();
headers.append('Authorization', 'API_KEY');

var requestOptions = {
method: 'GET',
headers: headers,
redirect: 'follow'
};
const group_id = '';
const linked_account_id = '';
const subscription_id = '';
const url = `https://api.reverepayments.dev/api/v1/groups/${group_id}/revere_pay/${linked_account_id}/recurring/subscription/${subscription_id}/events?limit=10&offset=0`;
fetch(url, requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));

Example Success Response

{
"data": {
"items": [
{
"id": "0f1c5e64-6b41-4a35-9a4e-2f5f0b7d1a90",
"event_type": "declined",
"initiated_by": "recurring_system",
"changes": {
"status": {
"old": "declining",
"new": "declined"
}
},
"created_at": "2024-04-18T00:00:00Z"
},
{
"id": "b2a4e6c8-1f7d-4c3e-9a5b-6d8e2f1c4a90",
"event_type": "proration_created",
"initiated_by": "merchant",
"details": {
"amount": 5714,
"currency": "USD",
"amount_kind": "proration",
"prorate_amount": 5714,
"proration_event_id": "0f1c5e64-6b41-4a35-9a4e-2f5f0b7d1a90",
"proration_trigger": "amount_change",
"proration_behavior": "create_prorations",
"credit_amount": 11429,
"charge_amount": 17143,
"days_remaining": 4,
"days_in_period": 7
},
"created_at": "2024-04-14T09:12:44.512331Z"
},
{
"id": "8c2f0d51-7b13-4a2e-9f60-1d4c8b7a5e39",
"event_type": "completed",
"initiated_by": "recurring_system",
"changes": {
"status": {
"old": "active",
"new": "completed"
}
},
"created_at": "2024-04-11T00:00:00Z"
}
],
"total_count": 3
}
}