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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id totalTaxSet { shopMoney { amount currencyCode } } lineItems(first: 5) { nodes { variant { id } id title quantity taxLines { title rate priceSet { shopMoney { amount currencyCode } } } } } } } }\",\n \"variables\": {\n \"order\": {\n \"currency\": \"EUR\",\n \"lineItems\": [\n {\n \"title\": \"Big Brown Bear Boots\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 74.99,\n \"currencyCode\": \"EUR\"\n }\n },\n \"quantity\": 3,\n \"taxLines\": [\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 10.2,\n \"currencyCode\": \"EUR\"\n }\n },\n \"rate\": 0.06,\n \"title\": \"State tax\"\n }\n ]\n }\n ],\n \"transactions\": [\n {\n \"kind\": \"SALE\",\n \"status\": \"SUCCESS\",\n \"amountSet\": {\n \"shopMoney\": {\n \"amount\": 238.47,\n \"currencyCode\": \"EUR\"\n }\n }\n }\n ]\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n lineItems(first: 5) {\n nodes {\n variant {\n id\n }\n id\n title\n quantity\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"currency\": \"EUR\",\n \"lineItems\": [\n {\n \"title\": \"Big Brown Bear Boots\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 74.99,\n \"currencyCode\": \"EUR\"\n }\n },\n \"quantity\": 3,\n \"taxLines\": [\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 10.2,\n \"currencyCode\": \"EUR\"\n }\n },\n \"rate\": 0.06,\n \"title\": \"State tax\"\n }\n ]\n }\n ],\n \"transactions\": [\n {\n \"kind\": \"SALE\",\n \"status\": \"SUCCESS\",\n \"amountSet\": {\n \"shopMoney\": {\n \"amount\": 238.47,\n \"currencyCode\": \"EUR\"\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n lineItems(first: 5) {\n nodes {\n variant {\n id\n }\n id\n title\n quantity\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"currency\": \"EUR\",\n \"lineItems\": [{\"title\"=>\"Big Brown Bear Boots\", \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>74.99, \"currencyCode\"=>\"EUR\"}}, \"quantity\"=>3, \"taxLines\"=>[{\"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>10.2, \"currencyCode\"=>\"EUR\"}}, \"rate\"=>0.06, \"title\"=>\"State tax\"}]}],\n \"transactions\": [{\"kind\"=>\"SALE\", \"status\"=>\"SUCCESS\", \"amountSet\"=>{\"shopMoney\"=>{\"amount\"=>238.47, \"currencyCode\"=>\"EUR\"}}}]\n }\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 = <<[\n \"currency\" => \"EUR\",\n \"lineItems\" => [{\"title\"=>\"Big Brown Bear Boots\", \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>74.99, \"currencyCode\"=>\"EUR\"}}, \"quantity\"=>3, \"taxLines\"=>[{\"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>10.2, \"currencyCode\"=>\"EUR\"}}, \"rate\"=>0.06, \"title\"=>\"State tax\"}]}],\n \"transactions\" => [{\"kind\"=>\"SALE\", \"status\"=>\"SUCCESS\", \"amountSet\"=>{\"shopMoney\"=>{\"amount\"=>238.47, \"currencyCode\"=>\"EUR\"}}}],\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n lineItems(first: 5) {\n nodes {\n variant {\n id\n }\n id\n title\n quantity\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"currency\": \"EUR\",\n \"lineItems\": [\n {\n \"title\": \"Big Brown Bear Boots\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 74.99,\n \"currencyCode\": \"EUR\"\n }\n },\n \"quantity\": 3,\n \"taxLines\": [\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 10.2,\n \"currencyCode\": \"EUR\"\n }\n },\n \"rate\": 0.06,\n \"title\": \"State tax\"\n }\n ]\n }\n ],\n \"transactions\": [\n {\n \"kind\": \"SALE\",\n \"status\": \"SUCCESS\",\n \"amountSet\": {\n \"shopMoney\": {\n \"amount\": 238.47,\n \"currencyCode\": \"EUR\"\n }\n }\n }\n ]\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n lineItems(first: 5) {\n nodes {\n variant {\n id\n }\n id\n title\n quantity\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\n}"
input: { "order": { "currency": "EUR", "lineItems": [ { "title": "Big Brown Bear Boots", "priceSet": { "shopMoney": { "amount": 74.99, "currencyCode": "EUR" } }, "quantity": 3, "taxLines": [ { "priceSet": { "shopMoney": { "amount": 10.2, "currencyCode": "EUR" } }, "rate": 0.06, "title": "State tax" } ] } ], "transactions": [ { "kind": "SALE", "status": "SUCCESS", "amountSet": { "shopMoney": { "amount": 238.47, "currencyCode": "EUR" } } } ] } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460049", "totalTaxSet": { "shopMoney": { "amount": "10.2", "currencyCode": "EUR" } }, "lineItems": { "nodes": [ { "variant": null, "id": "gid://shopify/LineItem/1071823273", "title": "Big Brown Bear Boots", "quantity": 3, "taxLines": [ { "title": "State tax", "rate": 0.06, "priceSet": { "shopMoney": { "amount": "10.2", "currencyCode": "EUR" } } } ] } ] } } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id displayFinancialStatus customer { email firstName lastName } } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customer\": {\n \"toUpsert\": {\n \"email\": \"foo.bar@shopify.com\",\n \"firstName\": \"Foo\",\n \"lastName\": \"Bar\"\n }\n },\n \"financialStatus\": \"PAID\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n customer {\n email\n firstName\n lastName\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customer\": {\n \"toUpsert\": {\n \"email\": \"foo.bar@shopify.com\",\n \"firstName\": \"Foo\",\n \"lastName\": \"Bar\"\n }\n },\n \"financialStatus\": \"PAID\"\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n customer {\n email\n firstName\n lastName\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"customer\": {\n \"toUpsert\": {\n \"email\": \"foo.bar@shopify.com\",\n \"firstName\": \"Foo\",\n \"lastName\": \"Bar\"\n }\n },\n \"financialStatus\": \"PAID\"\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"customer\" => [\n \"toUpsert\" => [\n \"email\" => \"foo.bar@shopify.com\",\n \"firstName\" => \"Foo\",\n \"lastName\" => \"Bar\",\n ],\n ],\n \"financialStatus\" => \"PAID\",\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n customer {\n email\n firstName\n lastName\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customer\": {\n \"toUpsert\": {\n \"email\": \"foo.bar@shopify.com\",\n \"firstName\": \"Foo\",\n \"lastName\": \"Bar\"\n }\n },\n \"financialStatus\": \"PAID\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n customer {\n email\n firstName\n lastName\n }\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ], "customer": { "toUpsert": { "email": "foo.bar@shopify.com", "firstName": "Foo", "lastName": "Bar" } }, "financialStatus": "PAID" } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460047", "displayFinancialStatus": "PAID", "customer": { "email": "foo.bar@shopify.com", "firstName": "Foo", "lastName": "Bar" } } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id displayFinancialStatus shippingAddress { lastName address1 city provinceCode countryCode zip } billingAddress { lastName address1 city provinceCode countryCode zip } customer { id } } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customerId\": \"gid://shopify/Customer/544365967\",\n \"financialStatus\": \"PENDING\",\n \"shippingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"billingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"321 Secondary St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n }\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n shippingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n billingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n customer {\n id\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customerId\": \"gid://shopify/Customer/544365967\",\n \"financialStatus\": \"PENDING\",\n \"shippingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"billingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"321 Secondary St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n shippingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n billingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n customer {\n id\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"customerId\": \"gid://shopify/Customer/544365967\",\n \"financialStatus\": \"PENDING\",\n \"shippingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"billingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"321 Secondary St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n }\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"customerId\" => \"gid://shopify/Customer/544365967\",\n \"financialStatus\" => \"PENDING\",\n \"shippingAddress\" => [\n \"lastName\" => \"James\",\n \"address1\" => \"123 Main St\",\n \"city\" => \"Ottawa\",\n \"countryCode\" => \"CA\",\n \"provinceCode\" => \"ON\",\n \"zip\" => \"K1P 1J1\",\n ],\n \"billingAddress\" => [\n \"lastName\" => \"James\",\n \"address1\" => \"321 Secondary St\",\n \"city\" => \"Ottawa\",\n \"countryCode\" => \"CA\",\n \"provinceCode\" => \"ON\",\n \"zip\" => \"K1P 1J1\",\n ],\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n shippingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n billingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n customer {\n id\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customerId\": \"gid://shopify/Customer/544365967\",\n \"financialStatus\": \"PENDING\",\n \"shippingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"billingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"321 Secondary St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n shippingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n billingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n customer {\n id\n }\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ], "customerId": "gid://shopify/Customer/544365967", "financialStatus": "PENDING", "shippingAddress": { "lastName": "James", "address1": "123 Main St", "city": "Ottawa", "countryCode": "CA", "provinceCode": "ON", "zip": "K1P 1J1" }, "billingAddress": { "lastName": "James", "address1": "321 Secondary St", "city": "Ottawa", "countryCode": "CA", "provinceCode": "ON", "zip": "K1P 1J1" } } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460044", "displayFinancialStatus": "PENDING", "shippingAddress": { "lastName": "James", "address1": "123 Main St", "city": "Ottawa", "provinceCode": "ON", "countryCode": "CA", "zip": "K1P 1J1" }, "billingAddress": { "lastName": "James", "address1": "321 Secondary St", "city": "Ottawa", "provinceCode": "ON", "countryCode": "CA", "zip": "K1P 1J1" }, "customer": { "id": "gid://shopify/Customer/544365967" } } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id displayFinancialStatus shippingAddress { lastName address1 city provinceCode countryCode zip } billingAddress { lastName address1 city provinceCode countryCode zip } customer { id } } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customer\": {\n \"toAssociate\": {\n \"id\": \"gid://shopify/Customer/544365967\"\n }\n },\n \"financialStatus\": \"PENDING\",\n \"shippingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"billingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"321 Secondary St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n }\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n shippingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n billingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n customer {\n id\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customer\": {\n \"toAssociate\": {\n \"id\": \"gid://shopify/Customer/544365967\"\n }\n },\n \"financialStatus\": \"PENDING\",\n \"shippingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"billingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"321 Secondary St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n shippingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n billingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n customer {\n id\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"customer\": {\n \"toAssociate\": {\n \"id\": \"gid://shopify/Customer/544365967\"\n }\n },\n \"financialStatus\": \"PENDING\",\n \"shippingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"billingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"321 Secondary St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n }\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"customer\" => [\n \"toAssociate\" => [\n \"id\" => \"gid://shopify/Customer/544365967\",\n ],\n ],\n \"financialStatus\" => \"PENDING\",\n \"shippingAddress\" => [\n \"lastName\" => \"James\",\n \"address1\" => \"123 Main St\",\n \"city\" => \"Ottawa\",\n \"countryCode\" => \"CA\",\n \"provinceCode\" => \"ON\",\n \"zip\" => \"K1P 1J1\",\n ],\n \"billingAddress\" => [\n \"lastName\" => \"James\",\n \"address1\" => \"321 Secondary St\",\n \"city\" => \"Ottawa\",\n \"countryCode\" => \"CA\",\n \"provinceCode\" => \"ON\",\n \"zip\" => \"K1P 1J1\",\n ],\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n shippingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n billingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n customer {\n id\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"customer\": {\n \"toAssociate\": {\n \"id\": \"gid://shopify/Customer/544365967\"\n }\n },\n \"financialStatus\": \"PENDING\",\n \"shippingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"billingAddress\": {\n \"lastName\": \"James\",\n \"address1\": \"321 Secondary St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n displayFinancialStatus\n shippingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n billingAddress {\n lastName\n address1\n city\n provinceCode\n countryCode\n zip\n }\n customer {\n id\n }\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ], "customer": { "toAssociate": { "id": "gid://shopify/Customer/544365967" } }, "financialStatus": "PENDING", "shippingAddress": { "lastName": "James", "address1": "123 Main St", "city": "Ottawa", "countryCode": "CA", "provinceCode": "ON", "zip": "K1P 1J1" }, "billingAddress": { "lastName": "James", "address1": "321 Secondary St", "city": "Ottawa", "countryCode": "CA", "provinceCode": "ON", "zip": "K1P 1J1" } } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460046", "displayFinancialStatus": "PENDING", "shippingAddress": { "lastName": "James", "address1": "123 Main St", "city": "Ottawa", "provinceCode": "ON", "countryCode": "CA", "zip": "K1P 1J1" }, "billingAddress": { "lastName": "James", "address1": "321 Secondary St", "city": "Ottawa", "provinceCode": "ON", "countryCode": "CA", "zip": "K1P 1J1" }, "customer": { "id": "gid://shopify/Customer/544365967" } } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id lineItems(first: 5) { nodes { id title quantity variant { id } } } } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ]\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n lineItems(first: 5) {\n nodes {\n id\n title\n quantity\n variant {\n id\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n lineItems(first: 5) {\n nodes {\n id\n title\n quantity\n variant {\n id\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}]\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n lineItems(first: 5) {\n nodes {\n id\n title\n quantity\n variant {\n id\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ]\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n lineItems(first: 5) {\n nodes {\n id\n title\n quantity\n variant {\n id\n }\n }\n }\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ] } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460043", "lineItems": { "nodes": [ { "id": "gid://shopify/LineItem/1071823267", "title": "Draft", "quantity": 1, "variant": { "id": "gid://shopify/ProductVariant/43729076" } } ] } } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"email\": \"foo@shopify.com\",\n \"fulfillmentStatus\": \"FULFILLED\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"email\": \"foo@shopify.com\",\n \"fulfillmentStatus\": \"FULFILLED\"\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"email\": \"foo@shopify.com\",\n \"fulfillmentStatus\": \"FULFILLED\"\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"email\" => \"foo@shopify.com\",\n \"fulfillmentStatus\" => \"FULFILLED\",\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"email\": \"foo@shopify.com\",\n \"fulfillmentStatus\": \"FULFILLED\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ], "email": "foo@shopify.com", "fulfillmentStatus": "FULFILLED" } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460053" } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"email\": \"foo@shopify.com\",\n \"fulfillmentStatus\": \"FULFILLED\"\n },\n \"options\": {\n \"sendReceipt\": true,\n \"sendFulfillmentReceipt\": true\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"email\": \"foo@shopify.com\",\n \"fulfillmentStatus\": \"FULFILLED\"\n },\n \"options\": {\n \"sendReceipt\": true,\n \"sendFulfillmentReceipt\": true\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"email\": \"foo@shopify.com\",\n \"fulfillmentStatus\": \"FULFILLED\"\n },\n \"options\": {\n \"sendReceipt\": true,\n \"sendFulfillmentReceipt\": true\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"email\" => \"foo@shopify.com\",\n \"fulfillmentStatus\" => \"FULFILLED\",\n ],\n \"options\" => [\n \"sendReceipt\" => true,\n \"sendFulfillmentReceipt\" => true,\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"email\": \"foo@shopify.com\",\n \"fulfillmentStatus\": \"FULFILLED\"\n },\n \"options\": {\n \"sendReceipt\": true,\n \"sendFulfillmentReceipt\": true\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ], "email": "foo@shopify.com", "fulfillmentStatus": "FULFILLED" }, "options": { "sendReceipt": true, "sendFulfillmentReceipt": true } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460054" } } } }
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\": \"mutation M($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { order { id billingAddress { firstName lastName address1 phone city province country zip } currencyCode customer { id firstName lastName email } discountCodes displayFinancialStatus displayFulfillmentStatus email fulfillments(first: 50) { location { id } } lineItems(first: 50) { nodes { variant { id } title originalUnitPriceSet { shopMoney { amount currencyCode } } quantity taxLines { title rate priceSet { shopMoney { amount currencyCode } } } } } note phone shippingAddress { firstName lastName address1 phone city province country zip } tags taxLines { title rate priceSet { shopMoney { amount currencyCode } } } totalTaxSet { shopMoney { amount currencyCode } } transactions { kind status amountSet { shopMoney { amount currencyCode } } } } userErrors { field message } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ]\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation M($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n order {\n id\n billingAddress {\n firstName\n lastName\n address1\n phone\n city\n province\n country\n zip\n }\n currencyCode\n customer {\n id\n firstName\n lastName\n email\n }\n discountCodes\n displayFinancialStatus\n displayFulfillmentStatus\n email\n fulfillments(first: 50) {\n location {\n id\n }\n }\n lineItems(first: 50) {\n nodes {\n variant {\n id\n }\n title\n originalUnitPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n quantity\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n note\n phone\n shippingAddress {\n firstName\n lastName\n address1\n phone\n city\n province\n country\n zip\n }\n tags\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n transactions {\n kind\n status\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\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 mutation M($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n order {\n id\n billingAddress {\n firstName\n lastName\n address1\n phone\n city\n province\n country\n zip\n }\n currencyCode\n customer {\n id\n firstName\n lastName\n email\n }\n discountCodes\n displayFinancialStatus\n displayFulfillmentStatus\n email\n fulfillments(first: 50) {\n location {\n id\n }\n }\n lineItems(first: 50) {\n nodes {\n variant {\n id\n }\n title\n originalUnitPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n quantity\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n note\n phone\n shippingAddress {\n firstName\n lastName\n address1\n phone\n city\n province\n country\n zip\n }\n tags\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n transactions {\n kind\n status\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}]\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n ],\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 mutation M($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n order {\n id\n billingAddress {\n firstName\n lastName\n address1\n phone\n city\n province\n country\n zip\n }\n currencyCode\n customer {\n id\n firstName\n lastName\n email\n }\n discountCodes\n displayFinancialStatus\n displayFulfillmentStatus\n email\n fulfillments(first: 50) {\n location {\n id\n }\n }\n lineItems(first: 50) {\n nodes {\n variant {\n id\n }\n title\n originalUnitPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n quantity\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n note\n phone\n shippingAddress {\n firstName\n lastName\n address1\n phone\n city\n province\n country\n zip\n }\n tags\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n transactions {\n kind\n status\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ]\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation M($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n order {\n id\n billingAddress {\n firstName\n lastName\n address1\n phone\n city\n province\n country\n zip\n }\n currencyCode\n customer {\n id\n firstName\n lastName\n email\n }\n discountCodes\n displayFinancialStatus\n displayFulfillmentStatus\n email\n fulfillments(first: 50) {\n location {\n id\n }\n }\n lineItems(first: 50) {\n nodes {\n variant {\n id\n }\n title\n originalUnitPriceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n quantity\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n note\n phone\n shippingAddress {\n firstName\n lastName\n address1\n phone\n city\n province\n country\n zip\n }\n tags\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n transactions {\n kind\n status\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ] } }
response: { "data": { "orderCreate": { "order": { "id": "gid://shopify/Order/1073460048", "billingAddress": null, "currencyCode": "USD", "customer": null, "discountCodes": [], "displayFinancialStatus": null, "displayFulfillmentStatus": "UNFULFILLED", "email": null, "fulfillments": [], "lineItems": { "nodes": [ { "variant": { "id": "gid://shopify/ProductVariant/43729076" }, "title": "Draft", "originalUnitPriceSet": { "shopMoney": { "amount": "10.0", "currencyCode": "USD" } }, "quantity": 1, "taxLines": [] } ] }, "note": null, "phone": null, "shippingAddress": null, "tags": [], "taxLines": [], "totalTaxSet": { "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "transactions": [] }, "userErrors": [] } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { totalDiscountsSet { shopMoney { amount currencyCode } presentmentMoney { amount currencyCode } } discountCodes discountApplications(first: 5) { nodes { value { ... on MoneyV2 { amount currencyCode } } } } } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1,\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 100.0,\n \"currencyCode\": \"USD\"\n },\n \"presentmentMoney\": {\n \"amount\": 75.0,\n \"currencyCode\": \"CAD\"\n }\n }\n }\n ],\n \"presentmentCurrency\": \"CAD\",\n \"discountCode\": {\n \"itemFixedDiscountCode\": {\n \"amountSet\": {\n \"shopMoney\": {\n \"amount\": 5.0,\n \"currencyCode\": \"USD\"\n },\n \"presentmentMoney\": {\n \"amount\": 9.0,\n \"currencyCode\": \"CAD\"\n }\n },\n \"code\": \"BESTSALE\"\n }\n }\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n totalDiscountsSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n discountCodes\n discountApplications(first: 5) {\n nodes {\n value {\n ... on MoneyV2 {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1,\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 100.0,\n \"currencyCode\": \"USD\"\n },\n \"presentmentMoney\": {\n \"amount\": 75.0,\n \"currencyCode\": \"CAD\"\n }\n }\n }\n ],\n \"presentmentCurrency\": \"CAD\",\n \"discountCode\": {\n \"itemFixedDiscountCode\": {\n \"amountSet\": {\n \"shopMoney\": {\n \"amount\": 5.0,\n \"currencyCode\": \"USD\"\n },\n \"presentmentMoney\": {\n \"amount\": 9.0,\n \"currencyCode\": \"CAD\"\n }\n },\n \"code\": \"BESTSALE\"\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n totalDiscountsSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n discountCodes\n discountApplications(first: 5) {\n nodes {\n value {\n ... on MoneyV2 {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1, \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>100.0, \"currencyCode\"=>\"USD\"}, \"presentmentMoney\"=>{\"amount\"=>75.0, \"currencyCode\"=>\"CAD\"}}}],\n \"presentmentCurrency\": \"CAD\",\n \"discountCode\": {\n \"itemFixedDiscountCode\": {\n \"amountSet\": {\n \"shopMoney\": {\n \"amount\": 5.0,\n \"currencyCode\": \"USD\"\n },\n \"presentmentMoney\": {\n \"amount\": 9.0,\n \"currencyCode\": \"CAD\"\n }\n },\n \"code\": \"BESTSALE\"\n }\n }\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1, \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>100.0, \"currencyCode\"=>\"USD\"}, \"presentmentMoney\"=>{\"amount\"=>75.0, \"currencyCode\"=>\"CAD\"}}}],\n \"presentmentCurrency\" => \"CAD\",\n \"discountCode\" => [\n \"itemFixedDiscountCode\" => [\n \"amountSet\" => [\n \"shopMoney\" => [\n \"amount\" => 5.0,\n \"currencyCode\" => \"USD\",\n ],\n \"presentmentMoney\" => [\n \"amount\" => 9.0,\n \"currencyCode\" => \"CAD\",\n ],\n ],\n \"code\" => \"BESTSALE\",\n ],\n ],\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n totalDiscountsSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n discountCodes\n discountApplications(first: 5) {\n nodes {\n value {\n ... on MoneyV2 {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1,\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 100.0,\n \"currencyCode\": \"USD\"\n },\n \"presentmentMoney\": {\n \"amount\": 75.0,\n \"currencyCode\": \"CAD\"\n }\n }\n }\n ],\n \"presentmentCurrency\": \"CAD\",\n \"discountCode\": {\n \"itemFixedDiscountCode\": {\n \"amountSet\": {\n \"shopMoney\": {\n \"amount\": 5.0,\n \"currencyCode\": \"USD\"\n },\n \"presentmentMoney\": {\n \"amount\": 9.0,\n \"currencyCode\": \"CAD\"\n }\n },\n \"code\": \"BESTSALE\"\n }\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n totalDiscountsSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n discountCodes\n discountApplications(first: 5) {\n nodes {\n value {\n ... on MoneyV2 {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1, "priceSet": { "shopMoney": { "amount": 100.0, "currencyCode": "USD" }, "presentmentMoney": { "amount": 75.0, "currencyCode": "CAD" } } } ], "presentmentCurrency": "CAD", "discountCode": { "itemFixedDiscountCode": { "amountSet": { "shopMoney": { "amount": 5.0, "currencyCode": "USD" }, "presentmentMoney": { "amount": 9.0, "currencyCode": "CAD" } }, "code": "BESTSALE" } } } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "totalDiscountsSet": { "shopMoney": { "amount": "5.0", "currencyCode": "USD" }, "presentmentMoney": { "amount": "9.0", "currencyCode": "CAD" } }, "discountCodes": [ "BESTSALE" ], "discountApplications": { "nodes": [ { "value": { "amount": "5.0", "currencyCode": "USD" } } ] } } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { totalDiscountsSet { shopMoney { amount currencyCode } presentmentMoney { amount currencyCode } } discountCodes discountApplications(first: 5) { nodes { value { ... on MoneyV2 { amount currencyCode } ... on PricingPercentageValue { percentage } } } } } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"discountCode\": {\n \"itemPercentageDiscountCode\": {\n \"percentage\": 10,\n \"code\": \"SUMMER SALE\"\n }\n }\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n totalDiscountsSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n discountCodes\n discountApplications(first: 5) {\n nodes {\n value {\n ... on MoneyV2 {\n amount\n currencyCode\n }\n ... on PricingPercentageValue {\n percentage\n }\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"discountCode\": {\n \"itemPercentageDiscountCode\": {\n \"percentage\": 10,\n \"code\": \"SUMMER SALE\"\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n totalDiscountsSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n discountCodes\n discountApplications(first: 5) {\n nodes {\n value {\n ... on MoneyV2 {\n amount\n currencyCode\n }\n ... on PricingPercentageValue {\n percentage\n }\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"discountCode\": {\n \"itemPercentageDiscountCode\": {\n \"percentage\": 10,\n \"code\": \"SUMMER SALE\"\n }\n }\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"discountCode\" => [\n \"itemPercentageDiscountCode\" => [\n \"percentage\" => 10,\n \"code\" => \"SUMMER SALE\",\n ],\n ],\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n totalDiscountsSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n discountCodes\n discountApplications(first: 5) {\n nodes {\n value {\n ... on MoneyV2 {\n amount\n currencyCode\n }\n ... on PricingPercentageValue {\n percentage\n }\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"discountCode\": {\n \"itemPercentageDiscountCode\": {\n \"percentage\": 10,\n \"code\": \"SUMMER SALE\"\n }\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n totalDiscountsSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n discountCodes\n discountApplications(first: 5) {\n nodes {\n value {\n ... on MoneyV2 {\n amount\n currencyCode\n }\n ... on PricingPercentageValue {\n percentage\n }\n }\n }\n }\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ], "discountCode": { "itemPercentageDiscountCode": { "percentage": 10, "code": "SUMMER SALE" } } } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "totalDiscountsSet": { "shopMoney": { "amount": "1.0", "currencyCode": "USD" }, "presentmentMoney": { "amount": "1.0", "currencyCode": "USD" } }, "discountCodes": [ "SUMMER SALE" ], "discountApplications": { "nodes": [ { "value": { "percentage": 10.0 } } ] } } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id fulfillments(first: 5) { id status location { id } originAddress { address1 city countryCode provinceCode zip } trackingInfo { company number } } } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"fulfillment\": {\n \"locationId\": \"gid://shopify/Location/124656943\",\n \"originAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"trackingCompany\": \"Canada Post\",\n \"trackingNumber\": \"1234567890\",\n \"shipmentStatus\": \"DELIVERED\",\n \"notifyCustomer\": true\n }\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n fulfillments(first: 5) {\n id\n status\n location {\n id\n }\n originAddress {\n address1\n city\n countryCode\n provinceCode\n zip\n }\n trackingInfo {\n company\n number\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"fulfillment\": {\n \"locationId\": \"gid://shopify/Location/124656943\",\n \"originAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"trackingCompany\": \"Canada Post\",\n \"trackingNumber\": \"1234567890\",\n \"shipmentStatus\": \"DELIVERED\",\n \"notifyCustomer\": true\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n fulfillments(first: 5) {\n id\n status\n location {\n id\n }\n originAddress {\n address1\n city\n countryCode\n provinceCode\n zip\n }\n trackingInfo {\n company\n number\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"fulfillment\": {\n \"locationId\": \"gid://shopify/Location/124656943\",\n \"originAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"trackingCompany\": \"Canada Post\",\n \"trackingNumber\": \"1234567890\",\n \"shipmentStatus\": \"DELIVERED\",\n \"notifyCustomer\": true\n }\n }\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 = <<[\n \"lineItems\" => [{\"variantId\"=>\"gid://shopify/ProductVariant/43729076\", \"quantity\"=>1}],\n \"fulfillment\" => [\n \"locationId\" => \"gid://shopify/Location/124656943\",\n \"originAddress\" => [\n \"address1\" => \"123 Main St\",\n \"city\" => \"Ottawa\",\n \"countryCode\" => \"CA\",\n \"provinceCode\" => \"ON\",\n \"zip\" => \"K1P 1J1\",\n ],\n \"trackingCompany\" => \"Canada Post\",\n \"trackingNumber\" => \"1234567890\",\n \"shipmentStatus\" => \"DELIVERED\",\n \"notifyCustomer\" => true,\n ],\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n fulfillments(first: 5) {\n id\n status\n location {\n id\n }\n originAddress {\n address1\n city\n countryCode\n provinceCode\n zip\n }\n trackingInfo {\n company\n number\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"variantId\": \"gid://shopify/ProductVariant/43729076\",\n \"quantity\": 1\n }\n ],\n \"fulfillment\": {\n \"locationId\": \"gid://shopify/Location/124656943\",\n \"originAddress\": {\n \"address1\": \"123 Main St\",\n \"city\": \"Ottawa\",\n \"countryCode\": \"CA\",\n \"provinceCode\": \"ON\",\n \"zip\": \"K1P 1J1\"\n },\n \"trackingCompany\": \"Canada Post\",\n \"trackingNumber\": \"1234567890\",\n \"shipmentStatus\": \"DELIVERED\",\n \"notifyCustomer\": true\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n fulfillments(first: 5) {\n id\n status\n location {\n id\n }\n originAddress {\n address1\n city\n countryCode\n provinceCode\n zip\n }\n trackingInfo {\n company\n number\n }\n }\n }\n }\n}"
input: { "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/43729076", "quantity": 1 } ], "fulfillment": { "locationId": "gid://shopify/Location/124656943", "originAddress": { "address1": "123 Main St", "city": "Ottawa", "countryCode": "CA", "provinceCode": "ON", "zip": "K1P 1J1" }, "trackingCompany": "Canada Post", "trackingNumber": "1234567890", "shipmentStatus": "DELIVERED", "notifyCustomer": true } } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460050", "fulfillments": [ { "id": "gid://shopify/Fulfillment/1069019886", "status": "SUCCESS", "location": { "id": "gid://shopify/Location/124656943" }, "originAddress": { "address1": "123 Main St", "city": "Ottawa", "countryCode": "CA", "provinceCode": "ON", "zip": "K1P 1J1" }, "trackingInfo": [ { "company": "Canada Post", "number": "1234567890" } ] } ] } } } }
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\": \"mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) { orderCreate(order: $order, options: $options) { userErrors { field message } order { id totalTaxSet { shopMoney { amount currencyCode } } lineItems(first: 5) { nodes { id title quantity variant { id } taxLines { title rate priceSet { shopMoney { amount currencyCode } } } } } } } }\",\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"title\": \"Red Leather Coat\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 129.99,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 1\n },\n {\n \"title\": \"Blue Suede Shoes\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 85.95,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 1,\n \"taxable\": false\n },\n {\n \"title\": \"Raspberry Beret\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 19.99,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 2\n }\n ],\n \"taxLines\": [\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 10.2,\n \"currencyCode\": \"USD\"\n }\n },\n \"title\": \"State tax\",\n \"rate\": 0.04\n },\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 4.25,\n \"currencyCode\": \"USD\"\n }\n },\n \"title\": \"County tax\",\n \"rate\": 0.02\n }\n ]\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n lineItems(first: 5) {\n nodes {\n id\n title\n quantity\n variant {\n id\n }\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"order\": {\n \"lineItems\": [\n {\n \"title\": \"Red Leather Coat\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 129.99,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 1\n },\n {\n \"title\": \"Blue Suede Shoes\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 85.95,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 1,\n \"taxable\": false\n },\n {\n \"title\": \"Raspberry Beret\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 19.99,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 2\n }\n ],\n \"taxLines\": [\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 10.2,\n \"currencyCode\": \"USD\"\n }\n },\n \"title\": \"State tax\",\n \"rate\": 0.04\n },\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 4.25,\n \"currencyCode\": \"USD\"\n }\n },\n \"title\": \"County tax\",\n \"rate\": 0.02\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n lineItems(first: 5) {\n nodes {\n id\n title\n quantity\n variant {\n id\n }\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"order\": {\n \"lineItems\": [{\"title\"=>\"Red Leather Coat\", \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>129.99, \"currencyCode\"=>\"USD\"}}, \"quantity\"=>1}, {\"title\"=>\"Blue Suede Shoes\", \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>85.95, \"currencyCode\"=>\"USD\"}}, \"quantity\"=>1, \"taxable\"=>false}, {\"title\"=>\"Raspberry Beret\", \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>19.99, \"currencyCode\"=>\"USD\"}}, \"quantity\"=>2}],\n \"taxLines\": [{\"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>10.2, \"currencyCode\"=>\"USD\"}}, \"title\"=>\"State tax\", \"rate\"=>0.04}, {\"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>4.25, \"currencyCode\"=>\"USD\"}}, \"title\"=>\"County tax\", \"rate\"=>0.02}]\n }\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 = <<[\n \"lineItems\" => [{\"title\"=>\"Red Leather Coat\", \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>129.99, \"currencyCode\"=>\"USD\"}}, \"quantity\"=>1}, {\"title\"=>\"Blue Suede Shoes\", \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>85.95, \"currencyCode\"=>\"USD\"}}, \"quantity\"=>1, \"taxable\"=>false}, {\"title\"=>\"Raspberry Beret\", \"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>19.99, \"currencyCode\"=>\"USD\"}}, \"quantity\"=>2}],\n \"taxLines\" => [{\"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>10.2, \"currencyCode\"=>\"USD\"}}, \"title\"=>\"State tax\", \"rate\"=>0.04}, {\"priceSet\"=>{\"shopMoney\"=>{\"amount\"=>4.25, \"currencyCode\"=>\"USD\"}}, \"title\"=>\"County tax\", \"rate\"=>0.02}],\n ],\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 mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n lineItems(first: 5) {\n nodes {\n id\n title\n quantity\n variant {\n id\n }\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"order\": {\n \"lineItems\": [\n {\n \"title\": \"Red Leather Coat\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 129.99,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 1\n },\n {\n \"title\": \"Blue Suede Shoes\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 85.95,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 1,\n \"taxable\": false\n },\n {\n \"title\": \"Raspberry Beret\",\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 19.99,\n \"currencyCode\": \"USD\"\n }\n },\n \"quantity\": 2\n }\n ],\n \"taxLines\": [\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 10.2,\n \"currencyCode\": \"USD\"\n }\n },\n \"title\": \"State tax\",\n \"rate\": 0.04\n },\n {\n \"priceSet\": {\n \"shopMoney\": {\n \"amount\": 4.25,\n \"currencyCode\": \"USD\"\n }\n },\n \"title\": \"County tax\",\n \"rate\": 0.02\n }\n ]\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderCreate($order: OrderCreateOrderInput!, $options: OrderCreateOptionsInput) {\n orderCreate(order: $order, options: $options) {\n userErrors {\n field\n message\n }\n order {\n id\n totalTaxSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n lineItems(first: 5) {\n nodes {\n id\n title\n quantity\n variant {\n id\n }\n taxLines {\n title\n rate\n priceSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n }\n}"
input: { "order": { "lineItems": [ { "title": "Red Leather Coat", "priceSet": { "shopMoney": { "amount": 129.99, "currencyCode": "USD" } }, "quantity": 1 }, { "title": "Blue Suede Shoes", "priceSet": { "shopMoney": { "amount": 85.95, "currencyCode": "USD" } }, "quantity": 1, "taxable": false }, { "title": "Raspberry Beret", "priceSet": { "shopMoney": { "amount": 19.99, "currencyCode": "USD" } }, "quantity": 2 } ], "taxLines": [ { "priceSet": { "shopMoney": { "amount": 10.2, "currencyCode": "USD" } }, "title": "State tax", "rate": 0.04 }, { "priceSet": { "shopMoney": { "amount": 4.25, "currencyCode": "USD" } }, "title": "County tax", "rate": 0.02 } ] } }
response: { "data": { "orderCreate": { "userErrors": [], "order": { "id": "gid://shopify/Order/1073460051", "totalTaxSet": { "shopMoney": { "amount": "14.45", "currencyCode": "USD" } }, "lineItems": { "nodes": [ { "id": "gid://shopify/LineItem/1071823275", "title": "Red Leather Coat", "quantity": 1, "variant": null, "taxLines": [ { "title": "State tax", "rate": 0.04, "priceSet": { "shopMoney": { "amount": "7.81", "currencyCode": "USD" } } }, { "title": "County tax", "rate": 0.02, "priceSet": { "shopMoney": { "amount": "3.26", "currencyCode": "USD" } } } ] }, { "id": "gid://shopify/LineItem/1071823276", "title": "Blue Suede Shoes", "quantity": 1, "variant": null, "taxLines": [] }, { "id": "gid://shopify/LineItem/1071823277", "title": "Raspberry Beret", "quantity": 2, "variant": null, "taxLines": [ { "title": "State tax", "rate": 0.04, "priceSet": { "shopMoney": { "amount": "2.39", "currencyCode": "USD" } } }, { "title": "County tax", "rate": 0.02, "priceSet": { "shopMoney": { "amount": "0.99", "currencyCode": "USD" } } } ] } ] } } } } }