app Subscription Createmutation
Allows an app to charge a store for features or services on a recurring basis.
Arguments
Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.
A descriptive name for the app subscription.
The replacement behavior when creating an app subscription for a merchant with an already existing app subscription.
The URL pointing to the page where the merchant is redirected after approving the app subscription.
Whether the app subscription is a test transaction.
Anchor to trialDaystrialDaysThe number of days of the free trial period, beginning on the day that the merchant approves the app charges.
AppSubscriptionCreatePayload returns
The newly-created app subscription.
Anchor to AppSubscriptionCreatePayload.confirmationUrlconfirmationUrl The URL pointing to the page where the merchant approves or declines the charges for an app subscription.
The list of errors that occurred from executing the mutation.
Code examples for MUTATION: appSubscriptionCreate
Query Reference for MUTATION: appSubscriptionCreate
"mutation appSubscriptionCreate($lineItems: [AppSubscriptionLineItemInput!]!, $name: String!, $returnUrl: URL!) {\n appSubscriptionCreate(lineItems: $lineItems, name: $name, returnUrl: $returnUrl) {\n appSubscription {\n # AppSubscription fields\n }\n confirmationUrl\n userErrors {\n field\n message\n }\n }\n}"
Input Reference for MUTATION: appSubscriptionCreate
"{\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"discount\": {\n \"durationLimitInIntervals\": 1,\n \"value\": {\n \"amount\": \"29.99\",\n \"percentage\": 1.1\n }\n },\n \"interval\": \"ANNUAL\",\n \"price\": {\n \"amount\": \"29.99\",\n \"currencyCode\": \"AED\"\n }\n },\n \"appUsagePricingDetails\": {\n \"cappedAmount\": {\n \"amount\": \"29.99\",\n \"currencyCode\": \"AED\"\n },\n \"terms\": \"<your-terms>\"\n }\n }\n }\n ],\n \"name\": \"<your-name>\",\n \"replacementBehavior\": \"APPLY_IMMEDIATELY\",\n \"returnUrl\": \"https://example.myshopify.com\",\n \"test\": true,\n \"trialDays\": 1\n}"
Schema Reference for MUTATION: appSubscriptionCreate
"input AppSubscriptionLineItemInput {\n plan: AppPlanInput!\n}\n\ninput AppPlanInput {\n appRecurringPricingDetails: AppRecurringPricingInput\n appUsagePricingDetails: AppUsagePricingInput\n}\n"
Display Examples for MUTATION: appSubscriptionCreate
[ { "example": { "type_name": "appsubscriptioncreate", "title": "Create a subscription for an app on a recurring pricing plan only.", "query_string": "mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n}", "query_arguments": { "name": "$name", "returnUrl": "$returnUrl", "lineItems": "$lineItems" }, "variables": { "name": "Super Duper Recurring Plan", "returnUrl": "http://super-duper.shopifyapps.com/", "lineItems": [ { "plan": { "appRecurringPricingDetails": { "price": { "amount": 10, "currencyCode": "USD" }, "interval": "EVERY_30_DAYS" } } } ] }, "response": { "data": { "appSubscriptionCreate": { "userErrors": [], "appSubscription": { "id": "gid://shopify/AppSubscription/1029266950" }, "confirmationUrl": "https://billingshop.myshopify.com/admin/charges/166357/1029266950/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAZeWT06EmF1dG9fYWN0aXZhdGVU--353b847ab561a829e9db3d95f0ff5a23a4f690be" } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/billing/test/unit/graph_api/admin/mutations/app_subscription_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } appSubscription { id } confirmationUrl } }\",\n \"variables\": {\n \"name\": \"Super Duper Recurring Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }`,\n {\n variables: {\n \"name\": \"Super Duper Recurring Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }\nQUERY\n\nvariables = {\n \"name\": \"Super Duper Recurring Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>10.0, \"currencyCode\"=>\"USD\"}, \"interval\"=>\"EVERY_30_DAYS\"}}}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }`,\n \"variables\": {\n \"name\": \"Super Duper Recurring Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }\nQUERY;\n\n$variables = [\n \"name\" => \"Super Duper Recurring Plan\",\n \"returnUrl\" => \"http://super-duper.shopifyapps.com/\",\n \"lineItems\" => [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>10.0, \"currencyCode\"=>\"USD\"}, \"interval\"=>\"EVERY_30_DAYS\"}}}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "name", "description": "A descriptive name for the app subscription.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "String!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "name", "argValue": " \"Super Duper Recurring Plan\"", "typeKind": "MUTATION" }, { "arg": { "name": "returnUrl", "description": "The URL pointing to the page where the merchant is redirected after approving the app subscription.", "type": { "kind": "SCALAR", "name": "URL", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "URL!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "returnUrl", "argValue": " \"http://super-duper.shopifyapps.com/\"", "typeKind": "MUTATION" }, { "arg": { "name": "lineItems", "description": "Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.", "type": { "kind": "INPUT_OBJECT", "name": "AppSubscriptionLineItemInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[AppSubscriptionLineItemInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "lineItems", "argValue": " [{\"plan\":{\"appRecurringPricingDetails\":{\"price\":{\"amount\":10,\"currencyCode\":\"USD\"},\"interval\":\"EVERY_30_DAYS\"}}}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "appsubscriptioncreate", "title": "Create a subscription for an app on a usage pricing plan only.", "query_string": "mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails\n __typename\n }\n }\n }\n confirmationUrl\n }\n}", "query_arguments": { "name": "$name", "returnUrl": "$returnUrl", "lineItems": "$lineItems" }, "variables": { "name": "Super Duper Usage Plan", "returnUrl": "http://super-duper.shopifyapps.com/", "lineItems": [ { "plan": { "appUsagePricingDetails": { "terms": "$1 for 100 emails", "cappedAmount": { "amount": 20, "currencyCode": "USD" } } } } ] }, "response": { "data": { "appSubscriptionCreate": { "userErrors": [], "appSubscription": { "id": "gid://shopify/AppSubscription/1029266949", "lineItems": [ { "id": "gid://shopify/AppSubscriptionLineItem/1029266949?v=1&index=0", "plan": { "pricingDetails": {}, "__typename": "AppPlanV2" } } ] }, "confirmationUrl": "https://billingshop.myshopify.com/admin/charges/166357/1029266949/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAVeWT06EmF1dG9fYWN0aXZhdGVU--0f11019bf0fe7edcdb89347c432a14109c53f618" } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/billing/test/unit/graph_api/admin/mutations/app_subscription_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } appSubscription { id lineItems { id plan { pricingDetails __typename } } } confirmationUrl } }\",\n \"variables\": {\n \"name\": \"Super Duper Usage Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails\n __typename\n }\n }\n }\n confirmationUrl\n }\n }`,\n {\n variables: {\n \"name\": \"Super Duper Usage Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails\n __typename\n }\n }\n }\n confirmationUrl\n }\n }\nQUERY\n\nvariables = {\n \"name\": \"Super Duper Usage Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [{\"plan\"=>{\"appUsagePricingDetails\"=>{\"terms\"=>\"$1 for 100 emails\", \"cappedAmount\"=>{\"amount\"=>20.0, \"currencyCode\"=>\"USD\"}}}}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails\n __typename\n }\n }\n }\n confirmationUrl\n }\n }`,\n \"variables\": {\n \"name\": \"Super Duper Usage Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails\n __typename\n }\n }\n }\n confirmationUrl\n }\n }\nQUERY;\n\n$variables = [\n \"name\" => \"Super Duper Usage Plan\",\n \"returnUrl\" => \"http://super-duper.shopifyapps.com/\",\n \"lineItems\" => [{\"plan\"=>{\"appUsagePricingDetails\"=>{\"terms\"=>\"$1 for 100 emails\", \"cappedAmount\"=>{\"amount\"=>20.0, \"currencyCode\"=>\"USD\"}}}}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "name", "description": "A descriptive name for the app subscription.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "String!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "name", "argValue": " \"Super Duper Usage Plan\"", "typeKind": "MUTATION" }, { "arg": { "name": "returnUrl", "description": "The URL pointing to the page where the merchant is redirected after approving the app subscription.", "type": { "kind": "SCALAR", "name": "URL", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "URL!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "returnUrl", "argValue": " \"http://super-duper.shopifyapps.com/\"", "typeKind": "MUTATION" }, { "arg": { "name": "lineItems", "description": "Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.", "type": { "kind": "INPUT_OBJECT", "name": "AppSubscriptionLineItemInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[AppSubscriptionLineItemInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "lineItems", "argValue": " [{\"plan\":{\"appUsagePricingDetails\":{\"terms\":\"$1 for 100 emails\",\"cappedAmount\":{\"amount\":20,\"currencyCode\":\"USD\"}}}}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "appsubscriptioncreate", "title": "Create a subscription for an app on an annual recurring pricing plan.", "query_string": "mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n}", "query_arguments": { "name": "$name", "returnUrl": "$returnUrl", "lineItems": "$lineItems" }, "variables": { "name": "Super Duper Recurring Plan", "returnUrl": "http://super-duper.shopifyapps.com/", "lineItems": [ { "plan": { "appRecurringPricingDetails": { "price": { "amount": 10, "currencyCode": "USD" }, "interval": "ANNUAL" } } } ] }, "response": { "data": { "appSubscriptionCreate": { "userErrors": [], "appSubscription": { "id": "gid://shopify/AppSubscription/1029266947" }, "confirmationUrl": "https://billingshop.myshopify.com/admin/charges/166357/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--f6a58f222ad78948c56c070cc490ecf8dbb7048c" } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/billing/test/unit/graph_api/admin/mutations/app_subscription_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } appSubscription { id } confirmationUrl } }\",\n \"variables\": {\n \"name\": \"Super Duper Recurring Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n },\n \"interval\": \"ANNUAL\"\n }\n }\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }`,\n {\n variables: {\n \"name\": \"Super Duper Recurring Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n },\n \"interval\": \"ANNUAL\"\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }\nQUERY\n\nvariables = {\n \"name\": \"Super Duper Recurring Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>10.0, \"currencyCode\"=>\"USD\"}, \"interval\"=>\"ANNUAL\"}}}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }`,\n \"variables\": {\n \"name\": \"Super Duper Recurring Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n },\n \"interval\": \"ANNUAL\"\n }\n }\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }\nQUERY;\n\n$variables = [\n \"name\" => \"Super Duper Recurring Plan\",\n \"returnUrl\" => \"http://super-duper.shopifyapps.com/\",\n \"lineItems\" => [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>10.0, \"currencyCode\"=>\"USD\"}, \"interval\"=>\"ANNUAL\"}}}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "name", "description": "A descriptive name for the app subscription.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "String!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "name", "argValue": " \"Super Duper Recurring Plan\"", "typeKind": "MUTATION" }, { "arg": { "name": "returnUrl", "description": "The URL pointing to the page where the merchant is redirected after approving the app subscription.", "type": { "kind": "SCALAR", "name": "URL", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "URL!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "returnUrl", "argValue": " \"http://super-duper.shopifyapps.com/\"", "typeKind": "MUTATION" }, { "arg": { "name": "lineItems", "description": "Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.", "type": { "kind": "INPUT_OBJECT", "name": "AppSubscriptionLineItemInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[AppSubscriptionLineItemInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "lineItems", "argValue": " [{\"plan\":{\"appRecurringPricingDetails\":{\"price\":{\"amount\":10,\"currencyCode\":\"USD\"},\"interval\":\"ANNUAL\"}}}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "appsubscriptioncreate", "title": "Create a subscription for an app on both a recurring pricing plan and usage pricing plan.", "query_string": "mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n confirmationUrl\n }\n}", "query_arguments": { "name": "$name", "returnUrl": "$returnUrl", "lineItems": "$lineItems" }, "variables": { "name": "Super Duper Recurring and Usage Plan", "returnUrl": "http://super-duper.shopifyapps.com/", "lineItems": [ { "plan": { "appUsagePricingDetails": { "terms": "$1 for 100 emails", "cappedAmount": { "amount": 20, "currencyCode": "USD" } } } }, { "plan": { "appRecurringPricingDetails": { "price": { "amount": 10, "currencyCode": "USD" } } } } ] }, "response": { "data": { "appSubscriptionCreate": { "userErrors": [], "appSubscription": { "id": "gid://shopify/AppSubscription/1029266953", "lineItems": [ { "id": "gid://shopify/AppSubscriptionLineItem/1029266953?v=1&index=0", "plan": { "pricingDetails": { "__typename": "AppRecurringPricing" } } }, { "id": "gid://shopify/AppSubscriptionLineItem/1029266953?v=1&index=1", "plan": { "pricingDetails": { "__typename": "AppUsagePricing" } } } ] }, "confirmationUrl": "https://billingshop.myshopify.com/admin/charges/166357/1029266953/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAleWT06EmF1dG9fYWN0aXZhdGVU--4314ad97c411fa9da47834a7893463df148d23f1" } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/billing/test/unit/graph_api/admin/mutations/app_subscription_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } appSubscription { id lineItems { id plan { pricingDetails { __typename } } } } confirmationUrl } }\",\n \"variables\": {\n \"name\": \"Super Duper Recurring and Usage Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n },\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n confirmationUrl\n }\n }`,\n {\n variables: {\n \"name\": \"Super Duper Recurring and Usage Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n },\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n confirmationUrl\n }\n }\nQUERY\n\nvariables = {\n \"name\": \"Super Duper Recurring and Usage Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [{\"plan\"=>{\"appUsagePricingDetails\"=>{\"terms\"=>\"$1 for 100 emails\", \"cappedAmount\"=>{\"amount\"=>20.0, \"currencyCode\"=>\"USD\"}}}}, {\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>10.0, \"currencyCode\"=>\"USD\"}}}}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n confirmationUrl\n }\n }`,\n \"variables\": {\n \"name\": \"Super Duper Recurring and Usage Plan\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n },\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n confirmationUrl\n }\n }\nQUERY;\n\n$variables = [\n \"name\" => \"Super Duper Recurring and Usage Plan\",\n \"returnUrl\" => \"http://super-duper.shopifyapps.com/\",\n \"lineItems\" => [{\"plan\"=>{\"appUsagePricingDetails\"=>{\"terms\"=>\"$1 for 100 emails\", \"cappedAmount\"=>{\"amount\"=>20.0, \"currencyCode\"=>\"USD\"}}}}, {\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>10.0, \"currencyCode\"=>\"USD\"}}}}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "name", "description": "A descriptive name for the app subscription.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "String!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "name", "argValue": " \"Super Duper Recurring and Usage Plan\"", "typeKind": "MUTATION" }, { "arg": { "name": "returnUrl", "description": "The URL pointing to the page where the merchant is redirected after approving the app subscription.", "type": { "kind": "SCALAR", "name": "URL", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "URL!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "returnUrl", "argValue": " \"http://super-duper.shopifyapps.com/\"", "typeKind": "MUTATION" }, { "arg": { "name": "lineItems", "description": "Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.", "type": { "kind": "INPUT_OBJECT", "name": "AppSubscriptionLineItemInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[AppSubscriptionLineItemInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "lineItems", "argValue": " [{\"plan\":{\"appUsagePricingDetails\":{\"terms\":\"$1 for 100 emails\",\"cappedAmount\":{\"amount\":20,\"currencyCode\":\"USD\"}}}},{\"plan\":{\"appRecurringPricingDetails\":{\"price\":{\"amount\":10,\"currencyCode\":\"USD\"}}}}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "appsubscriptioncreate", "title": "Create a subscription with a fixed amount discount", "description": "Apply a fixed amount discount on the recurring cost of a subscription.", "query_string": "mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n}", "query_arguments": { "name": "$name", "returnUrl": "$returnUrl", "lineItems": "$lineItems" }, "variables": { "name": "30 Day Recurring Plan", "returnUrl": "https://review-app.shopifyapps.com", "lineItems": [ { "plan": { "appRecurringPricingDetails": { "price": { "amount": 40, "currencyCode": "USD" }, "discount": { "value": { "amount": 5 }, "durationLimitInIntervals": 2 }, "interval": "EVERY_30_DAYS" } } } ] }, "response": { "data": { "appSubscriptionCreate": { "userErrors": [], "confirmationUrl": "https://billingshop.myshopify.com/admin/charges/166357/1029266948/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAReWT06EmF1dG9fYWN0aXZhdGVU--ca2d9875a571449437b370eb58ed91e535a67e43", "appSubscription": { "id": "gid://shopify/AppSubscription/1029266948" } } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/billing/test/unit/graph_api/admin/mutations/app_subscription_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } confirmationUrl appSubscription { id } } }\",\n \"variables\": {\n \"name\": \"30 Day Recurring Plan\",\n \"returnUrl\": \"https://review-app.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 40.0,\n \"currencyCode\": \"USD\"\n },\n \"discount\": {\n \"value\": {\n \"amount\": 5.0\n },\n \"durationLimitInIntervals\": 2\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }`,\n {\n variables: {\n \"name\": \"30 Day Recurring Plan\",\n \"returnUrl\": \"https://review-app.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 40.0,\n \"currencyCode\": \"USD\"\n },\n \"discount\": {\n \"value\": {\n \"amount\": 5.0\n },\n \"durationLimitInIntervals\": 2\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }\nQUERY\n\nvariables = {\n \"name\": \"30 Day Recurring Plan\",\n \"returnUrl\": \"https://review-app.shopifyapps.com\",\n \"lineItems\": [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>40.0, \"currencyCode\"=>\"USD\"}, \"discount\"=>{\"value\"=>{\"amount\"=>5.0}, \"durationLimitInIntervals\"=>2}, \"interval\"=>\"EVERY_30_DAYS\"}}}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }`,\n \"variables\": {\n \"name\": \"30 Day Recurring Plan\",\n \"returnUrl\": \"https://review-app.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 40.0,\n \"currencyCode\": \"USD\"\n },\n \"discount\": {\n \"value\": {\n \"amount\": 5.0\n },\n \"durationLimitInIntervals\": 2\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }\nQUERY;\n\n$variables = [\n \"name\" => \"30 Day Recurring Plan\",\n \"returnUrl\" => \"https://review-app.shopifyapps.com\",\n \"lineItems\" => [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>40.0, \"currencyCode\"=>\"USD\"}, \"discount\"=>{\"value\"=>{\"amount\"=>5.0}, \"durationLimitInIntervals\"=>2}, \"interval\"=>\"EVERY_30_DAYS\"}}}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "name", "description": "A descriptive name for the app subscription.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "String!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "name", "argValue": " \"30 Day Recurring Plan\"", "typeKind": "MUTATION" }, { "arg": { "name": "returnUrl", "description": "The URL pointing to the page where the merchant is redirected after approving the app subscription.", "type": { "kind": "SCALAR", "name": "URL", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "URL!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "returnUrl", "argValue": " \"https://review-app.shopifyapps.com\"", "typeKind": "MUTATION" }, { "arg": { "name": "lineItems", "description": "Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.", "type": { "kind": "INPUT_OBJECT", "name": "AppSubscriptionLineItemInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[AppSubscriptionLineItemInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "lineItems", "argValue": " [{\"plan\":{\"appRecurringPricingDetails\":{\"price\":{\"amount\":40,\"currencyCode\":\"USD\"},\"discount\":{\"value\":{\"amount\":5},\"durationLimitInIntervals\":2},\"interval\":\"EVERY_30_DAYS\"}}}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "appsubscriptioncreate", "title": "Create a subscription with a free trial.", "query_string": "mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!, $trialDays: Int) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems, trialDays: $trialDays) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n}", "query_arguments": { "name": "$name", "returnUrl": "$returnUrl", "lineItems": "$lineItems", "trialDays": "$trialDays" }, "variables": { "name": "Super Duper Recurring Plan with a Trial", "returnUrl": "http://super-duper.shopifyapps.com/", "trialDays": 7, "lineItems": [ { "plan": { "appRecurringPricingDetails": { "price": { "amount": 10, "currencyCode": "USD" } } } } ] }, "response": { "data": { "appSubscriptionCreate": { "userErrors": [], "appSubscription": { "id": "gid://shopify/AppSubscription/1029266952" }, "confirmationUrl": "https://billingshop.myshopify.com/admin/charges/166357/1029266952/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAheWT06EmF1dG9fYWN0aXZhdGVU--427058b56d1c8ee21519d6d84fe79589400563c9" } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/billing/test/unit/graph_api/admin/mutations/app_subscription_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!, $trialDays: Int) { appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems, trialDays: $trialDays) { userErrors { field message } appSubscription { id } confirmationUrl } }\",\n \"variables\": {\n \"name\": \"Super Duper Recurring Plan with a Trial\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"trialDays\": 7,\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!, $trialDays: Int) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems, trialDays: $trialDays) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }`,\n {\n variables: {\n \"name\": \"Super Duper Recurring Plan with a Trial\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"trialDays\": 7,\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!, $trialDays: Int) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems, trialDays: $trialDays) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }\nQUERY\n\nvariables = {\n \"name\": \"Super Duper Recurring Plan with a Trial\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"trialDays\": 7,\n \"lineItems\": [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>10.0, \"currencyCode\"=>\"USD\"}}}}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!, $trialDays: Int) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems, trialDays: $trialDays) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }`,\n \"variables\": {\n \"name\": \"Super Duper Recurring Plan with a Trial\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com/\",\n \"trialDays\": 7,\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 10.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!, $trialDays: Int) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems, trialDays: $trialDays) {\n userErrors {\n field\n message\n }\n appSubscription {\n id\n }\n confirmationUrl\n }\n }\nQUERY;\n\n$variables = [\n \"name\" => \"Super Duper Recurring Plan with a Trial\",\n \"returnUrl\" => \"http://super-duper.shopifyapps.com/\",\n \"trialDays\" => 7,\n \"lineItems\" => [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>10.0, \"currencyCode\"=>\"USD\"}}}}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "name", "description": "A descriptive name for the app subscription.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "String!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "name", "argValue": " \"Super Duper Recurring Plan with a Trial\"", "typeKind": "MUTATION" }, { "arg": { "name": "returnUrl", "description": "The URL pointing to the page where the merchant is redirected after approving the app subscription.", "type": { "kind": "SCALAR", "name": "URL", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "URL!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "returnUrl", "argValue": " \"http://super-duper.shopifyapps.com/\"", "typeKind": "MUTATION" }, { "arg": { "name": "trialDays", "description": "The number of days of the free trial period, beginning on the day that the merchant approves the app charges.", "type": { "kind": "SCALAR", "name": "Int", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "Int", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "trialDays", "argValue": " 7", "typeKind": "MUTATION" }, { "arg": { "name": "lineItems", "description": "Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.", "type": { "kind": "INPUT_OBJECT", "name": "AppSubscriptionLineItemInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[AppSubscriptionLineItemInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "lineItems", "argValue": " [{\"plan\":{\"appRecurringPricingDetails\":{\"price\":{\"amount\":10,\"currencyCode\":\"USD\"}}}}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "appsubscriptioncreate", "title": "Create a subscription with a percentage value discount", "description": "Apply a percentage value discount on the recurring cost of a subscription.", "query_string": "mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n}", "query_arguments": { "name": "$name", "returnUrl": "$returnUrl", "lineItems": "$lineItems" }, "variables": { "name": "30 Day Recurring Plan", "returnUrl": "https://review-app.shopifyapps.com", "lineItems": [ { "plan": { "appRecurringPricingDetails": { "price": { "amount": 40, "currencyCode": "USD" }, "discount": { "value": { "percentage": 0.2 }, "durationLimitInIntervals": 10 }, "interval": "EVERY_30_DAYS" } } } ] }, "response": { "data": { "appSubscriptionCreate": { "userErrors": [], "confirmationUrl": "https://billingshop.myshopify.com/admin/charges/166357/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--97200e8aec46abce1cc3737c2e286e892edeb3e1", "appSubscription": { "id": "gid://shopify/AppSubscription/1029266951" } } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/billing/test/unit/graph_api/admin/mutations/app_subscription_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } confirmationUrl appSubscription { id } } }\",\n \"variables\": {\n \"name\": \"30 Day Recurring Plan\",\n \"returnUrl\": \"https://review-app.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 40.0,\n \"currencyCode\": \"USD\"\n },\n \"discount\": {\n \"value\": {\n \"percentage\": 0.2\n },\n \"durationLimitInIntervals\": 10\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }`,\n {\n variables: {\n \"name\": \"30 Day Recurring Plan\",\n \"returnUrl\": \"https://review-app.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 40.0,\n \"currencyCode\": \"USD\"\n },\n \"discount\": {\n \"value\": {\n \"percentage\": 0.2\n },\n \"durationLimitInIntervals\": 10\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }\nQUERY\n\nvariables = {\n \"name\": \"30 Day Recurring Plan\",\n \"returnUrl\": \"https://review-app.shopifyapps.com\",\n \"lineItems\": [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>40.0, \"currencyCode\"=>\"USD\"}, \"discount\"=>{\"value\"=>{\"percentage\"=>0.2}, \"durationLimitInIntervals\"=>10}, \"interval\"=>\"EVERY_30_DAYS\"}}}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }`,\n \"variables\": {\n \"name\": \"30 Day Recurring Plan\",\n \"returnUrl\": \"https://review-app.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 40.0,\n \"currencyCode\": \"USD\"\n },\n \"discount\": {\n \"value\": {\n \"percentage\": 0.2\n },\n \"durationLimitInIntervals\": 10\n },\n \"interval\": \"EVERY_30_DAYS\"\n }\n }\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }\nQUERY;\n\n$variables = [\n \"name\" => \"30 Day Recurring Plan\",\n \"returnUrl\" => \"https://review-app.shopifyapps.com\",\n \"lineItems\" => [{\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>40.0, \"currencyCode\"=>\"USD\"}, \"discount\"=>{\"value\"=>{\"percentage\"=>0.2}, \"durationLimitInIntervals\"=>10}, \"interval\"=>\"EVERY_30_DAYS\"}}}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "name", "description": "A descriptive name for the app subscription.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "String!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "name", "argValue": " \"30 Day Recurring Plan\"", "typeKind": "MUTATION" }, { "arg": { "name": "returnUrl", "description": "The URL pointing to the page where the merchant is redirected after approving the app subscription.", "type": { "kind": "SCALAR", "name": "URL", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "URL!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "returnUrl", "argValue": " \"https://review-app.shopifyapps.com\"", "typeKind": "MUTATION" }, { "arg": { "name": "lineItems", "description": "Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.", "type": { "kind": "INPUT_OBJECT", "name": "AppSubscriptionLineItemInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[AppSubscriptionLineItemInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "lineItems", "argValue": " [{\"plan\":{\"appRecurringPricingDetails\":{\"price\":{\"amount\":40,\"currencyCode\":\"USD\"},\"discount\":{\"value\":{\"percentage\":0.2},\"durationLimitInIntervals\":10},\"interval\":\"EVERY_30_DAYS\"}}}]", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "appsubscriptioncreate", "title": "Create a subscription with add-on modules", "description": "Demonstrates how to increase usage caps to bill for 'add on modules' where Module A has a fixed price of $20 every 30 days,\nand Module B as a fixed price of $15 every 30 days plus $1 for every 100 emails.\n", "query_string": "mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n}", "query_arguments": { "name": "$name", "returnUrl": "$returnUrl", "lineItems": "$lineItems" }, "variables": { "name": "Subscription for Module A and Module B", "returnUrl": "http://super-duper.shopifyapps.com", "lineItems": [ { "plan": { "appUsagePricingDetails": { "terms": "$1 for 100 emails for Module B", "cappedAmount": { "amount": 20, "currencyCode": "USD" } } } }, { "plan": { "appRecurringPricingDetails": { "price": { "amount": 35, "currencyCode": "USD" } } } } ] }, "response": { "data": { "appSubscriptionCreate": { "userErrors": [], "confirmationUrl": "https://billingshop.myshopify.com/admin/charges/166357/1029266954/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBApeWT06EmF1dG9fYWN0aXZhdGVU--8502272f2d30cfc1b77e3f1521764c17c11f003b", "appSubscription": { "id": "gid://shopify/AppSubscription/1029266954" } } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/billing/test/unit/graph_api/admin/mutations/app_subscription_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } confirmationUrl appSubscription { id } } }\",\n \"variables\": {\n \"name\": \"Subscription for Module A and Module B\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails for Module B\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n },\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 35.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }`,\n {\n variables: {\n \"name\": \"Subscription for Module A and Module B\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails for Module B\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n },\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 35.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }\nQUERY\n\nvariables = {\n \"name\": \"Subscription for Module A and Module B\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com\",\n \"lineItems\": [{\"plan\"=>{\"appUsagePricingDetails\"=>{\"terms\"=>\"$1 for 100 emails for Module B\", \"cappedAmount\"=>{\"amount\"=>20.0, \"currencyCode\"=>\"USD\"}}}}, {\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>35.0, \"currencyCode\"=>\"USD\"}}}}]\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }`,\n \"variables\": {\n \"name\": \"Subscription for Module A and Module B\",\n \"returnUrl\": \"http://super-duper.shopifyapps.com\",\n \"lineItems\": [\n {\n \"plan\": {\n \"appUsagePricingDetails\": {\n \"terms\": \"$1 for 100 emails for Module B\",\n \"cappedAmount\": {\n \"amount\": 20.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n },\n {\n \"plan\": {\n \"appRecurringPricingDetails\": {\n \"price\": {\n \"amount\": 35.0,\n \"currencyCode\": \"USD\"\n }\n }\n }\n }\n ]\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation AppSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) {\n appSubscriptionCreate(name: $name, returnUrl: $returnUrl, lineItems: $lineItems) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }\nQUERY;\n\n$variables = [\n \"name\" => \"Subscription for Module A and Module B\",\n \"returnUrl\" => \"http://super-duper.shopifyapps.com\",\n \"lineItems\" => [{\"plan\"=>{\"appUsagePricingDetails\"=>{\"terms\"=>\"$1 for 100 emails for Module B\", \"cappedAmount\"=>{\"amount\"=>20.0, \"currencyCode\"=>\"USD\"}}}}, {\"plan\"=>{\"appRecurringPricingDetails\"=>{\"price\"=>{\"amount\"=>35.0, \"currencyCode\"=>\"USD\"}}}}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "name", "description": "A descriptive name for the app subscription.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "String!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "name", "argValue": " \"Subscription for Module A and Module B\"", "typeKind": "MUTATION" }, { "arg": { "name": "returnUrl", "description": "The URL pointing to the page where the merchant is redirected after approving the app subscription.", "type": { "kind": "SCALAR", "name": "URL", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "URL!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "returnUrl", "argValue": " \"http://super-duper.shopifyapps.com\"", "typeKind": "MUTATION" }, { "arg": { "name": "lineItems", "description": "Attaches one or more pricing plans to an app subscription. Only one pricing plan can be defined for each available type.", "type": { "kind": "INPUT_OBJECT", "name": "AppSubscriptionLineItemInput", "list": true, "non_null": true }, "defaultValue": null, "typeSignature": "[AppSubscriptionLineItemInput!]!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "lineItems", "argValue": " [{\"plan\":{\"appUsagePricingDetails\":{\"terms\":\"$1 for 100 emails for Module B\",\"cappedAmount\":{\"amount\":20,\"currencyCode\":\"USD\"}}}},{\"plan\":{\"appRecurringPricingDetails\":{\"price\":{\"amount\":35,\"currencyCode\":\"USD\"}}}}]", "typeKind": "MUTATION" } ] } ]