Version: 2025-01
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query AbandonedCheckouts { abandonedCheckouts(first: 1) { nodes { abandonedCheckoutUrl billingAddress { country } completedAt createdAt customer { firstName lastName email } id shippingAddress { country } updatedAt } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query AbandonedCheckouts {\n abandonedCheckouts(first: 1) {\n nodes {\n abandonedCheckoutUrl\n billingAddress {\n country\n }\n completedAt\n createdAt\n customer {\n firstName\n lastName\n email\n }\n id\n shippingAddress {\n country\n }\n updatedAt\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 AbandonedCheckouts {\n abandonedCheckouts(first: 1) {\n nodes {\n abandonedCheckoutUrl\n billingAddress {\n country\n }\n completedAt\n createdAt\n customer {\n firstName\n lastName\n email\n }\n id\n shippingAddress {\n country\n }\n updatedAt\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 AbandonedCheckouts {\n abandonedCheckouts(first: 1) {\n nodes {\n abandonedCheckoutUrl\n billingAddress {\n country\n }\n completedAt\n createdAt\n customer {\n firstName\n lastName\n email\n }\n id\n shippingAddress {\n country\n }\n updatedAt\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 AbandonedCheckouts {\n abandonedCheckouts(first: 1) {\n nodes {\n abandonedCheckoutUrl\n billingAddress {\n country\n }\n completedAt\n createdAt\n customer {\n firstName\n lastName\n email\n }\n id\n shippingAddress {\n country\n }\n updatedAt\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query AbandonedCheckouts {\n abandonedCheckouts(first: 1) {\n nodes {\n abandonedCheckoutUrl\n billingAddress {\n country\n }\n completedAt\n createdAt\n customer {\n firstName\n lastName\n email\n }\n id\n shippingAddress {\n country\n }\n updatedAt\n }\n }\n}"
input: null
response: { "data": { "abandonedCheckouts": { "nodes": [ { "abandonedCheckoutUrl": "https://www.snowdevil.ca/26371970/checkouts/ac/cart_token_k23sabns3/recover?key=secret_token_i23kd8f88&locale=en", "billingAddress": { "country": "Canada" }, "completedAt": null, "createdAt": "2125-07-31T15:57:11Z", "customer": { "firstName": "Bob", "lastName": "Bobsen", "email": "bob@example.com" }, "id": "gid://shopify/AbandonedCheckout/123", "shippingAddress": { "country": "Canada" }, "updatedAt": "2125-07-31T15:57:11Z" } ] } } }