Development discussions around Shopify APIs
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
I'm using Partner API for internal reporting. When creating a usage charge, Shopify's Rest API url endpoint requires a recurring_application_charge_id, however, when fetching the same usage charge record via the GraphQL Api, I don't see any way to fetch the associated recurring application charge id in UsageChargeApplied GraphQL API query.
Is there any workaround this? I need to be able to link the usage charge to the recurring subscription.
Hello,
When you create the recurring application charge you are getting the Charge ID as a response. At least I am doing it like that. query is the appsubscriptionCreate mutation
For creating usageCharge you will need the appUsageChargeId which is also there in the response.
const response = await client.query({
data: query,
});
const {
confirmationUrl,
appSubscription: {lineItems},
appSubscription: {id},
} = response.body.data.appSubscriptionCreate;
const appUsageChargeId = lineItems[0].id;
const chargeID = id.split("/")[4];
User | RANK |
---|---|
5 | |
5 | |
5 | |
4 | |
4 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022