discountResourceFeedback
Requires access scope. Also: App must be configured to use the Storefront API or as a Sales Channel.
Returns the discount resource feedback for the currently authenticated app.
Arguments
- •ID!required
The discount associated with the resource feedback.
Anchor to Possible returnsPossible returns
- Anchor to DiscountResourceFeedbackDiscount•
Resource Feedback Reports the status of discount for a Sales Channel or Storefront API. This might include why a discount is not available in a Sales Channel and how a merchant might fix this.
- discount
Id •ID!non-null The ID of the discount associated with the feedback.
- discount
Updated •At Datenon-nullTime! The timestamp of the discount associated with the feedback.
- feedback
Generated •At Datenon-nullTime! The time when the feedback was generated. Used to help determine whether incoming feedback is outdated compared to existing feedback.
- messages•[String!]!non-null
The feedback messages presented to the merchant.
- state•Resourcenon-null
Feedback State! Conveys the state of the feedback and whether it requires merchant action or not.
- discount
- Get a discount resource feedback record by ID
- Get a discount resource feedback record by ID that doesn't exist
Examples
query {
discountResourceFeedback(id: "gid://shopify/DiscountNode/240556786") {
feedbackGeneratedAt
messages
discountId
discountUpdatedAt
state
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/unstable/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { discountResourceFeedback(id: \"gid://shopify/DiscountNode/240556786\") { feedbackGeneratedAt messages discountId discountUpdatedAt state } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
discountResourceFeedback(id: "gid://shopify/DiscountNode/240556786") {
feedbackGeneratedAt
messages
discountId
discountUpdatedAt
state
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
discountResourceFeedback(id: "gid://shopify/DiscountNode/240556786") {
feedbackGeneratedAt
messages
discountId
discountUpdatedAt
state
}
}`,
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query {
discountResourceFeedback(id: "gid://shopify/DiscountNode/240556786") {
feedbackGeneratedAt
messages
discountId
discountUpdatedAt
state
}
}
QUERY
response = client.query(query: query)