Subscription events
PaymentsAI dispatches subscription events whenever a subscription changes state. Use these events to update customer access, send notifications, and react to plan changes without polling the API.
All event names use hyphens (for example, subscription-activated, not subscription.activated).
Events
| Event type | When it fires |
|---|---|
subscription-activated | The subscription moved to active. The first payment succeeded. |
subscription-canceled | The subscription was canceled (immediately or scheduled for the end of the current period). |
subscription-churned | The subscription reached the end of its grace period after failed renewals and was permanently ended. |
subscription-downgraded | The subscription was moved to a lower-priced plan. See Upgrade and downgrade. |
subscription-modified | The subscription was modified (changes other than a plan upgrade or downgrade). |
subscription-reactivated | A scheduled cancellation was reversed and the subscription continues. See Subscription reactivation. |
subscription-renewed | A billing cycle completed and the renewal charge succeeded. |
subscription-upgraded | The subscription was moved to a higher-priced plan. See Upgrade and downgrade. |
subscription-items-changed | The line items on the subscription changed. |
subscription-trial-changed | The trial configuration on the subscription was updated. |
subscription-trial-ended | The trial period ended. |
subscription-trial-end-reminder | Dispatched ahead of trial end. See the dedicated reference page. |
subscription-renewal-reminder | Dispatched 7 days before a scheduled renewal. See the dedicated reference page. |
Spelling note:
subscription-canceleduses American single-L spelling. This matches the API enum.
Payload
All subscription events share the same payload shape:
type Event = {
deduplicationId: string;
type: string;
organizationId: string;
metadata: Subscription;
};
See Schemas for the full Subscription type definition.
Typical sequence: first subscription with inactive instrument
- Subscription is created in
pending. - Customer is redirected to the hosted payment form and completes the first payment.
offsite-payment-completedfires when the customer finishes the hosted-form step. See Order and payment events.transaction-processedfires for the first payment. See Transaction events.subscription-activatedfires when the subscription moves toactive.
For a subscription created against an already-active payment instrument, transaction-processed and subscription-activated follow creation without an intermediate hosted-form step.
Typical sequence: failed renewal and recovery
- Scheduled renewal charge fails →
transaction-declined. - Dunning retries fire further
transaction-declinedevents on each failed attempt. - Either the renewal eventually succeeds (
transaction-processed→subscription-renewed), or retries are exhausted →subscription-canceledorsubscription-churned.
See Dunning and retries for the full retry schedule.