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.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025