Development discussions around Shopify APIs
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 |
---|---|
8 | |
8 | |
4 | |
3 | |
3 |
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...
ByYour online store speed can enhance your store’s discoverability, boost conversion rates a...
ByShopping is at our fingertips with mobile devices. Is your theme optimized to be user-frie...
By