This requires an input parameter subscriptionLineItemId, how do I get this subscription line item ID from knowing the recurring application charge id that I got via the REST API. Generally when creating a usage charge the charge id was all I needed in order to create an app usage charge.
Could someone help me out on how to migrate from the current charge id to subscriptionlineitemid?
Hi @Gary_Gilbert in GraphQL, recurring application charges have effectively been replaced by AppSubscription objects and their line items. When you create usage records (the equivalent of usage charges in REST) via GraphQL, you now need the specific subscriptionLineItemId that corresponds to the usage-based line item on that AppSubscription.
How to migrate:
Locate the GraphQL AppSubscription that corresponds to your existing REST recurring charge. You can use legacyResourceId in a GraphQL query, matching the old recurring_application_charge_id.
Find the usage-based line item inside that subscription. Query the subscription’s lineItems and look at their pricing details to identify which one is a usage/metered line.
Call appUsageRecordCreate with the line item’s ID (subscriptionLineItemId) instead of your old recurring_application_charge_id.
Just let me know if you need more info on any of the steps.
Thanks for the migration guide! I started digging into to the Appsubscription a bit to figure it out on my own, but also at the same time was absolutely sure that someone (like you) would already know this and be willing to give me a leg up.
It does seem to me to be quite a bit more complicated than it really needs to be, but that seems to be the theme now with a lot of the graphql “replacements”. What once used to be accomplished with a single api call now requires multiple.
Ce la vie, complaining about it won’t get it done
Oh just as an FYI: The dev assistant (AI) replied with the following graphql query. Total late adopter here, I really need to ask it first then here when I dont get any farther.
query GetAppSubscriptionLineItems {
currentAppInstallation {
activeSubscriptions {
id
lineItems {
id
plan {
pricingDetails {
__typename
}
}
}
}
}
}