ResourceFeedback

The ResourceFeedback resource 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. Unlike REST-style APIs, you don't need to make a PATCH or PUT request to update any previously sent feedback. Send a new POST request to push the latest state of a shop or its resources to Shopify.

Formatting the resource feedback message field

If feedback state is requires_action you can send a string message, which communicates the action to be taken by the merchant. The string must be a single message up to 100 characters long, must follow your app's name with [is/has], and must end with a period. You must adhere to the message formatting rules or your requests will fail:

  • [is/has] [explanation of the problem]. [Suggested action].

  • Examples:

  • [Your app name] is not connected. Connect your account to use this sales channel. [Learn more]
  • [Your app name] is not configured. Agree to the terms and conditions to use this app. [Learn more]

  • Where both Your app name and Learn more (a button which directs merchants to your app) are automatically populated in the Shopify admin.

    Setting feedback permissions

    Add the write_resource_feedbacks permission to your requested scopes.

    What you can do with ResourceFeedback

    The Shopify API lets you do the following with the ResourceFeedback resource. More detailed versions of these general actions may be available:

    ResourceFeedback properties

    created_at
    read-only
    "created_at": 2018-11-06 21:56:57 UTC

    DateTime when the resource feedback record was stored by Shopify. Type: ISO 8601 UTC DateTime as string with year, month (or week), day, hour, minute, second, time zone.

    updated_at
    read-only
    "updated_at": 2018-11-06 21:56:57 UTC

    DateTime when the resource feedback record was last updated by Shopify. Type: ISO 8601 UTC DateTime as string with year, month (or week), day, hour, minute, second, time zone.

    resource_id
    read-only
    "resource_id": 321

    Unique id of the resource.

    resource_type
    read-only
    "resource_type": "Shop"

    Type of resource for which feedback is returned. eg. Shop, Product.

    state
    "state": "requires_action"

    Indicates the state that the Shop or resource is in, from the perspective of your app. Valid values are requires_action, or success.

    messages
    "messages": [
      "is not connected. Connect your account to use this sales channel."
    ]

    A concise set of copy strings to be displayed to merchants, to guide them in resolving problems your app encounters when trying to make use of their Shop and its resources.

    Required only when state is requires_action. Disallowed when state is success.

    Content restrictions for Shop feedback: one message up to 100 characters long.

    feedback_generated_at
    "feedback_generated_at": "2018-11-06T21:56:57.853191Z"

    The time at which the payload is constructed. Used to help determine whether incoming feedback is outdated compared to feedback already received, and if it should be ignored upon arrival. Type: ISO 8601 UTC datetime as string with year, month [or week], day, hour, minute, second, millisecond, and time zone.

    Note

    If you queue a Feedback API payload for delivery at a later time, do not update this value when the API call is actually made; ensure that the current time is set when building the payload.

    Endpoints

    POST /admin/resource_feedback.json
    Creates shop resource feedback.
    state
    required

    Must be one of the following values:

    • requires_action: Indicates that your app requires the merchant to resolve an issue with their shop.
    • success: Indicates that the app does not have any outstanding issues with this shop.
    messages
    required

    An array containing a single message. See Formatting the resourcefeedback message field for formatting requirements.

    feedback_generated_at
    required

    An ISO 8601 date and time indicating when the feedback was generated by your app.

    Create a shop feedback record indicating a problem specific to your app

    POST /admin/resource_feedback.json
    {
      "resource_feedback": {
        "state": "requires_action",
        "messages": [
          "is not connected. Connect your account to use this sales channel."
        ],
        "feedback_generated_at": "2018-11-06T21:57:04.555364Z"
      }
    }
    View Response
    HTTP/1.1 202 Accepted
    {
      "resource_feedback": {
        "created_at": "2018-11-06T16:57:04-05:00",
        "updated_at": "2018-11-06T16:57:04-05:00",
        "resource_id": 690933842,
        "resource_type": "Shop",
        "resource_updated_at": null,
        "messages": [
          "is not connected. Connect your account to use this sales channel."
        ],
        "feedback_generated_at": "2018-11-06T16:57:04-05:00",
        "state": "requires_action"
      }
    }

    Create a shop feedback record indicating the Shop is usable by your app

    POST /admin/resource_feedback.json
    {
      "resource_feedback": {
        "state": "success",
        "feedback_generated_at": "2018-11-06T21:57:05.018409Z"
      }
    }
    View Response
    HTTP/1.1 202 Accepted
    {
      "resource_feedback": {
        "created_at": "2018-11-06T16:57:05-05:00",
        "updated_at": "2018-11-06T16:57:05-05:00",
        "resource_id": 690933842,
        "resource_type": "Shop",
        "resource_updated_at": null,
        "messages": [],
        "feedback_generated_at": "2018-11-06T16:57:05-05:00",
        "state": "success"
      }
    }

    Sending outdated feedback (previous feedback payload has a greater resource_updated_at value) returns an error

    POST /admin/resource_feedback.json
    {
      "resource_feedback": {
        "state": "success",
        "feedback_generated_at": "2018-11-06T21:57:05.451765Z"
      }
    }
    View Response
    HTTP/1.1 409 Conflict
    {
      "errors": {
        "messages": [
          "Feedback request not delivered. Feedback request is older than a previously delivered feedback request."
        ]
      }
    }

    Sending an invalid feedback payload returns an error

    POST /admin/resource_feedback.json
    {
      "resource_feedback": {
        "state": "foobar",
        "feedback_generated_at": "2018-11-06T21:57:05.833549Z"
      }
    }
    View Response
    HTTP/1.1 422 Unprocessable Entity
    {
      "errors": {
        "messages": [
          "Validation failed: State must be one of success and requires_action"
        ]
      }
    }
    GET /admin/resource_feedback.json
    Returns a list (zero or one) of resource feedback objects.

    Important

    Note that ids are not returned as part of this request. Records are immutable except when POST replaces them.

    Get a list of resource feedback records for a specific shop

    GET /admin/resource_feedback.json
    View Response
    HTTP/1.1 200 OK
    {
      "resource_feedback": [
        {
          "created_at": "2018-11-06T16:57:02-05:00",
          "updated_at": "2018-11-06T16:57:02-05:00",
          "resource_id": 690933842,
          "resource_type": "Shop",
          "resource_updated_at": null,
          "messages": [
            "is not connected. Connect your account to use this sales channel."
          ],
          "feedback_generated_at": "2018-11-06T15:57:02-05:00",
          "state": "requires_action"
        }
      ]
    }

    Sign up for a Partner account to get started.

    Sign up