Version: 2024-07
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) { orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) { userErrors { field message } orderRiskAssessment { facts { description sentiment } provider { title } riskLevel } } }\",\n \"variables\": {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"LOW\",\n \"facts\": [\n {\n \"description\": \"Payment verification successful.\",\n \"sentiment\": \"POSITIVE\"\n },\n {\n \"description\": \"Buyer verification inconclusive.\",\n \"sentiment\": \"NEUTRAL\"\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"LOW\",\n \"facts\": [\n {\n \"description\": \"Payment verification successful.\",\n \"sentiment\": \"POSITIVE\"\n },\n {\n \"description\": \"Buyer verification inconclusive.\",\n \"sentiment\": \"NEUTRAL\"\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"LOW\",\n \"facts\": [{\"description\"=>\"Payment verification successful.\", \"sentiment\"=>\"POSITIVE\"}, {\"description\"=>\"Buyer verification inconclusive.\", \"sentiment\"=>\"NEUTRAL\"}]\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 = <<<QUERY\n mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [\n \"orderId\" => \"gid://shopify/Order/148977776\",\n \"riskLevel\" => \"LOW\",\n \"facts\" => [{\"description\"=>\"Payment verification successful.\", \"sentiment\"=>\"POSITIVE\"}, {\"description\"=>\"Buyer verification inconclusive.\", \"sentiment\"=>\"NEUTRAL\"}],\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"LOW\",\n \"facts\": [\n {\n \"description\": \"Payment verification successful.\",\n \"sentiment\": \"POSITIVE\"\n },\n {\n \"description\": \"Buyer verification inconclusive.\",\n \"sentiment\": \"NEUTRAL\"\n }\n ]\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n}"
input: { "input": { "orderId": "gid://shopify/Order/148977776", "riskLevel": "LOW", "facts": [ { "description": "Payment verification successful.", "sentiment": "POSITIVE" }, { "description": "Buyer verification inconclusive.", "sentiment": "NEUTRAL" } ] } }
response: { "data": { "orderRiskAssessmentCreate": { "userErrors": [], "orderRiskAssessment": { "facts": [ { "description": "Payment verification successful.", "sentiment": "POSITIVE" }, { "description": "Buyer verification inconclusive.", "sentiment": "NEUTRAL" } ], "provider": { "title": "Risk API client" }, "riskLevel": "LOW" } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) { orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) { userErrors { field message } orderRiskAssessment { facts { description sentiment } provider { title } riskLevel } } }\",\n \"variables\": {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"PENDING\",\n \"facts\": [\n {\n \"description\": \"Analysis is underway.\",\n \"sentiment\": \"NEUTRAL\"\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"PENDING\",\n \"facts\": [\n {\n \"description\": \"Analysis is underway.\",\n \"sentiment\": \"NEUTRAL\"\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"PENDING\",\n \"facts\": [{\"description\"=>\"Analysis is underway.\", \"sentiment\"=>\"NEUTRAL\"}]\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 = <<<QUERY\n mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [\n \"orderId\" => \"gid://shopify/Order/148977776\",\n \"riskLevel\" => \"PENDING\",\n \"facts\" => [{\"description\"=>\"Analysis is underway.\", \"sentiment\"=>\"NEUTRAL\"}],\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"PENDING\",\n \"facts\": [\n {\n \"description\": \"Analysis is underway.\",\n \"sentiment\": \"NEUTRAL\"\n }\n ]\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n}"
input: { "input": { "orderId": "gid://shopify/Order/148977776", "riskLevel": "PENDING", "facts": [ { "description": "Analysis is underway.", "sentiment": "NEUTRAL" } ] } }
response: { "data": { "orderRiskAssessmentCreate": { "userErrors": [], "orderRiskAssessment": { "facts": [ { "description": "Analysis is underway.", "sentiment": "NEUTRAL" } ], "provider": { "title": "Risk API client" }, "riskLevel": "PENDING" } } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) { orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) { userErrors { field message } orderRiskAssessment { facts { description sentiment } provider { title } riskLevel } } }\",\n \"variables\": {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"LOW\",\n \"facts\": [\n {\n \"description\": \"Payment verification successful.\",\n \"sentiment\": \"POSITIVE\"\n },\n {\n \"description\": \"Buyer verification inconclusive.\",\n \"sentiment\": \"NEUTRAL\"\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"LOW\",\n \"facts\": [\n {\n \"description\": \"Payment verification successful.\",\n \"sentiment\": \"POSITIVE\"\n },\n {\n \"description\": \"Buyer verification inconclusive.\",\n \"sentiment\": \"NEUTRAL\"\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"LOW\",\n \"facts\": [{\"description\"=>\"Payment verification successful.\", \"sentiment\"=>\"POSITIVE\"}, {\"description\"=>\"Buyer verification inconclusive.\", \"sentiment\"=>\"NEUTRAL\"}]\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 = <<<QUERY\n mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [\n \"orderId\" => \"gid://shopify/Order/148977776\",\n \"riskLevel\" => \"LOW\",\n \"facts\" => [{\"description\"=>\"Payment verification successful.\", \"sentiment\"=>\"POSITIVE\"}, {\"description\"=>\"Buyer verification inconclusive.\", \"sentiment\"=>\"NEUTRAL\"}],\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 OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"orderId\": \"gid://shopify/Order/148977776\",\n \"riskLevel\": \"LOW\",\n \"facts\": [\n {\n \"description\": \"Payment verification successful.\",\n \"sentiment\": \"POSITIVE\"\n },\n {\n \"description\": \"Buyer verification inconclusive.\",\n \"sentiment\": \"NEUTRAL\"\n }\n ]\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation OrderRiskAssessmentCreate($input: OrderRiskAssessmentCreateInput!) {\n orderRiskAssessmentCreate(orderRiskAssessmentInput: $input) {\n userErrors {\n field\n message\n }\n orderRiskAssessment {\n facts {\n description\n sentiment\n }\n provider {\n title\n }\n riskLevel\n }\n }\n}"
input: { "input": { "orderId": "gid://shopify/Order/148977776", "riskLevel": "LOW", "facts": [ { "description": "Payment verification successful.", "sentiment": "POSITIVE" }, { "description": "Buyer verification inconclusive.", "sentiment": "NEUTRAL" } ] } }
response: { "data": { "orderRiskAssessmentCreate": { "userErrors": [], "orderRiskAssessment": { "facts": [ { "description": "Payment verification successful.", "sentiment": "POSITIVE" }, { "description": "Buyer verification inconclusive.", "sentiment": "NEUTRAL" } ], "provider": { "title": "Risk API client" }, "riskLevel": "LOW" } } } }