App reviews, troubleshooting, and recommendations
I want to charge for usage charge after a recurring charge has been applied.
when i make call to usage charge query. am getting
error : Subscription does not accept usage charges.
this is my script
const usageCharge = async (admin: any, billing: any) => { const { appSubscriptions } = await billing.check({ plans: [MONTHLY_PLAN], isTest: true, }); const subscriptionLineItemId =appSubscriptions[0].lineItems[0].id; const response = await admin.graphql( `#graphql mutation appUsageRecordCreate($description: String!, $price: MoneyInput!, $subscriptionLineItemId: ID!) { appUsageRecordCreate(description: $description, price: $price, subscriptionLineItemId: $subscriptionLineItemId) { userErrors { field message } appUsageRecord { id } } }`, { variables: { subscriptionLineItemId: subscriptionLineItemId, price: { amount: 0.10, currencyCode: "USD", }, description: "Per search fee", }, } ); const data = await response.json(); console.log("data", data.data.appUsageRecordCreate.userErrors); return data; }; export default usageCharge;
please help, i don't get what am doing wrong.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024