Shopify APP Billing with GraphQL - Trying to change the price using appSubscriptionLineItemUpdate

suu
New Member
1 0 0

Hello
I am trying to create billing for my app using Admin API with GraphQL. I created a subscription using the mutation appSubscriptionCreate. I want to update the pricing for this subscription. I tried using appSubscriptionLineItemUpdate mutation with the appSubscription Id- this gave me an invalid Id response. 

Below are the mutations I am using. Can you help me see what I am missing or doing wrong. 

Thanks.

 

 

 

mutation {
      appSubscriptionCreate(
        name: "Super Duper Plan"
        returnUrl: "${returnUrl}"
        test: true
        lineItems: [
          {
            plan: {
              appUsagePricingDetails: {
                cappedAmount: { amount: 10, currencyCode: USD }
                terms: "$1 for 1000 emails"
              }
            }
          }
          {
            plan: {
              appRecurringPricingDetails: {
                price: { amount: 10, currencyCode: USD }
              }
            }
          }
        ]
      )
      {
        userErrors {
          field
          message
        }
        confirmationUrl
        appSubscription {
          id
        }
      }
    }
 
mutation appSubscriptionLineItemUpdate($id: ID!, $cappedAmount: MoneyInput!) {
    appSubscriptionLineItemUpdate(id: $id, cappedAmount: $cappedAmount) {
        appSubscription {
            id
            cappedAmount{
              amount
              currencyCode
            }
        }
        confirmationUrl
      userErrors {
        field
        message
      }
    }
  }

 

 

 

0 Likes
Incedo_test_sto
Shopify Partner
1 0 0

You should use the charge lineItem ID and not the charge ID.

ID: The ID for the app subscription line item to be updated.

Source: https://shopify.dev/docs/admin-api/graphql/reference/billing/appsubscriptionlineitemupdate?api%5Bver...

0 Likes