Admin API JSON Data is Different Than StoreFront API

Boneo
Visitor
2 0 0
Our e-commerce is a mobile app that is built by using StoreFront API for the front-end & Admin API for the back-end, we have faced few issues regarding the differences between the models in both APIs, which is:
 
- We created some Webhooks such as "product update" which is built using Admin API whenever a product gets updated, but the issue is whenever we use this data into our app some of the variable inside Product model is missing such as feature_image & price_range.
Reply 1 (1)
EcomGraduates
Shopify Partner
588 48 72

One possible solution could be to use the StoreFront API to retrieve the missing variables. You can use the product ID obtained from the webhook to fetch the product details using the StoreFront API.

Here's an example query that you can use to retrieve the feature image and price range using the StoreFront API:

 

 

query getProduct($id: ID!) {
  product(id: $id) {
    id
    featuredImage {
      originalSrc
    }
    priceRange {
      maxVariantPrice {
        amount
        currencyCode
      }
      minVariantPrice {
        amount
        currencyCode
      }
    }
  }
}