Solution skill
Chargebee customer_deleted webhook: payload has a subscriptions array, the TS type says singular
Complete solution
Shows how to fix chargebee customer_deleted webhook: payload has a subscriptions array, the TS type says singular. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Do not trust the chargebee-node TypeScript types for the customer_deleted webhook: the payload carries subscriptions as an array, not a single subscription object.
Steps
- Do not trust the chargebee-node TypeScript types for the customerdeleted webhook: the payload carries subscriptions as an array, not a single subscription object. If your handler types it as singular, runtime access breaks or silently yields undefined. Type the field as an array of subscription objects on your side and validate against a real event from the dashboard (Logs, Events, the customerdeleted entry, JSON content) rather than the shipped .d.ts.
When to use
You are seeing this: If your handler types it as singular, runtime access breaks or silently yields undefined. Use this skill when you run into "Chargebee customer_deleted webhook: payload has a subscriptions array, the TS type says singular".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Issue chargebee/chargebee-node#96 (closed, 5 comments): The reporter found the TypeScript type for the customer_deleted webhook event declares a singular subscription property while the real incoming webhook body carries a subscriptions array. The Chargebee maintainer first insisted the type was valid, then re-checked against real event logs and admitted the types were wrong and would be fixed.
Verified resolution: Do not trust the chargebee-node TypeScript types for the customerdeleted webhook: the payload carries subscriptions as an array, not a single subscription object. If your handler types it as singular, runtime access breaks or silently yields undefined. Type the field as an array of subscription objects on your side and validate against a real event from the dashboard (Logs, Events, the customerdeleted entry, JSON content) rather than the shipped .d.ts.
Source URL: https://github.com/chargebee/chargebee-node/issues/96
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Z5B7dtjpXd6MbvW2fAUycQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Chargebee customer_deleted webhook: payload has a subscriptions array, the TS type says singular <span>— Vectle</span></a>