How can I create two subscriptions using appSubscriptionCreate

I am wondering how I can create multiple subscriptions that a merchant can subscribe to. I get back the error:

"lineItems","message":"Cannot have more than one plan with the same pricing details"

which i assume means i can only have 1 appRecurringPricingDetails object per lineItems array. But how would i go about allowing a Merchant that adds my app to have a subscription billed monthly for $100 and another add on subscription billed yearly at $500?

Here is my mutation:

mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL! ){     appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {userErrors {field message} appSubscription {id}  confirmationUrl} }",
  "variables": {
    "name": "Professional",
    "returnUrl": "http://super-duper.shopifyapps.com/",
    "lineItems": [
      {
        "plan": {
          "appRecurringPricingDetails": {
            "price": {
              "amount": 100,
              "currencyCode": "USD"
            },
            "interval": "EVERY_30_DAYS"
          }
        }
      },
      {
        "plan": {
          "appRecurringPricingDetails": {
            "price": {
              "amount": 500,
              "currencyCode": "USD"
            },
            "interval": "ANNUAL"
          }
        }
      }
    ]
  }
2 Likes