# Product ResourceFeedback

        <p>

        <div class="note-caution note">
          <h4>Important</h4>
          <p>
            Product ResourceFeedback is only for use with the <a href="/concepts/channels">Sales Channel SDK</a>.
          </p>
        </div>

          The Product ResourceFeedback API allows you to communicate the state of a shop's individual products, as it pertains to your application,
          by sending product feedback within the Shopify admin.
          Once created, product resource feedback is used help merchants get your app setup on their store
          by addressing missing steps or fixing problems.

        </p>

        <h2>Send product feedback</h2>

        <p>You can send feedback on a product to let merchants know what steps they need to take to make sure your app is set up correctly.
        Feedback can have one of two states: <code>requires_action</code> or <code>success</code>.
        You will need to send a <code>requires_action</code> feedback request for each step that the merchant is required to complete.
        If there are multiple setup steps requiring merchant action, send feedback with a state of <code>requires_action</code> as merchants complete prior steps.
        Send a success feedback request to remove the feedback message from Shopify admin.</p>

        <div class="note">
          <h4>Important</h4>
          <p>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.</p>
        </div>

        <h3>Formatting the resource feedback message field</h3>

        <p>If your state is <code>requires_action</code> you can send up to ten string messages, which communicate the action to be taken by the
        merchant. Each string must be a single message up to 100 characters long, must start with a capital letter (but not use all caps), and must end with a period.
        You must adhere to the message formatting rules or your requests will fail:</p>

        <p><strong>Examples:</strong></p>

        <p><li><code>Needs at least one image.</code></li>
        <li><code>Needs to be a shippable product.</code></li></p>

        <p>
          Merchants viewing individual products will see your app's messages as a bulleted list of errors.
          Other user interfaces in Shopify admin will report statistics like the number of errors your app has
          reported.

          Once the merchant has made a single or a series of updates to validate the product,
          your app can send a status of<code>success</code>.
        </p>


## Resource Properties

### Product ResourceFeedback

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

  * Type: x-string
  * Example: "2025-01-02 16:09:42 UTC"
* updated_at:           DateTime when the resource feedback record was last updated by Shopify.
          <strong>Type:</strong> ISO 8601 UTC DateTime as string with year, month (or week), day, hour, minute, second, time zone.

  * Type: x-string
  * Example: "2025-01-02 16:09:42 UTC"
* resource_id:           Unique id of the resource.

  * Type: x-string
  * Example: 321
* resource_type:           Type of resource for which feedback is returned. eg. Shop, Product.

  * Type: x-string
  * Example: "Product"
* state:           Indicates the state that the Shop or resource is in, from the perspective of your app.

  * Type: x-string
  * Example: "requires_action"
* messages:           <p>
            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.
          </p>

          <p>
            Required only when state is <code>requires_action</code>. Disallowed when state is <code>success</code>.
          </p>

          <p>
            <strong>Content restrictions for product feedback:</strong>
            ten messages up to 100 characters long.
          </p>

  * Type: x-string
  * Example: ["Needs at least one image."]
* feedback_generated_at:           <p>
            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.
            <strong>Type:</strong> ISO 8601 UTC DateTime as string
            with year, month [or week], day, hour, minute, second, millisecond, and time zone.
          </p>

          <div class="note">
            <h4>Note</h4>
            <p>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.</p>
          </div>

  * Type: x-string
  * Example: "2025-01-02T16:09:42.871062Z"
* resource_updated_at:           <p>
            The forwarded <code>updated_at</code> timestamp of the product. Used only for versioned resources, where the <code>updated_at</code> timestamp changes
            based on merchant actions.
            When required, it is used along with <code>feedback_generated_at</code> to help determine whether incoming
            feedback is outdated compared to feedback already received, and if it should be ignored upon arrival.
          </p>


  * Type: x-string
  * Example: "2025-01-02 16:09:42 UTC"
## Create a new Product ResourceFeedback

<p>Create product feedback.

### Endpoint
/admin/api/#{api_version}/products/{product_id}/resource_feedback.json (POST)

### Parameters
* api_version (required): 
* feedback_generated_at (required): An ISO 8601 date and time indicating when the feedback was generated by your app.
* messages (required): An array containing up to ten messages.
* product_id (required): 
* resource_updated_at (required): The forwarded <code>updated_at</code> timestamp of the product.
* state (required): Must be one of the following values:

