chargebee / chargebee-typescript

Typescript library for the Chargebee API.
https://apidocs.chargebee.com/docs/api?lang=typescript
MIT License
23 stars 16 forks source link

Feature has item_entitlements in item_entitlements_updated webhook event. #46

Closed Schpjer closed 6 months ago

Schpjer commented 11 months ago

When you receive the item_entitlements_updated event payload the feature objects includes a list of item_entitlements. But in the feature interface or the fetch feature endpoints this does not seem to be included. Is this expected?

Schpjer commented 11 months ago

I guess the question is if should be added as a optional property to the feature object?

cb-alish commented 6 months ago

Hi @Schpjer, I’m sorry for the delay in response. We currently don’t have item_entitlements as part of the Retrieve a feature API call and you’d have to call List entitlements API with the feature_id parameter to get the list of item entitlements for a given feature. Please find below the code sample for the same:

const response = await chargebeeInstance
        .entitlement
        .list({feature_id: "feature-id"})
        .request();
console.log(response.list[0].entitlement);

Please let us know if you encounter any issues with this.

cb-alish commented 6 months ago

Hi @Schpjer, can you please confirm if this works?