Version: 2024-07
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query AccessScopeList { currentAppInstallation { accessScopes { handle } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query AccessScopeList {\n currentAppInstallation {\n accessScopes {\n handle\n }\n }\n }`,\n});\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 query AccessScopeList {\n currentAppInstallation {\n accessScopes {\n handle\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query AccessScopeList {\n currentAppInstallation {\n accessScopes {\n handle\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query AccessScopeList {\n currentAppInstallation {\n accessScopes {\n handle\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query AccessScopeList {\n currentAppInstallation {\n accessScopes {\n handle\n }\n }\n}"
input: null
response: { "data": { "currentAppInstallation": { "accessScopes": [ { "handle": "read_all_orders" }, { "handle": "read_all_subscription_contracts" }, { "handle": "read_analytics_overviews" }, { "handle": "read_billing" }, { "handle": "read_checkouts" }, { "handle": "read_discovery" }, { "handle": "read_discovery_synonym_groups" }, { "handle": "read_payment_settings" }, { "handle": "read_subscription_plans" }, { "handle": "read_users" }, { "handle": "read_customer_merge" }, { "handle": "write_admin_shop_settings" }, { "handle": "write_analytics_overviews" }, { "handle": "write_apps" }, { "handle": "write_brand" }, { "handle": "write_brand_settings" }, { "handle": "write_content" }, { "handle": "write_customer_data_redaction_requests" }, { "handle": "write_customer_payment_methods" }, { "handle": "write_customers" }, { "handle": "write_discounts" }, { "handle": "write_discovery" }, { "handle": "write_discovery_synonym_groups" }, { "handle": "write_draft_orders" }, { "handle": "write_files" }, { "handle": "write_fulfillments" }, { "handle": "write_gift_cards" }, { "handle": "write_home" }, { "handle": "write_inventory" }, { "handle": "write_locations" }, { "handle": "write_marketing_events" }, { "handle": "write_media_processing" }, { "handle": "write_merchant_managed_fulfillment_orders" }, { "handle": "write_metaobjects" }, { "handle": "write_metaobject_definitions" }, { "handle": "write_notifications" }, { "handle": "write_online_store" }, { "handle": "write_online_store_pages" }, { "handle": "write_online_store_navigation" }, { "handle": "write_order_edits" }, { "handle": "write_orders" }, { "handle": "write_order_refunds" }, { "handle": "write_payment_mandate" }, { "handle": "write_price_rules" }, { "handle": "write_products" }, { "handle": "write_publications" }, { "handle": "write_reports" }, { "handle": "write_script_tags" }, { "handle": "write_shipping" }, { "handle": "write_themes" }, { "handle": "write_third_party_fulfillment_orders" }, { "handle": "write_customer_merge" }, { "handle": "write_companies" }, { "handle": "read_analytics" }, { "handle": "read_admin_shop_settings" }, { "handle": "read_apps" }, { "handle": "read_brand" }, { "handle": "read_brand_settings" }, { "handle": "read_content" }, { "handle": "read_customer_data_redaction_requests" }, { "handle": "read_customer_payment_methods" }, { "handle": "read_customers" }, { "handle": "read_discounts" }, { "handle": "read_draft_orders" }, { "handle": "read_files" }, { "handle": "read_fulfillments" }, { "handle": "read_gift_cards" }, { "handle": "read_home" }, { "handle": "read_inventory" }, { "handle": "read_locations" }, { "handle": "read_marketing_events" }, { "handle": "read_media_processing" }, { "handle": "read_merchant_managed_fulfillment_orders" }, { "handle": "read_metaobjects" }, { "handle": "read_metaobject_definitions" }, { "handle": "read_notifications" }, { "handle": "read_online_store" }, { "handle": "read_online_store_pages" }, { "handle": "read_online_store_navigation" }, { "handle": "read_order_edits" }, { "handle": "read_orders" }, { "handle": "read_payment_mandate" }, { "handle": "read_price_rules" }, { "handle": "read_products" }, { "handle": "read_publications" }, { "handle": "read_reports" }, { "handle": "read_script_tags" }, { "handle": "read_shipping" }, { "handle": "read_themes" }, { "handle": "read_third_party_fulfillment_orders" }, { "handle": "read_companies" } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { currentAppInstallation { oneTimePurchases(first: 10) { edges { node { createdAt id name price { amount currencyCode } status test } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n currentAppInstallation {\n oneTimePurchases(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n price {\n amount\n currencyCode\n }\n status\n test\n }\n }\n }\n }\n }`,\n});\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 query {\n currentAppInstallation {\n oneTimePurchases(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n price {\n amount\n currencyCode\n }\n status\n test\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n currentAppInstallation {\n oneTimePurchases(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n price {\n amount\n currencyCode\n }\n status\n test\n }\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n currentAppInstallation {\n oneTimePurchases(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n price {\n amount\n currencyCode\n }\n status\n test\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n currentAppInstallation {\n oneTimePurchases(first: 10) {\n edges {\n node {\n createdAt\n id\n name\n price {\n amount\n currencyCode\n }\n status\n test\n }\n }\n }\n }\n}"
input: null
response: { "data": { "currentAppInstallation": { "oneTimePurchases": { "edges": [] } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query GetRecurringApplicationCharges { currentAppInstallation { activeSubscriptions { id name status lineItems { id plan { pricingDetails { __typename } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query GetRecurringApplicationCharges {\n currentAppInstallation {\n activeSubscriptions {\n id\n name\n status\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n }\n }`,\n});\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 query GetRecurringApplicationCharges {\n currentAppInstallation {\n activeSubscriptions {\n id\n name\n status\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query GetRecurringApplicationCharges {\n currentAppInstallation {\n activeSubscriptions {\n id\n name\n status\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query GetRecurringApplicationCharges {\n currentAppInstallation {\n activeSubscriptions {\n id\n name\n status\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query GetRecurringApplicationCharges {\n currentAppInstallation {\n activeSubscriptions {\n id\n name\n status\n lineItems {\n id\n plan {\n pricingDetails {\n __typename\n }\n }\n }\n }\n }\n}"
input: null
response: { "data": { "currentAppInstallation": { "activeSubscriptions": [] } } }