appusageRecordCreate mutation issue

Highlighted
Shopify Partner
15 0 1

I'm trying the "appusageRecordCreate" mutation to accomplish our dynamic app pricing. While doing this, I'm facing a strange error that says:

 

[ { field: [ 'subscriptionLineItemId' ], message: 'Invalid id' } ]

 

This is the mutation query I'm using:

 

`mutation {
  appUsageRecordCreate(
    subscriptionLineItemId: "gid://shopify/AppSubscriptionLineItem/14869987468?v=1&index=0",
    price: { amount: 99, currencyCode: USD }
    description: "test...")

    {
    appUsageRecord {
      id
    }
    userErrors {
      field
      message
    }
  }
}

Thanks!

Wil

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1040 139 165

Hey @Wil!

 

I was able to get this working on my end. Has the charge been activated? Is it a test charge by chance? Do you have a request ID handy?

0 Likes
Highlighted
Shopify Partner
15 0 1

Hey Scott, I was able to make it work using REST API. Shopify GraphQL documentation is poor.

 

Cheers,

Wil

1 Like