# shopResourceFeedbackCreate - admin-graphql - MUTATION Version: 2024-10 ## Description The `ResourceFeedback` object lets your app report the status of shops and their resources. For example, if your app is a marketplace channel, then you can use resource feedback to alert merchants that they need to connect their marketplace account by signing in. Resource feedback notifications are displayed to the merchant on the home screen of their Shopify admin, and in the product details view for any products that are published to your app. This resource should be used only in cases where you're describing steps that a merchant is required to complete. If your app offers optional or promotional set-up steps, or if it makes recommendations, then don't use resource feedback to let merchants know about them. ## Sending feedback on a shop You can send resource feedback on a shop to let the merchant know what steps they need to take to make sure that your app is set up correctly. Feedback can have one of two states: `requires_action` or `success`. You need to send a `requires_action` feedback request for each step that the merchant is required to complete. If there are multiple set-up steps that require merchant action, then send feedback with a state of `requires_action` as merchants complete prior steps. And to remove the feedback message from the Shopify admin, send a `success` feedback request. #### Important Sending feedback replaces previously sent feedback for the shop. Send a new `shopResourceFeedbackCreate` mutation to push the latest state of a shop or its resources to Shopify. ### Access Scopes `write_resource_feedbacks` access scope. Also: App must be configured to use the Storefront API or as a Sales Channel. ## Arguments * [input](/docs/api/admin-graphql/2024-10/input-objects/ResourceFeedbackCreateInput): ResourceFeedbackCreateInput! - The fields required to create shop feedback. ## Returns * [feedback](/docs/api/admin-graphql/2024-10/objects/AppFeedback): AppFeedback The shop feedback that's created. * [userErrors](/docs/api/admin-graphql/2024-10/objects/ShopResourceFeedbackCreateUserError): ShopResourceFeedbackCreateUserError! The list of errors that occurred from executing the mutation. ## Examples ### Create a new ResourceFeedback Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation ShopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) { shopResourceFeedbackCreate(input: $input) { feedback { messages { message } feedbackGeneratedAt state } userErrors { field message } } }\",\n \"variables\": {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:02.351662Z\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation ShopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n feedback {\n messages {\n message\n }\n feedbackGeneratedAt\n state\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:02.351662Z\"\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 ShopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n feedback {\n messages {\n message\n }\n feedbackGeneratedAt\n state\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"messages\": [\"is not connected. Connect your account to use this sales channel.\"],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:02.351662Z\"\n }\n}\n\nresponse = 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 ShopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n feedback {\n messages {\n message\n }\n feedbackGeneratedAt\n state\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:02.351662Z\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation ShopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n feedback {\n messages {\n message\n }\n feedbackGeneratedAt\n state\n }\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "input": { "messages": [ "is not connected. Connect your account to use this sales channel." ], "state": "REQUIRES_ACTION", "feedbackGeneratedAt": "2024-12-05T14:05:02.351662Z" } } #### Graphql Response { "data": { "shopResourceFeedbackCreate": { "feedback": { "messages": [ { "message": "Generic Channel is not connected. Connect your account to use this sales channel." } ], "feedbackGeneratedAt": "2024-12-05T14:05:02Z", "state": "REQUIRES_ACTION" }, "userErrors": [] } } } ### Create a shop feedback record indicating a problem specific to your app Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) { shopResourceFeedbackCreate(input: $input) { userErrors { field message } } }\",\n \"variables\": {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:00.688444Z\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:00.688444Z\"\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 shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"messages\": [\"is not connected. Connect your account to use this sales channel.\"],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:00.688444Z\"\n }\n}\n\nresponse = 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 shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:00.688444Z\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "input": { "messages": [ "is not connected. Connect your account to use this sales channel." ], "state": "REQUIRES_ACTION", "feedbackGeneratedAt": "2024-12-05T14:05:00.688444Z" } } #### Graphql Response { "data": { "shopResourceFeedbackCreate": { "userErrors": [] } } } ### Create a shop feedback record indicating the shop is usable by your app Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) { shopResourceFeedbackCreate(input: $input) { userErrors { field message } } }\",\n \"variables\": {\n \"input\": {\n \"state\": \"ACCEPTED\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:01.601550Z\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"state\": \"ACCEPTED\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:01.601550Z\"\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 shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"state\": \"ACCEPTED\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:01.601550Z\"\n }\n}\n\nresponse = 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 shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"state\": \"ACCEPTED\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:01.601550Z\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "input": { "state": "ACCEPTED", "feedbackGeneratedAt": "2024-12-05T14:05:01.601550Z" } } #### Graphql Response { "data": { "shopResourceFeedbackCreate": { "userErrors": [] } } } ### Sending an invalid feedback payload returns an error Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) { shopResourceFeedbackCreate(input: $input) { userErrors { field message } } }\",\n \"variables\": {\n \"input\": {\n \"state\": \"FOOBAR\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:01.831106Z\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"state\": \"FOOBAR\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:01.831106Z\"\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 shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"state\": \"FOOBAR\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:01.831106Z\"\n }\n}\n\nresponse = 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 shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"state\": \"FOOBAR\",\n \"feedbackGeneratedAt\": \"2024-12-05T14:05:01.831106Z\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "input": { "state": "FOOBAR", "feedbackGeneratedAt": "2024-12-05T14:05:01.831106Z" } } #### Graphql Response { "errors": [ { "message": "Variable $input of type ResourceFeedbackCreateInput! was provided invalid value for state (Expected \"FOOBAR\" to be one of: ACCEPTED, REQUIRES_ACTION)", "locations": [ { "line": 1, "column": 37 } ], "extensions": { "value": { "state": "FOOBAR", "feedbackGeneratedAt": "2024-12-05T14:05:01.831106Z" }, "problems": [ { "path": [ "state" ], "explanation": "Expected \"FOOBAR\" to be one of: ACCEPTED, REQUIRES_ACTION" } ] } } ] } ### Sending outdated feedback (previous feedback payload has a greater resource_updated_at value) returns an error Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) { shopResourceFeedbackCreate(input: $input) { userErrors { field message } } }\",\n \"variables\": {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"1998-06-07T10:00:00Z\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"1998-06-07T10:00:00Z\"\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 shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"messages\": [\"is not connected. Connect your account to use this sales channel.\"],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"1998-06-07T10:00:00Z\"\n }\n}\n\nresponse = 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 shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"messages\": [\n \"is not connected. Connect your account to use this sales channel.\"\n ],\n \"state\": \"REQUIRES_ACTION\",\n \"feedbackGeneratedAt\": \"1998-06-07T10:00:00Z\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation shopResourceFeedbackCreate($input: ResourceFeedbackCreateInput!) {\n shopResourceFeedbackCreate(input: $input) {\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "input": { "messages": [ "is not connected. Connect your account to use this sales channel." ], "state": "REQUIRES_ACTION", "feedbackGeneratedAt": "1998-06-07T10:00:00Z" } } #### Graphql Response { "data": { "shopResourceFeedbackCreate": { "userErrors": [ { "field": [ "input" ], "message": "Feedback for a later version of this resource was already accepted." } ] } } }