Version: 2024-10
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\": \"query { events(query: \\\"action:'\\''destroy'\\'' AND subject_type:'\\''PRODUCT'\\''\\\", first: 10) { edges { node { id message ... on BasicEvent { action subjectType subject { __typename } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n events(query: \"action:'destroy' AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\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 {\n events(query: \"action:'destroy' AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\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 {\n events(query: \"action:'destroy' AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\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 {\n events(query: \"action:'destroy' AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\n __typename\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n events(query: \"action:'destroy' AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\n __typename\n }\n }\n }\n }\n }\n}"
input: null
response: { "data": { "events": { "edges": [ { "node": { "id": "gid://shopify/BasicEvent/625930779", "message": "Product was deleted: Dandy Googles (Blue).", "action": "destroy", "subjectType": "PRODUCT", "subject": { "__typename": "Product" } } } ] } } }
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\": \"query { events(query: \\\"created_at:>=2024-01-01\\\", first: 10) { edges { node { id message createdAt } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n events(query: \"created_at:>=2024-01-01\", first: 10) {\n edges {\n node {\n id\n message\n createdAt\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 events(query: \"created_at:>=2024-01-01\", first: 10) {\n edges {\n node {\n id\n message\n createdAt\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 events(query: \"created_at:>=2024-01-01\", first: 10) {\n edges {\n node {\n id\n message\n createdAt\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 events(query: \"created_at:>=2024-01-01\", first: 10) {\n edges {\n node {\n id\n message\n createdAt\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n events(query: \"created_at:>=2024-01-01\", first: 10) {\n edges {\n node {\n id\n message\n createdAt\n }\n }\n }\n}"
input: null
response: { "data": { "events": { "edges": [ { "node": { "id": "gid://shopify/BasicEvent/20851159", "message": "Tax amount was updated from $22.36 USD to $19.85 USD.", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/BasicEvent/31716108", "message": "bob bobsen approved an order cancellation processed by limitedaccessbob bobsen on Point of Sale.", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/BasicEvent/132778104", "message": "Unknown event Order#access_order_fulfillment_approval...", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/BasicEvent/155674255", "message": "This customer's orders were added to <a href=\"https://snowdevil.myshopify.com/admin/companies/1/locations/1\">Montreal</a>.", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/BasicEvent/197669626", "message": "Order <a href=\"https://snowdevil.myshopify.com/admin/orders/647667644\">#1002</a> was created from this draft order.", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/NotificationSentEvent/233139490", "message": "An invoice was sent to Bob Bobsen (bobsburgers@example.net).", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/BasicEvent/254468230", "message": "Order <a href=\"https://snowdevil.myshopify.com/admin/orders/148977776\">#1001</a> was created from this draft order.", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/BasicEvent/272432974", "message": "Payment reminder email was sent to bob@example.com.", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/BasicEvent/381046666", "message": "This customer's orders were removed from <a href=\"https://snowdevil.myshopify.com/admin/companies/1/locations/1\">Montreal</a>.", "createdAt": "2024-11-07T15:11:35Z" } }, { "node": { "id": "gid://shopify/BasicEvent/458992081", "message": "Order covered by the <a href=\"https://help.shopify.com/manual/shipping/shop-promise#limited-guarantee\">Shop Promise guarantee</a>.", "createdAt": "2024-11-07T15:11:35Z" } } ] } } }
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\": \"query { events(query: \\\"comments:1 AND subject_type:'\\''PRODUCT'\\''\\\", first: 10) { edges { node { id message ... on CommentEvent { rawMessage } ... on BasicEvent { action subjectType subject { __typename } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n events(query: \"comments:1 AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on CommentEvent {\n rawMessage\n }\n ... on BasicEvent {\n action\n subjectType\n subject {\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 {\n events(query: \"comments:1 AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on CommentEvent {\n rawMessage\n }\n ... on BasicEvent {\n action\n subjectType\n subject {\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 {\n events(query: \"comments:1 AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on CommentEvent {\n rawMessage\n }\n ... on BasicEvent {\n action\n subjectType\n subject {\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 {\n events(query: \"comments:1 AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on CommentEvent {\n rawMessage\n }\n ... on BasicEvent {\n action\n subjectType\n subject {\n __typename\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n events(query: \"comments:1 AND subject_type:'PRODUCT'\", first: 10) {\n edges {\n node {\n id\n message\n ... on CommentEvent {\n rawMessage\n }\n ... on BasicEvent {\n action\n subjectType\n subject {\n __typename\n }\n }\n }\n }\n }\n}"
input: null
response: { "data": { "events": { "edges": [ { "node": { "id": "gid://shopify/BasicEvent/267851118", "message": "", "action": "unpublished", "subjectType": "PRODUCT", "subject": null } }, { "node": { "id": "gid://shopify/BasicEvent/422690323", "message": "bob bobsen included a product on Online Store: <a href=\"https://admin.myshopify.io/store/snowdevil/admin/products/440089423\">IPod Nano - 8GB</a>.", "action": "published", "subjectType": "PRODUCT", "subject": { "__typename": "Product" } } }, { "node": { "id": "gid://shopify/BasicEvent/625930779", "message": "Product was deleted: Dandy Googles (Blue).", "action": "destroy", "subjectType": "PRODUCT", "subject": { "__typename": "Product" } } }, { "node": { "id": "gid://shopify/BasicEvent/686413589", "message": "", "action": "create", "subjectType": "PRODUCT", "subject": null } }, { "node": { "id": "gid://shopify/BasicEvent/806005652", "message": "bob bobsen included a product on POS Test Account: <a href=\"https://admin.myshopify.io/store/snowdevil/admin/products/912855135\">SEO Boots</a>.", "action": "published", "subjectType": "PRODUCT", "subject": { "__typename": "Product" } } }, { "node": { "id": "gid://shopify/BasicEvent/836798121", "message": "", "action": "create", "subjectType": "PRODUCT", "subject": null } }, { "node": { "id": "gid://shopify/BasicEvent/842889634", "message": "", "action": "unpublished", "subjectType": "PRODUCT", "subject": null } } ] } } }
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\": \"query EventList { events(first: 5) { nodes { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query EventList {\n events(first: 5) {\n nodes {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\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 EventList {\n events(first: 5) {\n nodes {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\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 EventList {\n events(first: 5) {\n nodes {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\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 EventList {\n events(first: 5) {\n nodes {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query EventList {\n events(first: 5) {\n nodes {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\n }\n }\n }\n}"
input: null
response: { "data": { "events": { "nodes": [ { "id": "gid://shopify/BasicEvent/9889833", "action": "restock_line_items", "createdAt": "2014-03-19T13:31:30Z", "message": "bob bobsen restocked 2 line items.", "arguments": [ 2 ], "subjectId": "gid://shopify/Order/271719359", "subjectType": "ORDER", "additionalContent": "null" }, { "id": "gid://shopify/BasicEvent/12536286", "action": "fulfillment_success", "createdAt": "2008-06-06T12:00:00Z", "message": "Shopify fulfilled 1 item via Mr. Drop Shipper.", "arguments": [ "267732048", 1 ], "subjectId": "gid://shopify/Order/535108883", "subjectType": "ORDER", "additionalContent": "{\"root_component\":{\"type\":\"root_component\",\"content\":[{\"type\":\"list\",\"content\":[{\"type\":\"list_item\",\"content\":[{\"type\":\"text\",\"content\":\"1 × Draft - 151cm\",\"options\":{}},{\"type\":\"text\",\"content\":\" draft-151\",\"options\":{\"subdued\":true}}],\"options\":{\"large_margin\":true}}],\"options\":{\"title\":\"Items\",\"border_bottom\":true}},{\"type\":\"key_value_list\",\"content\":[{\"type\":\"key_value_pair\",\"key\":[{\"type\":\"text\",\"content\":\"Service\",\"options\":{}}],\"value\":[{\"type\":\"text\",\"content\":\"Mr. Drop Shipper\",\"options\":{}}],\"options\":{}}],\"options\":{\"title\":null}}]}}" }, { "id": "gid://shopify/BasicEvent/14596041", "action": "confirmation_number_generated", "createdAt": "2014-03-18T13:31:30Z", "message": "Confirmation #QWE1234TF was generated for this order.", "arguments": [ "QWE1234TF" ], "subjectId": "gid://shopify/Order/148977776", "subjectType": "ORDER", "additionalContent": "null" }, { "id": "gid://shopify/BasicEvent/20851159", "action": "taxes_updated", "createdAt": "2024-11-07T15:11:35Z", "message": "Tax amount was updated from $22.36 USD to $19.85 USD.", "arguments": [ 22.36, 19.85 ], "subjectId": "gid://shopify/Order/148977776", "subjectType": "ORDER", "additionalContent": "null" }, { "id": "gid://shopify/BasicEvent/22713642", "action": "exchange_created", "createdAt": "2008-06-06T12:00:00Z", "message": "bob bobsen completed an exchange on order <a href=\"https://snowdevil.myshopify.com/admin/orders/120375246\">#1060</a>.", "arguments": [], "subjectId": "gid://shopify/Order/989922345", "subjectType": "ORDER", "additionalContent": "null" } ] } } }