Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to handle free plan for an app

How to handle free plan for an app

linkadoo
Visitor
1 0 2

Hi,

Currently I'm developing a Shopify app with two plans: Free Plan and a paid plan. 

The default plan will be free and there will be various limitations for the free plan. Therefore I need to keep track of the subscription start and end dates (in order to calculate the actions taken by the merchant between those dates). I am trying to create a free subscription plan with the following graphQL mutation.

 

 

const variables =
    {
        "lineItems": {
            "plan": {
                "appRecurringPricingDetails": {
                    "price": {
                        "amount": "0",
                        "currencyCode": "USD"
                    },
                    "interval": "EVERY_30_DAYS"
                },
            }
        },
        "name": "Free Subscription Plan",
        "returnUrl": "myreturnURL",
        "test": true,
    }

    const query = `
        mutation appSubscriptionCreate($lineItems: [AppSubscriptionLineItemInput!]!, $name: String!, $returnUrl: URL!, $test: Boolean) {
            appSubscriptionCreate(lineItems: $lineItems, name: $name, returnUrl: $returnUrl, test: $test) {
              userErrors {
                field
                message
              }
              appSubscription {
                createdAt
                id
                name
                lineItems{
                    id
                    plan{
                        pricingDetails
                    }
                }
                returnUrl
                status
                currentPeriodEnd
              }
              confirmationUrl
            }
          }
        `

 

 

Yet I get the following response. 

"message": "Validation failed: Price must be greater than zero"
 
My question is: How can I create a free subscription so that I can track user activity between the start and end dates of each subscription period.
banned
Reply 1 (1)

LucasMRC
Shopify Partner
3 0 1

Having the same problem here. Could you find any solutions?