This article covers
What does 'invoice (optional)' mean listed underneath the resource for the event subscription_cancelled
What does optional mean under various webhook events
For a better integration between Chargebee and Merchant’s application, Chargebee provides configuring webhooks. A webhook is used to send out an event notification to your service. Webhooks monitor several events that are triggered in Chargebee and provide certain responses (mandatory & optional)
If we look at Subscription Canceled Event, invoices, credit_notes, and unbilled charges are marked as optional. This means that an invoice object may not be a part of the subscription_cancelled event and will be an optional parameter in response. For example, if you cancel a subscription at the end of the term & say the invoices are paid and there are no prorated charges issued at cancellation, the event response once the subscription is canceled will not have the invoice & credit note object's data but will have subscription & customer object with the respective details.