-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Description of the Bug
Interfaces are mixing attributes from Product Catalog 1.0 and 2.0.
For example, in the case of the Subscription interface:
- plan_id is declared as required (non-undefined) but only present in Product Catalog 1.0
- plan_quantity is declared as required (non-undefined) but only present in Product Catalog 1.0
- item_tiers is declared as optional but only present in Product Catalog 2.0
...and so on.
The lack of clear separation makes it harder to implement webhook-based integration, as it's impossible to identify which attribute comes from which version without checking each one separately against the official documentation. Despite interfaces mixing attributes from both versions, WebhookEvent only includes the events from Proudct Catalog 2.0 (e.g. there are no events with content that has a plan property).
Steps to reproduce
Import some interface, e.g. Subscription.
Start writing a class for internal storage that implements the interface.
Notice discrepancies.
Expected Behavior
Have separate interfaces for Product Catalog 1.0 and 2.0, ensuring they match the official documentation. It would make writing integrations less painful.
Code Snippets (if applicable)
Operating System
macOS
Language version
Node 22.20.0
Library version
3.14.0
Additional context
| export interface Subscription { |
https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=2#subscription_attributes
https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=1#subscription_attributes