Processing Webhooks
Configure Apple or Google server-side notifications so that subscriptions created using process purchase command API are kept up-to-date using information received via the webhooks. Generate a notifications URL using these links - Apple and Google and configure it in their respective stores.
App Store notifications with use case
The following table lists the notification types from App Store and describes how Chargebee responds to each of them.
Note:
App Store Server Notifications V2
| Notification type | Subtype | Chargebee's response |
|
| Indicates that the App Store server sends when you request it by calling the Request a Test Notification endpoint. Call that endpoint to test if your server is receiving notifications. You receive this notification only at your request. Chargebee tests if a notification is received or not. No webhook gets triggered. |
|
| Indicates that the user purchased the subscription for the first time or that the user received access to the subscription through Family Sharing for the first time. Chargebee does not take action as the initial purchase is recorded using Process Purchase Command API. However you can view these events in the "Sync events" page, if the subscription is present in the app store but wasn't created in Chargebee due to network failures. These events can be filtered by selecting "Pending" status in the Sync events page and then can be synced to Chargebee by invoking Process Purchase Command API for the associated receipt. |
| Indicates that the user resubscribed or received access through Family Sharing to the same subscription or to another subscription within the same subscription group. Chargebee webhooks triggered: subscription_reactivated, subscription_reactivated_with_backdating, payment_succeeded, and invoice_updated. | |
|
| Indicates that the App Store extended the subscription renewal date that the developer requested. Learn more about Extend a Subscription Renewal Date. Chargebee can extend the current term end date based on the requested date. Chargebee webhooks triggered: |
|
| Indicates that the App Store declined a refund request initiated by the app developer. The event will be recorded in the Sync events table if the refund request is declined. Chargebee will not take any action or trigger any webhook. |
|
| Indicates that App Store successfully completed refund(Revocation Date and Revocation Reason will hold the date and reason for refund). Chargebee webhooks triggered: subscription_changed, credit_note_created, credit_note_updated, subscription_cancelled, and payment_refunded. |
|
| Indicates that the billing grace period has ended without renewing the subscription, so you can turn off access to service or content. The App Store continues to retry billing for 60 days, or until the user resolves their billing issue or cancels their subscription, whichever comes first. Chargebee webhooks triggered: subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled |
|
| Indicates that the subscription expired because the subscription failed to renew before the billing retry period ended. Chargebee webhooks triggered: |
| Indicates that the subscription expired after the user disabled subscription auto-renewal. Chargebee webhooks triggered: | |
| Indicates that the subscription expired because the user didn't consent to a price increase. Chargebee webhooks triggered: | |
| Indicates that the subscription expired because the product wasn't available for purchase at the time the subscription attempted to renew. Chargebee webhooks triggered: | |
| Indicates that the subscription expired for some other reason. Chargebee webhooks triggered: | |
|
| Indicates that the active subscription has successfully auto-renewed for a new transaction period. Provide the customer with access to the subscription's content or service. Chargebee webhooks triggered: subscription_renewed, subscription_changed, invoice_generated, payment_succeeded, and invoice_updated |
| Indicates that the expired subscription which previously failed to renew now successfully renewed. Chargebee webhooks triggered if the subscription is active: subscription_renewed, subscription_changed, invoice_generated, payment_succeeded, and invoice_updated Chargebee webhooks triggered if the subscription is canceled: subscription_reactivated, subscription_reactivated_with_backdating, payment_succeeded, and invoice_updated
| |
|
| Indicates that the subscription failed to renew due to a billing issue; continue to provide access to the subscription during the grace period. Chargebee webhooks triggered: subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder |
| Indicates that the grace period for subscription renewal is over and the service is stopped. Chargebee webhooks triggered: | |
|
| Indicates that the user enabled subscription auto-renewal. Chargebee webhooks triggered: subscription_reactivated, subscription_reactivated_with_backdating, payment_succeeded, and invoice_updated |
| Indicates that the user disabled subscription auto-renewal, or the App Store disabled subscription auto-renewal after the user requested a refund. Chargebee webhooks triggered: subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled | |
|
| Indicates that the user upgraded their subscription. Upgrades take effect immediately. Chargebee webhooks triggered: subscription_changed, invoice_generated, payment_succeeded, and invoice_updated |
| Indicates that the user downgraded their subscription. Downgrades take effect at the next renewal. In Chargebee cancellation will be scheduled at the end of the term. Chargebee webhooks triggered: | |
| Indicates that the user canceled the downgrade which is scheduled. Chargebee webhooks triggered: | |
|
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. |
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. | |
|
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. |
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. | |
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. | |
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. | |
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. | |
|
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. |
|
| Chargebee does not support this notification. Therefore, this notification is not recorded in Chargebee. |
App Store Server Notifications V1
| Notification type | Chargebee's response |
| This notification triggers when a subscription is active or the customer is upgraded to another SKU (stock-keeping unit). Chargebee checks relevant details in the receipt to detect an upgrade event. Once an upgrade event is detected, you can update the subscription with the new product details, and allow the update to take effect immediately. Chargebee webhooks triggered For subscription cancellation, whether immediately or at the end of the term. subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled. For subscription upgrade with proration. subscription_changed, invoice_generated, payment_succeeded, and invoice_updated. For subscription reactivation. subscription_reactivated, subscription_reactivated_with_backdating, payment_succeeded, and invoice_updated. For regular subscription renewal. subscription_renewed, subscription_changed, invoice_generated, payment_succeeded, and invoice_updated. |
| This notification triggers when a subscription is active or the customer is downgraded to another SKU(stock-keeping unit). It indicates that the customer made a change in their subscription plan that takes effect at the next renewal. The currently active plan is not affected. Chargebee schedule downgrades to take effect at the end of the period. At the end of the billing period, confirm the downgrade at Apple's end before downgrading it in the Chargebee. Chargebee webhooks triggered For subscription upgrade with proration. subscription_changed, invoice_generated, payment_succeeded, and invoice_updated. |
| This notification triggers when a subscription is expired or the customer resubscribes to the same SKU(stock-keeping unit). Chargebee re-activates subscription immediately. Chargebee webhooks triggered For subscription cancellation. subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled. For subscription upgrade with proration. subscription_changed, invoice_generated, payment_succeeded, and invoice_updated. |
| This notification triggers when a subscription is expired or the customer resubscribed to another SKU (upgrade or downgrade). Chargebee immediately re-activates the subscription with the new product(plan or item). Chargebee webhooks triggered For subscription upgrade with proration. subscription_changed, invoice_generated, payment_succeeded, and invoice_updated. For subscription cancellation, whether immediately or at the end of the term. subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled. |
DID_CHANGE_RENEWAL_STATUS | This notification triggers when the customer canceled the subscription from the App
Store Subscriptions settings page. Their subscription will not auto-renew and will expire on the
Chargebee sets subscription to cancel at
Chargebee webhooks triggered For subscription cancellation, whether immediately or at the end of the term. subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled. |
| This notification triggers when the customer previously canceled the subscription but
now resubscribed to the same product before the subscription expired. The subscription will
auto-renew on the Chargebee removes scheduled cancellation of subscription and allows it to auto-renew. If the dates have changed for the term start and end, change the same in the Chargebee subscription. Chargebee webhooks triggeredFor subscription reactivation. subscription_reactivated, subscription_reactivated_with_backdating, payment_succeeded, and invoice_updated. |
| This notification triggers when AppleCare refunded a
subscription.
Chargebee cancels the subscription on For subscription cancellation, whether immediately or at the end of the term. subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled. |
| This notification triggers when the subscription failed to renew because of a billing
issue. It Indicates a subscription that failed to renew due to a billing issue. Check Chargebee takes the following actions.
For subscription cancellation, whether immediately or at the end of the term. subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled. |
| This notification triggers when expired subscription recovered by App Store through a
billing retry. It indicates a successful automatic renewal of an expired subscription that failed to
renew in the past. Check Chargebee webhooks triggered For regular subscription renewal. subscription_renewed, subscription_changed, invoice_generated, payment_succeeded, and invoice_updated. |
| This notification triggers when the subscription has churned after failed billing retry
attempts. It indicates a change in the subscription renewal status. In the JSON response, check
Chargebee webhooks triggered For subscription cancellation, whether immediately or at the end of the term. subscription_changed, subscription_cancellation_scheduled, subscription_cancellation_reminder, and subscription_cancelled. |
| This notification triggers when AppleCare successfully refunded the transaction for a
consumable, non-consumable, or non-renewing subscription. Here, the
Chargebee cancels the subscription on a specified date and records an
offline refund for the full amount as subscription_changed, credit_note_created, credit_note_updated, subscription_cancelled, and payment_refunded. |
| This notification triggers when the subscription price is increased, and the customer
must agree to the increase before the subscription auto-renews. It indicates that App Store has
started asking the customer to consent to your app's subscription price increase. In the unified_receipt.Pending_renewal_info object,
the |
| This notification triggers when a customer's subscription is successfully auto-renewed for a new transaction period. Chargebee renews the subscription if not already auto-renewed. Chargebee webhooks triggered For regular subscription renewal. subscription_renewed, subscription_changed, invoice_generated, payment_succeeded, and invoice_updated. |
| This notification triggers when a purchaser disabled Family Sharing for a product, the
purchaser (or family member) left the family group, or the purchaser asked for and received a
refund. Your app will also receive a |
| The customer initiated a refund request for a consumable in-app purchase. Chargebee does not support this notification. |
| Indicates that the user purchased the subscription for the first time or that the user received access to the subscription through Family Sharing for the first time. Chargebee does not take action as the initial purchase is recorded using Process Purchase Command API. However you can view these events in the "Sync events" page, if the subscription is present in the app store but wasn't created in Chargebee due to network failures. These events can be filtered by selecting "Pending" status in the Sync events page and then can be synced to Chargebee by invoking Process Purchase Command API for the associated receipt. |
Webhook events triggered for creating an Apple subscription
When an in-app subscription is created in Chargebee, the following webhook events get generated in
sequence.
- Creates a plan created or Item (
plan_createdoritem_created) - Creates a customer (
customer_created) - Creates a subscription (
subscription_created) - Updates a subscription (
subscription_changed) - Generates an invoice (
invoice_generated) - Successful payments (
payment_succeeded) - Updates an invoice (
invoice_updated)
Note
Webhooks are asynchronous by nature; therefore not recommended for time-critical applications. Webhooks may reach your application in a different order and become redundant. For time-critical applications, Chargebee recommends using the List events API to poll Chargebee for events.
Troubleshooting apple's webhook processing errors
Since Apple notifications do not provide any price information, processing a webhook fails in the following scenarios:
| Issue | Solution |
A new purchase ( | Always use the process purchase command API to record a new purchase. Chargebee requires the amount paid and the currency to create a subscription. |
A notification is received for an SKU (plan) change but the plan-item price is unavailable in Chargebee. | Create the plan-item price in Chargebee via API or admin console, then retry processing the webhook. |
Google Play Store notifications with use case
Chargebee acts upon certain notifications from Google. On receiving any of the notifications listed in the table below, Chargebee checks whether the subscription is present. If present, it carries out certain actions as described in the table. The webhooks triggered due to these actions are also listed here for convenience.
| Google notification | Chargebee's response |
SUBSCRIPTION_RECOVERED | When the subscription is in the paused state, Chargebee resumes the subscription or schedules it for resumption. Chargebee webhooks triggered For in-term resumption.
For out-of-term
resumption.
For scheduled
resumption.
|
| Chargebee updates the subscription with the next renewal date. After receiving this notification if the subscription is in the canceled state, Chargebee reactivates the subscription. Chargebee webhooks triggeredFor subscription reactivation.
For regular subscription renewal.
|
| Chargebee reactivates the canceled subscription. Chargebee webhooks triggered
|
| Chargebee extends the current subscription term. Chargebee webhooks triggered |
| Chargebee pauses the subscription and keeps it on hold. Chargebee webhooks triggered |
| If the subscription is not already paused, Chargebee pauses the subscription. Chargebee webhooks triggered |
| If the subscription is not already paused, Chargebee schedules the subscription pause on the pause_date. Chargebee webhooks triggered |
| Chargebee cancels the subscription immediately. Chargebee webhooks triggered |
SUBSCRIPTION_CANCELED | Chargebee cancels the subscription or schedules it for cancellation. Chargebee webhooks triggered For subscription cancellation, whether immediately or at the end of the term.
|
SUBSCRIPTION_EXPIRED | Chargebee cancels the subscription immediately. Chargebee webhooks triggered |
SUBSCRIPTION_PURCHASED | Indicates that the user purchased the subscription for the first time. Chargebee does not take action as the initial purchase is recorded using Process Purchase Command API. However, you can view these events in the "Sync events" page, if the subscription is present in the play store but wasn't created in Chargebee due to network failures. These events can be filtered by selecting "Pending" status in the Sync events page and then can be synced to Chargebee by invoking Process Purchase Command API for the associated receipt. |
SUBSCRIPTION_PRICE_CHANGE_CONFIRMED | Chargebee does not support this notification. |
SUBSCRIPTION_DEFERRED | Chargebee does not support this notification. |