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 SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) { order(id: $id) { id suggestedRefund(refundLineItems: $refundLineItems) { subtotalSet { shopMoney { amount currencyCode } presentmentMoney { amount currencyCode } } refundLineItems { lineItem { id } quantity } } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Order/469306983\",\n \"refundLineItems\": [\n {\n \"lineItemId\": \"gid://shopify/LineItem/983004162\",\n \"quantity\": 1\n }\n ]\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Order/469306983\",\n \"refundLineItems\": [\n {\n \"lineItemId\": \"gid://shopify/LineItem/983004162\",\n \"quantity\": 1\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 SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Order/469306983\",\n \"refundLineItems\": [{\"lineItemId\"=>\"gid://shopify/LineItem/983004162\", \"quantity\"=>1}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"id\" => \"gid://shopify/Order/469306983\",\n \"refundLineItems\" => [{\"lineItemId\"=>\"gid://shopify/LineItem/983004162\", \"quantity\"=>1}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Order/469306983\",\n \"refundLineItems\": [\n {\n \"lineItemId\": \"gid://shopify/LineItem/983004162\",\n \"quantity\": 1\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n}"
input: { "id": "gid://shopify/Order/469306983", "refundLineItems": [ { "lineItemId": "gid://shopify/LineItem/983004162", "quantity": 1 } ] }
response: { "data": { "order": { "id": "gid://shopify/Order/469306983", "suggestedRefund": { "subtotalSet": { "shopMoney": { "amount": "8.26", "currencyCode": "USD" }, "presentmentMoney": { "amount": "7.0", "currencyCode": "EUR" } }, "refundLineItems": [ { "lineItem": { "id": "gid://shopify/LineItem/983004162" }, "quantity": 1 } ] } } } }
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 { order1: order(id: \\\"gid://shopify/Order/148977776\\\") { name } order2: order(id: \\\"gid://shopify/Order/1073459961\\\") { name } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\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 order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\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 order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\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 order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\n }\n}"
input: null
response: { "data": { "order1": { "name": "#1001" }, "order2": { "name": "#1018" } } }
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 OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) { order(id: $ownerId) { purchaseOrder: metafield(namespace: $namespace, key: $key) { value } } }\",\n \"variables\": {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }`,\n \"variables\": {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/Order/148977776\"\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 OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }\nQUERY\n\nvariables = {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }\nQUERY;\n\n$variables = [\n \"namespace\" => \"my_fields\",\n \"key\" => \"purchase_order\",\n \"ownerId\" => \"gid://shopify/Order/148977776\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }`,\n {\n variables: {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n}"
input: { "namespace": "my_fields", "key": "purchase_order", "ownerId": "gid://shopify/Order/148977776" }
response: { "data": { "order": { "purchaseOrder": { "value": "123" } } } }
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 { node(id: \\\"gid://shopify/Order/148977776\\\") { id ... on Order { name } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\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 node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\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 node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\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 node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\n }\n }\n}"
input: null
response: { "data": { "node": { "id": "gid://shopify/Order/148977776", "name": "#1001" } } }
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 OrderMetafields($ownerId: ID!) { order(id: $ownerId) { metafields(first: 3) { edges { node { namespace key value } } } } }\",\n \"variables\": {\n \"ownerId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"ownerId\": \"gid://shopify/Order/148977776\"\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 OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"ownerId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"ownerId\" => \"gid://shopify/Order/148977776\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"ownerId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n}"
input: { "ownerId": "gid://shopify/Order/148977776" }
response: { "data": { "order": { "metafields": { "edges": [ { "node": { "namespace": "my_fields", "key": "purchase_order", "value": "123" } } ] } } } }
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 OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) { order(id: $ownerId) { metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) { edges { node { name namespace key type { name } } } } } }\",\n \"variables\": {\n \"pinnedStatus\": \"PINNED\",\n \"ownerId\": \"gid://shopify/Order/148977776\",\n \"first\": 10,\n \"sortKey\": \"PINNED_POSITION\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"pinnedStatus\": \"PINNED\",\n \"ownerId\": \"gid://shopify/Order/148977776\",\n \"first\": 10,\n \"sortKey\": \"PINNED_POSITION\"\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 OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"pinnedStatus\": \"PINNED\",\n \"ownerId\": \"gid://shopify/Order/148977776\",\n \"first\": 10,\n \"sortKey\": \"PINNED_POSITION\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"pinnedStatus\" => \"PINNED\",\n \"ownerId\" => \"gid://shopify/Order/148977776\",\n \"first\" => 10,\n \"sortKey\" => \"PINNED_POSITION\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"pinnedStatus\": \"PINNED\",\n \"ownerId\": \"gid://shopify/Order/148977776\",\n \"first\": 10,\n \"sortKey\": \"PINNED_POSITION\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n}"
input: { "pinnedStatus": "PINNED", "ownerId": "gid://shopify/Order/148977776", "first": 10, "sortKey": "PINNED_POSITION" }
response: { "data": { "order": { "metafieldDefinitions": { "edges": [ { "node": { "name": "Delivery Instructions", "namespace": "my_fields", "key": "delivery_instructions", "type": { "name": "single_line_text_field" } } }, { "node": { "name": "Purchase Order", "namespace": "my_fields", "key": "purchase_order", "type": { "name": "single_line_text_field" } } } ] } } } }
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 { order(id: \\\"gid://shopify/Order/816964372\\\") { agreements(first: 10) { edges { node { id happenedAt sales(first: 10) { edges { node { actionType lineType quantity totalAmount { shopMoney { amount } } ... on ProductSale { lineItem { id name } } ... on ShippingLineSale { shippingLine { id } } } } } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\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 order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\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 order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\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 order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}"
input: null
response: { "data": { "order": { "agreements": { "edges": [ { "node": { "id": "gid://shopify/SalesAgreement/466882664", "happenedAt": "2005-07-31T15:57:11Z", "sales": { "edges": [ { "node": { "actionType": "ORDER", "lineType": "SHIPPING", "quantity": null, "totalAmount": { "shopMoney": { "amount": "5.0" } }, "shippingLine": { "id": "gid://shopify/ShippingLine/816964372" } } }, { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 3, "totalAmount": { "shopMoney": { "amount": "30.0" } }, "lineItem": { "id": "gid://shopify/LineItem/406313524", "name": "Draft - 151cm" } } } ] } } } ] } } } }
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 { order(id: \\\"gid://shopify/Order/116757651\\\") { agreements(first: 10) { edges { node { id happenedAt sales(first: 10) { edges { node { actionType lineType quantity totalAmount { shopMoney { amount } } ... on ProductSale { lineItem { id name } } } } } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\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 order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\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 order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\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 order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}"
input: null
response: { "data": { "order": { "agreements": { "edges": [ { "node": { "id": "gid://shopify/SalesAgreement/621397082", "happenedAt": "2019-04-15T15:57:11Z", "sales": { "edges": [ { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 3, "totalAmount": { "shopMoney": { "amount": "31.05" } }, "lineItem": { "id": "gid://shopify/LineItem/114976433", "name": "Wall Climber - 158cm" } } }, { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 2, "totalAmount": { "shopMoney": { "amount": "20.7" } }, "lineItem": { "id": "gid://shopify/LineItem/763128379", "name": "Hill Zipper - 151cm" } } }, { "node": { "actionType": "ORDER", "lineType": "SHIPPING", "quantity": null, "totalAmount": { "shopMoney": { "amount": "5.0" } } } } ] } } }, { "node": { "id": "gid://shopify/SalesAgreement/731429684", "happenedAt": "2019-04-16T11:52:10Z", "sales": { "edges": [ { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 2, "totalAmount": { "shopMoney": { "amount": "38.28" } }, "lineItem": { "id": "gid://shopify/LineItem/1001351938", "name": "Custom Zebra" } } }, { "node": { "actionType": "RETURN", "lineType": "PRODUCT", "quantity": -2, "totalAmount": { "shopMoney": { "amount": "-20.7" } }, "lineItem": { "id": "gid://shopify/LineItem/114976433", "name": "Wall Climber - 158cm" } } }, { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 2, "totalAmount": { "shopMoney": { "amount": "20.7" } }, "lineItem": { "id": "gid://shopify/LineItem/763128379", "name": "Hill Zipper - 151cm" } } } ] } } } ] } } } }
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 shippingLinesByOrder($id: ID!) { order(id: $id) { shippingLines(first: 10, includeRemovals: true) { edges { node { id title isRemoved } } } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Order/816964372\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Order/816964372\"\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 shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Order/816964372\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"id\" => \"gid://shopify/Order/816964372\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Order/816964372\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n}"
input: { "id": "gid://shopify/Order/816964372" }
response: { "data": { "order": { "shippingLines": { "edges": [ { "node": { "id": "gid://shopify/ShippingLine/816964372", "title": "Ground Service", "isRemoved": true } }, { "node": { "id": "gid://shopify/ShippingLine/1072813969", "title": "Some shipping charge", "isRemoved": false } } ] } } } }
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 suggestedRefund { order(id: \\\"gid://shopify/Order/469306983\\\") { suggestedRefund(refundDuties: [{dutyId: \\\"gid://shopify/Duty/1064114503\\\", refundType: FULL}]) { refundDuties { amountSet { shopMoney { amount currencyCode } } originalDuty { id } } totalDutiesSet { shopMoney { amount currencyCode } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\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 suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\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 suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\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 suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n}"
input: null
response: { "data": { "order": { "suggestedRefund": { "refundDuties": [ { "amountSet": { "shopMoney": { "amount": "8.97", "currencyCode": "USD" } }, "originalDuty": { "id": "gid://shopify/Duty/1064114503" } } ], "totalDutiesSet": { "shopMoney": { "amount": "8.97", "currencyCode": "USD" } } } } } }
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 suggestedRefund { order(id: \\\"gid://shopify/Order/469306983\\\") { suggestedRefund(refundLineItems: [{lineItemId: \\\"gid://shopify/LineItem/983004162\\\", quantity: 1}], refundDuties: [{dutyId: \\\"gid://shopify/Duty/1064114503\\\", refundType: PROPORTIONAL}]) { refundDuties { amountSet { shopMoney { amount currencyCode } } originalDuty { id } } totalDutiesSet { shopMoney { amount currencyCode } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\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 suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\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 suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\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 suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n}"
input: null
response: { "data": { "order": { "suggestedRefund": { "refundDuties": [ { "amountSet": { "shopMoney": { "amount": "8.97", "currencyCode": "USD" } }, "originalDuty": { "id": "gid://shopify/Duty/1064114503" } } ], "totalDutiesSet": { "shopMoney": { "amount": "8.97", "currencyCode": "USD" } } } } } }
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 { order(id: \\\"gid://shopify/Order/148977776\\\") { name } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order(id: \"gid://shopify/Order/148977776\") {\n name\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 order(id: \"gid://shopify/Order/148977776\") {\n name\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 order(id: \"gid://shopify/Order/148977776\") {\n name\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 order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n}"
input: null
response: { "data": { "order": { "name": "#1001" } } }
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 { order(id: \\\"gid://shopify/Order/469306983\\\") { currentTotalDutiesSet { shopMoney { amount } } lineItems(first: 10) { edges { node { id name refundableQuantity duties { id harmonizedSystemCode price { shopMoney { amount } } } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\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 order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\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 order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\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 order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\n }\n }\n }\n }\n }\n}"
input: null
response: { "data": { "order": { "currentTotalDutiesSet": { "shopMoney": { "amount": "8.97" } }, "lineItems": { "edges": [ { "node": { "id": "gid://shopify/LineItem/983004162", "name": "Element - 151cm", "refundableQuantity": 1, "duties": [ { "id": "gid://shopify/Duty/1064114503", "harmonizedSystemCode": "91051930", "price": { "shopMoney": { "amount": "8.97" } } } ] } } ] } } } }
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 TransactionsCountForOrder($orderId: ID!) { order(id: $orderId) { transactionsCount { count } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\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 TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n }\nQUERY;\n\n$variables = [\n \"orderId\" => \"gid://shopify/Order/148977776\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n}"
input: { "orderId": "gid://shopify/Order/148977776" }
response: { "data": { "order": { "transactionsCount": { "count": 4 } } } }
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 FulfillmentsCount($orderId: ID!) { order(id: $orderId) { fulfillmentsCount { count } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\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 FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n }\nQUERY;\n\n$variables = [\n \"orderId\" => \"gid://shopify/Order/148977776\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n}"
input: { "orderId": "gid://shopify/Order/148977776" }
response: { "data": { "order": { "fulfillmentsCount": { "count": 0 } } } }
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 OrderRiskAssessmentsList($orderId: ID!) { order(id: $orderId) { risk { assessments { riskLevel provider { title } facts { description sentiment } } recommendation } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/647667644\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/647667644\"\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 OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/647667644\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n }\nQUERY;\n\n$variables = [\n \"orderId\" => \"gid://shopify/Order/647667644\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/647667644\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n}"
input: { "orderId": "gid://shopify/Order/647667644" }
response: { "data": { "order": { "risk": { "assessments": [ { "riskLevel": "HIGH", "provider": null, "facts": [ { "description": "The order is high risk.", "sentiment": "NEGATIVE" } ] }, { "riskLevel": "MEDIUM", "provider": { "title": "Private Mobile App for Channel" }, "facts": [] } ], "recommendation": "NONE" } } } }
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 FulfillmentOrderList($orderId: ID!) { order(id: $orderId) { fulfillmentOrders(first: 250) { nodes { id createdAt updatedAt requestStatus status fulfillAt destination { id address1 address2 city company countryCode email firstName lastName phone province zip } lineItems(first: 250) { nodes { id totalQuantity inventoryItemId remainingQuantity variant { id } } } internationalDuties { incoterm } fulfillmentHolds { reason reasonNotes } fulfillBy deliveryMethod { id methodType minDeliveryDateTime maxDeliveryDateTime additionalInformation { instructions phone } serviceCode sourceReference presentedName brandedPromise { handle name } } assignedLocation { address1 address2 city countryCode location { id } name phone province zip } merchantRequests(first: 250) { nodes { message requestOptions kind } } } } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\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 FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"orderId\" => \"gid://shopify/Order/148977776\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n}"
input: { "orderId": "gid://shopify/Order/148977776" }
response: { "data": { "order": { "fulfillmentOrders": { "nodes": [ { "id": "gid://shopify/FulfillmentOrder/564786110", "createdAt": "2024-11-20T18:26:47Z", "updatedAt": "2024-11-20T18:26:47Z", "requestStatus": "UNSUBMITTED", "status": "OPEN", "fulfillAt": null, "destination": { "id": "gid://shopify/FulfillmentOrderDestination/402903185", "address1": "123 Amoebobacterieae St", "address2": "Unit 806", "city": "Ottawa", "company": "", "countryCode": "CA", "email": "bob@example.com", "firstName": "Bob", "lastName": "Bobsen", "phone": "(555)555-5555", "province": "Ontario", "zip": "K2P0V6" }, "lineItems": { "nodes": [ { "id": "gid://shopify/FulfillmentOrderLineItem/445529754", "totalQuantity": 1, "inventoryItemId": "gid://shopify/InventoryItem/43729076", "remainingQuantity": 1, "variant": { "id": "gid://shopify/ProductVariant/43729076" } } ] }, "internationalDuties": { "incoterm": "DAP" }, "fulfillmentHolds": [], "fulfillBy": null, "deliveryMethod": { "id": "gid://shopify/DeliveryMethod/889454384", "methodType": "SHIPPING", "minDeliveryDateTime": null, "maxDeliveryDateTime": null, "additionalInformation": { "instructions": null, "phone": null }, "serviceCode": null, "sourceReference": null, "presentedName": null, "brandedPromise": null }, "assignedLocation": { "address1": "190 MacLaren Street", "address2": null, "city": "Ottawa", "countryCode": "CA", "location": { "id": "gid://shopify/Location/124656943" }, "name": "Shipping Origin", "phone": null, "province": "Ontario", "zip": "K2P 0L6" }, "merchantRequests": { "nodes": [] } } ] } } } }
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 RefundList($orderId: ID!) { order(id: $orderId) { refunds(first: 10) { id note totalRefundedSet { presentmentMoney { amount currencyCode } } } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/647667644\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/647667644\"\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 RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/647667644\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"orderId\" => \"gid://shopify/Order/647667644\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/647667644\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n}"
input: { "orderId": "gid://shopify/Order/647667644" }
response: { "data": { "order": { "refunds": [] } } }
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 TransactionsForOrder($orderId: ID!) { order(id: $orderId) { transactions(first: 10) { accountNumber amountSet { presentmentMoney { amount currencyCode } shopMoney { amount currencyCode } } authorizationCode authorizationExpiresAt createdAt errorCode fees { amount { amount currencyCode } } formattedGateway gateway id kind manuallyCapturable maximumRefundableV2 { amount currencyCode } multiCapturable order { id } parentTransaction { id } paymentDetails { ... on CardPaymentDetails { paymentMethodName } ... on ShopPayInstallmentsPaymentDetails { paymentMethodName } } paymentIcon { url } paymentId processedAt receiptJson settlementCurrency shopifyPaymentsSet { refundSet { acquirerReferenceNumber } } status test totalUnsettledSet { presentmentMoney { amount currencyCode } shopMoney { amount currencyCode } } user { id } } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\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 TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"orderId\" => \"gid://shopify/Order/148977776\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n}"
input: { "orderId": "gid://shopify/Order/148977776" }
response: { "data": { "order": { "transactions": [ { "accountNumber": "", "amountSet": { "presentmentMoney": { "amount": "11.5", "currencyCode": "USD" }, "shopMoney": { "amount": "11.5", "currencyCode": "USD" } }, "authorizationCode": "0", "authorizationExpiresAt": null, "createdAt": "2005-07-31T15:57:10Z", "errorCode": null, "fees": [], "formattedGateway": "(For Testing) Bogus Gateway", "gateway": "bogus", "id": "gid://shopify/OrderTransaction/42239183", "kind": "AUTHORIZATION", "manuallyCapturable": false, "maximumRefundableV2": null, "multiCapturable": true, "order": { "id": "gid://shopify/Order/148977776" }, "parentTransaction": null, "paymentDetails": null, "paymentIcon": null, "paymentId": "c148977776.1", "processedAt": "2005-07-31T15:57:10Z", "receiptJson": "{\"testcase\":true,\"response_code\":3,\"response_reason_code\":\"16\",\"response_reason_text\":\"The transaction cannot be found.\",\"avs_result_code\":\"P\",\"transaction_id\":\"0\",\"card_code\":\"M\"}", "settlementCurrency": null, "shopifyPaymentsSet": null, "status": "FAILURE", "test": false, "totalUnsettledSet": { "presentmentMoney": { "amount": "0.0", "currencyCode": "USD" }, "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "user": null }, { "accountNumber": "", "amountSet": { "presentmentMoney": { "amount": "50.0", "currencyCode": "USD" }, "shopMoney": { "amount": "50.0", "currencyCode": "USD" } }, "authorizationCode": null, "authorizationExpiresAt": null, "createdAt": "2005-07-31T15:57:11Z", "errorCode": null, "fees": [], "formattedGateway": "(For Testing) Bogus Gateway", "gateway": "bogus", "id": "gid://shopify/OrderTransaction/607668304", "kind": "SALE", "manuallyCapturable": false, "maximumRefundableV2": null, "multiCapturable": true, "order": { "id": "gid://shopify/Order/148977776" }, "parentTransaction": null, "paymentDetails": null, "paymentIcon": null, "paymentId": "c148977776.3", "processedAt": "2005-07-31T15:57:11Z", "receiptJson": "{\"testcase\":true}", "settlementCurrency": null, "shopifyPaymentsSet": null, "status": "AWAITING_RESPONSE", "test": false, "totalUnsettledSet": { "presentmentMoney": { "amount": "0.0", "currencyCode": "USD" }, "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "user": null }, { "accountNumber": "•••• •••• •••• 4242", "amountSet": { "presentmentMoney": { "amount": "11.5", "currencyCode": "USD" }, "shopMoney": { "amount": "11.5", "currencyCode": "USD" } }, "authorizationCode": "1001", "authorizationExpiresAt": null, "createdAt": "2005-07-31T15:57:10Z", "errorCode": null, "fees": [], "formattedGateway": "(For Testing) Bogus Gateway", "gateway": "bogus", "id": "gid://shopify/OrderTransaction/661056787", "kind": "AUTHORIZATION", "manuallyCapturable": false, "maximumRefundableV2": null, "multiCapturable": true, "order": { "id": "gid://shopify/Order/148977776" }, "parentTransaction": null, "paymentDetails": { "paymentMethodName": "card" }, "paymentIcon": { "url": "https://cdn.shopify.com/shopifycloud/shopify/assets/payment_icons/visa-319d545c6fd255c9aad5eeaad21fd6f7f7b4fdbdb1a35ce83b89cca12a187f00.svg.png" }, "paymentId": "c148977776.1", "processedAt": "2005-07-31T15:57:10Z", "receiptJson": "{\"testcase\":true,\"response_code\":1,\"response_reason_code\":\"1\",\"response_reason_text\":\"This transaction has been approved.\",\"avs_result_code\":\"Y\",\"transaction_id\":\"123456789\",\"card_code\":\"M\"}", "settlementCurrency": null, "shopifyPaymentsSet": null, "status": "SUCCESS", "test": false, "totalUnsettledSet": { "presentmentMoney": { "amount": "0.0", "currencyCode": "USD" }, "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "user": null }, { "accountNumber": "•••• •••• •••• 4242", "amountSet": { "presentmentMoney": { "amount": "11.5", "currencyCode": "USD" }, "shopMoney": { "amount": "11.5", "currencyCode": "USD" } }, "authorizationCode": "1000", "authorizationExpiresAt": null, "createdAt": "2005-07-31T15:57:11Z", "errorCode": null, "fees": [], "formattedGateway": "(For Testing) Bogus Gateway", "gateway": "bogus", "id": "gid://shopify/OrderTransaction/999225631", "kind": "CAPTURE", "manuallyCapturable": false, "maximumRefundableV2": null, "multiCapturable": true, "order": { "id": "gid://shopify/Order/148977776" }, "parentTransaction": { "id": "gid://shopify/OrderTransaction/661056787" }, "paymentDetails": { "paymentMethodName": "card" }, "paymentIcon": { "url": "https://cdn.shopify.com/shopifycloud/shopify/assets/payment_icons/visa-319d545c6fd255c9aad5eeaad21fd6f7f7b4fdbdb1a35ce83b89cca12a187f00.svg.png" }, "paymentId": "c148977776.2", "processedAt": "2005-07-31T15:57:11Z", "receiptJson": "{\"testcase\":true}", "settlementCurrency": null, "shopifyPaymentsSet": null, "status": "SUCCESS", "test": false, "totalUnsettledSet": { "presentmentMoney": { "amount": "0.0", "currencyCode": "USD" }, "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "user": null } ] } } }
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 FulfillmentList($orderId: ID!) { order(id: $orderId) { fulfillments(first: 10) { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\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 FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"orderId\" => \"gid://shopify/Order/148977776\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n}"
input: { "orderId": "gid://shopify/Order/148977776" }
response: { "data": { "order": { "fulfillments": [] } } }