chargebee-node icon indicating copy to clipboard operation
chargebee-node copied to clipboard

Interfaces are mixing attributes from Product Catalog 1.0 and 2.0

Open AndKiel opened this issue 3 months ago • 0 comments

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

https://github.com/chargebee/chargebee-node/blob/5d368515075c13c74a62575d3d3a8f02810f8dc8/types/resources/Subscription.d.ts#L5

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

AndKiel avatar Oct 24 '25 07:10 AndKiel