### Responses
#### 202
Create a new Product ResourceFeedback

Examples:
##### Create a product feedback record indicating a problem specific to your app
Request:
```
POST /admin/api/unstable/products/632910392/resource_feedback.json
{"resource_feedback":{"state":"requires_action","messages":["Needs at least one image."],"resource_updated_at":"2025-01-02T11:09:43-05:00","feedback_generated_at":"2025-01-02T16:22:23.605756Z"}}
```

Response:
```
HTTP/1.1 202 Accepted
{"resource_feedback":{"created_at":"2025-01-02T11:22:24-05:00","updated_at":"2025-01-02T11:22:24-05:00","resource_id":632910392,"resource_type":"Product","resource_updated_at":"2025-01-02T11:09:43-05:00","messages":["Needs at least one image."],"feedback_generated_at":"2025-01-02T11:22:23-05:00","state":"requires_action"}}
```
##### Create a product feedback record indicating the product is usable by your app
Request:
```
POST /admin/api/unstable/products/632910392/resource_feedback.json
{"resource_feedback":{"state":"success","resource_updated_at":"2025-01-02T11:09:43-05:00","feedback_generated_at":"2025-01-02T16:22:23.139254Z"}}
```

Response:
```
HTTP/1.1 202 Accepted
{"resource_feedback":{"created_at":"2025-01-02T11:22:23-05:00","updated_at":"2025-01-02T11:22:23-05:00","resource_id":632910392,"resource_type":"Product","resource_updated_at":"2025-01-02T11:09:43-05:00","messages":[],"feedback_generated_at":"2025-01-02T11:22:23-05:00","state":"success"}}
```
#### 403
Create a new Product ResourceFeedback

Examples:
##### If the app is not configured as a Sales Channel, the API returns an error
Request:
```
POST /admin/api/unstable/products/632910392/resource_feedback.json
{"resource_feedback":{"state":"success","resource_updated_at":"2025-01-02T11:09:43-05:00","feedback_generated_at":"2025-01-02T16:22:22.060410Z"}}
```

Response:
```
HTTP/1.1 403 Forbidden
{"errors":{"message":"App must be configured as a Sales Channel."}}
```
#### 422
Create a new Product ResourceFeedback

Examples:
##### Sending an invalid feedback payload returns an error
Request:
```
POST /admin/api/unstable/products/632910392/resource_feedback.json
{"resource_feedback":{"state":"foobar","resource_updated_at":"2025-01-02T11:09:43-05:00","feedback_generated_at":"2025-01-02T16:22:22.655564Z"}}
```

Response:
```
HTTP/1.1 422 Unprocessable Entity
{"errors":{"messages":["State must be one of success and requires_action"]}}
```
#### 409
Create a new Product ResourceFeedback

Examples:
##### Sending outdated feedback (previous feedback
        payload has a greater resource_updated_at value) returns an error
Request:
```
POST /admin/api/unstable/products/632910392/resource_feedback.json
{"resource_feedback":{"state":"success","resource_updated_at":"2025-01-02T11:09:43-05:00","feedback_generated_at":"2025-01-02T16:22:21.486286Z"}}
```

Response:
```
HTTP/1.1 409 Conflict
{"errors":{"messages":["Feedback request not delivered. Feedback request is older than a previously delivered feedback request."]}}
```
## Receive a list of all Product ResourceFeedbacks

Retrieve all product feedback from your app associated with the product.

### Endpoint
/admin/api/#{api_version}/products/{product_id}/resource_feedback.json (GET)

### Parameters
* api_version (required): 
* product_id (required): 
* product_id: Retrieve feedback for a specific product, by product id.

### Responses
#### 200
Receive a list of all Product ResourceFeedbacks

Examples:
##### Get a list of resource feedback records for a specific product
Request:
```
GET /admin/api/unstable/products/632910392/resource_feedback.json
```

Response:
```
HTTP/1.1 200 OK
{"resource_feedback":[{"created_at":"2025-01-02T11:22:20-05:00","updated_at":"2025-01-02T11:22:20-05:00","resource_id":632910392,"resource_type":"Product","resource_updated_at":"2025-01-02T11:09:43-05:00","messages":["Needs at least one image."],"feedback_generated_at":"2025-01-02T10:22:20-05:00","state":"requires_action"}]}
```