Version: unstable
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { draftOrder(id: \\\"gid://shopify/DraftOrder/276395349\\\") { name } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\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 draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\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 draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\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 draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n name\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n name\n }\n}"
input: null
response: { "data": { "draftOrder": { "name": "#D1" } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { draftOrder1: draftOrder(id: \\\"gid://shopify/DraftOrder/276395349\\\") { name } draftOrder2: draftOrder(id: \\\"gid://shopify/DraftOrder/221448317\\\") { name } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n draftOrder1: draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n name\n }\n draftOrder2: draftOrder(id: \"gid://shopify/DraftOrder/221448317\") {\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 draftOrder1: draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n name\n }\n draftOrder2: draftOrder(id: \"gid://shopify/DraftOrder/221448317\") {\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 draftOrder1: draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n name\n }\n draftOrder2: draftOrder(id: \"gid://shopify/DraftOrder/221448317\") {\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 draftOrder1: draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n name\n }\n draftOrder2: draftOrder(id: \"gid://shopify/DraftOrder/221448317\") {\n name\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n draftOrder1: draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n name\n }\n draftOrder2: draftOrder(id: \"gid://shopify/DraftOrder/221448317\") {\n name\n }\n}"
input: null
response: { "data": { "draftOrder1": { "name": "#D1" }, "draftOrder2": { "name": "#D7" } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { draftOrder(id: \\\"gid://shopify/DraftOrder/276395349\\\") { lineItems(first: 5) { edges { node { name } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n lineItems(first: 5) {\n edges {\n node {\n name\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 draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n lineItems(first: 5) {\n edges {\n node {\n name\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 draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n lineItems(first: 5) {\n edges {\n node {\n name\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 draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n lineItems(first: 5) {\n edges {\n node {\n name\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n draftOrder(id: \"gid://shopify/DraftOrder/276395349\") {\n lineItems(first: 5) {\n edges {\n node {\n name\n }\n }\n }\n }\n}"
input: null
response: { "data": { "draftOrder": { "lineItems": { "edges": [ { "node": { "name": "Boots - Default" } } ] } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query DraftOrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) { draftOrder(id: $ownerId) { purchaseOrder: metafield(namespace: $namespace, key: $key) { value } } }\",\n \"variables\": {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/DraftOrder/276395349\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query DraftOrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349\"\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 DraftOrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349\"\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 DraftOrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349\",\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 DraftOrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query DraftOrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n draftOrder(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n}"
input: { "namespace": "my_fields", "key": "purchase_order", "ownerId": "gid://shopify/DraftOrder/276395349" }
response: { "data": { "draftOrder": { "purchaseOrder": { "value": "123" } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query DraftOrderMetafields($ownerId: ID!) { draftOrder(id: $ownerId) { metafields(first: 3) { edges { node { namespace key value } } } } }\",\n \"variables\": {\n \"ownerId\": \"gid://shopify/DraftOrder/276395349\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query DraftOrderMetafields($ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349\"\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 DraftOrderMetafields($ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349\"\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 DraftOrderMetafields($ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349\",\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 DraftOrderMetafields($ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query DraftOrderMetafields($ownerId: ID!) {\n draftOrder(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/DraftOrder/276395349" }
response: { "data": { "draftOrder": { "metafields": { "edges": [ { "node": { "namespace": "my_fields", "key": "purchase_order", "value": "123" } } ] } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query DraftOrder($id: ID!) { draftOrder(id: $id) { id note2 email taxesIncluded currencyCode invoiceSentAt createdAt updatedAt taxExempt completedAt name status lineItems(first: 10) { edges { node { id variant { id title } product { id } name sku vendor quantity requiresShipping taxable isGiftCard fulfillmentService { type } weight { unit value } taxLines { title source rate ratePercentage priceSet { presentmentMoney { amount currencyCode } shopMoney { amount currencyCode } } } appliedDiscount { title value valueType } name custom id } } } shippingAddress { firstName address1 phone city zip province country lastName address2 company latitude longitude name country countryCodeV2 provinceCode } billingAddress { firstName address1 phone city zip province country lastName address2 company latitude longitude name country countryCodeV2 provinceCode } invoiceUrl appliedDiscount { title value valueType } order { id customAttributes { key value } } shippingLine { id title carrierIdentifier custom code deliveryCategory source discountedPriceSet { presentmentMoney { amount currencyCode } shopMoney { amount currencyCode } } } taxLines { channelLiable priceSet { presentmentMoney { amount currencyCode } shopMoney { amount currencyCode } } rate ratePercentage source title } tags customer { id email smsMarketingConsent { consentCollectedFrom consentUpdatedAt marketingOptInLevel marketingState } emailMarketingConsent { consentUpdatedAt marketingOptInLevel marketingState } createdAt updatedAt firstName lastName state amountSpent { amount currencyCode } lastOrder { id name currencyCode } note verifiedEmail multipassIdentifier taxExempt tags phone taxExemptions defaultAddress { id firstName lastName company address1 address2 city province country zip phone name provinceCode countryCodeV2 } } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/DraftOrder/221448317\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query DraftOrder($id: ID!) {\n draftOrder(id: $id) {\n id\n note2\n email\n taxesIncluded\n currencyCode\n invoiceSentAt\n createdAt\n updatedAt\n taxExempt\n completedAt\n name\n status\n lineItems(first: 10) {\n edges {\n node {\n id\n variant {\n id\n title\n }\n product {\n id\n }\n name\n sku\n vendor\n quantity\n requiresShipping\n taxable\n isGiftCard\n fulfillmentService {\n type\n }\n weight {\n unit\n value\n }\n taxLines {\n title\n source\n rate\n ratePercentage\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n appliedDiscount {\n title\n value\n valueType\n }\n name\n custom\n id\n }\n }\n }\n shippingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n billingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n invoiceUrl\n appliedDiscount {\n title\n value\n valueType\n }\n order {\n id\n customAttributes {\n key\n value\n }\n }\n shippingLine {\n id\n title\n carrierIdentifier\n custom\n code\n deliveryCategory\n source\n discountedPriceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n taxLines {\n channelLiable\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n rate\n ratePercentage\n source\n title\n }\n tags\n customer {\n id\n email\n smsMarketingConsent {\n consentCollectedFrom\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n emailMarketingConsent {\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n createdAt\n updatedAt\n firstName\n lastName\n state\n amountSpent {\n amount\n currencyCode\n }\n lastOrder {\n id\n name\n currencyCode\n }\n note\n verifiedEmail\n multipassIdentifier\n taxExempt\n tags\n phone\n taxExemptions\n defaultAddress {\n id\n firstName\n lastName\n company\n address1\n address2\n city\n province\n country\n zip\n phone\n name\n provinceCode\n countryCodeV2\n }\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/DraftOrder/221448317\"\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 DraftOrder($id: ID!) {\n draftOrder(id: $id) {\n id\n note2\n email\n taxesIncluded\n currencyCode\n invoiceSentAt\n createdAt\n updatedAt\n taxExempt\n completedAt\n name\n status\n lineItems(first: 10) {\n edges {\n node {\n id\n variant {\n id\n title\n }\n product {\n id\n }\n name\n sku\n vendor\n quantity\n requiresShipping\n taxable\n isGiftCard\n fulfillmentService {\n type\n }\n weight {\n unit\n value\n }\n taxLines {\n title\n source\n rate\n ratePercentage\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n appliedDiscount {\n title\n value\n valueType\n }\n name\n custom\n id\n }\n }\n }\n shippingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n billingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n invoiceUrl\n appliedDiscount {\n title\n value\n valueType\n }\n order {\n id\n customAttributes {\n key\n value\n }\n }\n shippingLine {\n id\n title\n carrierIdentifier\n custom\n code\n deliveryCategory\n source\n discountedPriceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n taxLines {\n channelLiable\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n rate\n ratePercentage\n source\n title\n }\n tags\n customer {\n id\n email\n smsMarketingConsent {\n consentCollectedFrom\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n emailMarketingConsent {\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n createdAt\n updatedAt\n firstName\n lastName\n state\n amountSpent {\n amount\n currencyCode\n }\n lastOrder {\n id\n name\n currencyCode\n }\n note\n verifiedEmail\n multipassIdentifier\n taxExempt\n tags\n phone\n taxExemptions\n defaultAddress {\n id\n firstName\n lastName\n company\n address1\n address2\n city\n province\n country\n zip\n phone\n name\n provinceCode\n countryCodeV2\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/DraftOrder/221448317\"\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 DraftOrder($id: ID!) {\n draftOrder(id: $id) {\n id\n note2\n email\n taxesIncluded\n currencyCode\n invoiceSentAt\n createdAt\n updatedAt\n taxExempt\n completedAt\n name\n status\n lineItems(first: 10) {\n edges {\n node {\n id\n variant {\n id\n title\n }\n product {\n id\n }\n name\n sku\n vendor\n quantity\n requiresShipping\n taxable\n isGiftCard\n fulfillmentService {\n type\n }\n weight {\n unit\n value\n }\n taxLines {\n title\n source\n rate\n ratePercentage\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n appliedDiscount {\n title\n value\n valueType\n }\n name\n custom\n id\n }\n }\n }\n shippingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n billingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n invoiceUrl\n appliedDiscount {\n title\n value\n valueType\n }\n order {\n id\n customAttributes {\n key\n value\n }\n }\n shippingLine {\n id\n title\n carrierIdentifier\n custom\n code\n deliveryCategory\n source\n discountedPriceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n taxLines {\n channelLiable\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n rate\n ratePercentage\n source\n title\n }\n tags\n customer {\n id\n email\n smsMarketingConsent {\n consentCollectedFrom\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n emailMarketingConsent {\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n createdAt\n updatedAt\n firstName\n lastName\n state\n amountSpent {\n amount\n currencyCode\n }\n lastOrder {\n id\n name\n currencyCode\n }\n note\n verifiedEmail\n multipassIdentifier\n taxExempt\n tags\n phone\n taxExemptions\n defaultAddress {\n id\n firstName\n lastName\n company\n address1\n address2\n city\n province\n country\n zip\n phone\n name\n provinceCode\n countryCodeV2\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"id\" => \"gid://shopify/DraftOrder/221448317\",\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 DraftOrder($id: ID!) {\n draftOrder(id: $id) {\n id\n note2\n email\n taxesIncluded\n currencyCode\n invoiceSentAt\n createdAt\n updatedAt\n taxExempt\n completedAt\n name\n status\n lineItems(first: 10) {\n edges {\n node {\n id\n variant {\n id\n title\n }\n product {\n id\n }\n name\n sku\n vendor\n quantity\n requiresShipping\n taxable\n isGiftCard\n fulfillmentService {\n type\n }\n weight {\n unit\n value\n }\n taxLines {\n title\n source\n rate\n ratePercentage\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n appliedDiscount {\n title\n value\n valueType\n }\n name\n custom\n id\n }\n }\n }\n shippingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n billingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n invoiceUrl\n appliedDiscount {\n title\n value\n valueType\n }\n order {\n id\n customAttributes {\n key\n value\n }\n }\n shippingLine {\n id\n title\n carrierIdentifier\n custom\n code\n deliveryCategory\n source\n discountedPriceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n taxLines {\n channelLiable\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n rate\n ratePercentage\n source\n title\n }\n tags\n customer {\n id\n email\n smsMarketingConsent {\n consentCollectedFrom\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n emailMarketingConsent {\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n createdAt\n updatedAt\n firstName\n lastName\n state\n amountSpent {\n amount\n currencyCode\n }\n lastOrder {\n id\n name\n currencyCode\n }\n note\n verifiedEmail\n multipassIdentifier\n taxExempt\n tags\n phone\n taxExemptions\n defaultAddress {\n id\n firstName\n lastName\n company\n address1\n address2\n city\n province\n country\n zip\n phone\n name\n provinceCode\n countryCodeV2\n }\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/DraftOrder/221448317\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query DraftOrder($id: ID!) {\n draftOrder(id: $id) {\n id\n note2\n email\n taxesIncluded\n currencyCode\n invoiceSentAt\n createdAt\n updatedAt\n taxExempt\n completedAt\n name\n status\n lineItems(first: 10) {\n edges {\n node {\n id\n variant {\n id\n title\n }\n product {\n id\n }\n name\n sku\n vendor\n quantity\n requiresShipping\n taxable\n isGiftCard\n fulfillmentService {\n type\n }\n weight {\n unit\n value\n }\n taxLines {\n title\n source\n rate\n ratePercentage\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n appliedDiscount {\n title\n value\n valueType\n }\n name\n custom\n id\n }\n }\n }\n shippingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n billingAddress {\n firstName\n address1\n phone\n city\n zip\n province\n country\n lastName\n address2\n company\n latitude\n longitude\n name\n country\n countryCodeV2\n provinceCode\n }\n invoiceUrl\n appliedDiscount {\n title\n value\n valueType\n }\n order {\n id\n customAttributes {\n key\n value\n }\n }\n shippingLine {\n id\n title\n carrierIdentifier\n custom\n code\n deliveryCategory\n source\n discountedPriceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n taxLines {\n channelLiable\n priceSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n rate\n ratePercentage\n source\n title\n }\n tags\n customer {\n id\n email\n smsMarketingConsent {\n consentCollectedFrom\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n emailMarketingConsent {\n consentUpdatedAt\n marketingOptInLevel\n marketingState\n }\n createdAt\n updatedAt\n firstName\n lastName\n state\n amountSpent {\n amount\n currencyCode\n }\n lastOrder {\n id\n name\n currencyCode\n }\n note\n verifiedEmail\n multipassIdentifier\n taxExempt\n tags\n phone\n taxExemptions\n defaultAddress {\n id\n firstName\n lastName\n company\n address1\n address2\n city\n province\n country\n zip\n phone\n name\n provinceCode\n countryCodeV2\n }\n }\n }\n}"
input: { "id": "gid://shopify/DraftOrder/221448317" }
response: { "data": { "draftOrder": { "id": "gid://shopify/DraftOrder/221448317", "note2": "gift", "email": "bobsemail@shopify.com", "taxesIncluded": false, "currencyCode": "USD", "invoiceSentAt": null, "createdAt": "2017-01-01T00:00:00Z", "updatedAt": "2021-12-01T12:43:00Z", "taxExempt": false, "completedAt": null, "name": "#D7", "status": "OPEN", "lineItems": { "edges": [ { "node": { "id": "gid://shopify/DraftOrderLineItem/227425250", "variant": { "id": "gid://shopify/ProductVariant/330284860", "title": "Default" }, "product": { "id": "gid://shopify/Product/558169081" }, "name": "Unpublished Boots - Default", "sku": "unpublished_boots-12", "vendor": "Greedy Boot Maker", "quantity": 5, "requiresShipping": true, "taxable": true, "isGiftCard": false, "fulfillmentService": { "type": "MANUAL" }, "weight": { "unit": "GRAMS", "value": 10.0 }, "taxLines": [ { "title": "GST", "source": "Shopify", "rate": 0.07, "ratePercentage": 7.0, "priceSet": { "presentmentMoney": { "amount": "42.53", "currencyCode": "USD" }, "shopMoney": { "amount": "42.53", "currencyCode": "USD" } } }, { "title": "PST", "source": "Shopify", "rate": 0.08, "ratePercentage": 8.0, "priceSet": { "presentmentMoney": { "amount": "48.6", "currencyCode": "USD" }, "shopMoney": { "amount": "48.6", "currencyCode": "USD" } } } ], "appliedDiscount": null, "custom": false } }, { "node": { "id": "gid://shopify/DraftOrderLineItem/446166744", "variant": { "id": "gid://shopify/ProductVariant/445365074", "title": "Medium" }, "product": { "id": "gid://shopify/Product/910489600" }, "name": "Crafty Shoes - Green", "sku": "crappy_shoes_green", "vendor": "Crappy Cobbler", "quantity": 2, "requiresShipping": false, "taxable": true, "isGiftCard": false, "fulfillmentService": { "type": "MANUAL" }, "weight": { "unit": "GRAMS", "value": 10.0 }, "taxLines": [ { "title": "PST", "source": "Shopify", "rate": 0.08, "ratePercentage": 8.0, "priceSet": { "presentmentMoney": { "amount": "13.68", "currencyCode": "USD" }, "shopMoney": { "amount": "13.68", "currencyCode": "USD" } } }, { "title": "GST", "source": "Shopify", "rate": 0.07, "ratePercentage": 7.0, "priceSet": { "presentmentMoney": { "amount": "11.97", "currencyCode": "USD" }, "shopMoney": { "amount": "11.97", "currencyCode": "USD" } } } ], "appliedDiscount": { "title": null, "value": 5.0, "valueType": "FIXED_AMOUNT" }, "custom": false } }, { "node": { "id": "gid://shopify/DraftOrderLineItem/654123718", "variant": null, "product": null, "name": "Fingerless wool gloves", "sku": "fingerless_wool_gloves", "vendor": "Bear Hands", "quantity": 2, "requiresShipping": true, "taxable": true, "isGiftCard": false, "fulfillmentService": { "type": "MANUAL" }, "weight": { "unit": "GRAMS", "value": 50.0 }, "taxLines": [ { "title": "PST", "source": "Shopify", "rate": 0.08, "ratePercentage": 8.0, "priceSet": { "presentmentMoney": { "amount": "10.8", "currencyCode": "USD" }, "shopMoney": { "amount": "10.8", "currencyCode": "USD" } } }, { "title": "GST", "source": "Shopify", "rate": 0.07, "ratePercentage": 7.0, "priceSet": { "presentmentMoney": { "amount": "9.45", "currencyCode": "USD" }, "shopMoney": { "amount": "9.45", "currencyCode": "USD" } } } ], "appliedDiscount": null, "custom": true } } ] }, "shippingAddress": { "firstName": "Bob", "address1": "123 Amoebobacterieae St", "phone": "+1(613)555-1212", "city": "Ottawa", "zip": "K2P0V6", "province": "Ontario", "country": "Canada", "lastName": "Bobsen", "address2": "", "company": "", "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Bobsen", "countryCodeV2": "CA", "provinceCode": "ON" }, "billingAddress": { "firstName": "Bob", "address1": "123 Amoebobacterieae St", "phone": "+1(613)555-1212", "city": "Ottawa", "zip": "K2P0V6", "province": "Ontario", "country": "Canada", "lastName": "Bobsen", "address2": "", "company": "", "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Bobsen", "countryCodeV2": "CA", "provinceCode": "ON" }, "invoiceUrl": "https://www.snowdevil.ca/26371970/invoices/ba8dcf6c022ccad3d47e3909e378e22f", "appliedDiscount": { "title": "Custom", "value": 10.0, "valueType": "PERCENTAGE" }, "order": null, "shippingLine": { "id": "gid://shopify/ShippingLine/671422168?type=draft_order", "title": "custom shipping", "carrierIdentifier": null, "custom": true, "code": "custom", "deliveryCategory": "shipping", "source": "shopify", "discountedPriceSet": { "presentmentMoney": { "amount": "12.25", "currencyCode": "USD" }, "shopMoney": { "amount": "12.25", "currencyCode": "USD" } } }, "taxLines": [ { "channelLiable": null, "priceSet": { "presentmentMoney": { "amount": "73.08", "currencyCode": "USD" }, "shopMoney": { "amount": "73.08", "currencyCode": "USD" } }, "rate": 0.08, "ratePercentage": 8.0, "source": null, "title": "PST" }, { "channelLiable": null, "priceSet": { "presentmentMoney": { "amount": "63.95", "currencyCode": "USD" }, "shopMoney": { "amount": "63.95", "currencyCode": "USD" } }, "rate": 0.07, "ratePercentage": 7.0, "source": null, "title": "GST" } ], "tags": [ "High priority", "Wholesale" ], "customer": { "id": "gid://shopify/Customer/544365967", "email": "bob@example.com", "smsMarketingConsent": { "consentCollectedFrom": "OTHER", "consentUpdatedAt": "2021-06-16T17:31:44Z", "marketingOptInLevel": "SINGLE_OPT_IN", "marketingState": "SUBSCRIBED" }, "emailMarketingConsent": { "consentUpdatedAt": "2005-06-16T15:00:11Z", "marketingOptInLevel": "SINGLE_OPT_IN", "marketingState": "SUBSCRIBED" }, "createdAt": "2005-06-15T15:57:11Z", "updatedAt": "2005-06-16T15:57:11Z", "firstName": "Bob", "lastName": "Bobsen", "state": "ENABLED", "amountSpent": { "amount": "8305.6", "currencyCode": "USD" }, "lastOrder": null, "note": null, "verifiedEmail": true, "multipassIdentifier": null, "taxExempt": false, "tags": [ "Bob", "Canadian", "Léon", "Noël" ], "phone": "+13125551212", "taxExemptions": [], "defaultAddress": { "id": "gid://shopify/MailingAddress/544365967?model_name=CustomerAddress", "firstName": "Bob", "lastName": "Bobsen", "company": "", "address1": "123 Amoebobacterieae St", "address2": "", "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "K2P0V6", "phone": "+1(613)555-1212", "name": "Bob Bobsen", "provinceCode": "ON", "countryCodeV2": "CA" } } } } }