Development discussions around Shopify APIs
Hello,
We have found that for some Products, the payload we receive in the "products/update" webhooks are similar, except for the `updated_at` field, which constantly gets updated and sends the current timestamp.
In an attempt to find any other updated fields that explain this change, we have used the REST API, but only `updated_at` changes between calls. This is using endpoint https://<shop_domain>.myshopify.com/admin/api/2022-04/products/<product_id>.json
Not sure if it's a coincidence, but considering the last 7 days of webhooks we have received, it was found that the products generating the most webhook traffic have `published_at = null`. Using the GraphQL with the following query shows that the only other field changing constantly is `onlineStorePreviewUrl` (same URL, but `preview_key` URL param being updated).
{
product(id: "gid://shopify/Product/<product_id>") {
collections(first: 5) {
edges {
node {
handle
}
}
}
createdAt
defaultCursor
description
descriptionHtml
featuredImage {
id
}
feedback {
details {
messages {
message
}
}
}
giftCardTemplateSuffix
handle
hasOnlyDefaultVariant
hasOutOfStockVariants
id
images(first: 5) {
edges {
node {
id
}
}
}
isGiftCard
legacyResourceId
metafield(key: "app_key", namespace: "affiliates") {
description
}
metafields(first: 5) {
edges {
node {
description
}
}
}
onlineStorePreviewUrl
onlineStoreUrl
options {
name
}
priceRange {
maxVariantPrice {
amount
}
minVariantPrice {
amount
}
}
productType
publishedAt
seo {
title
}
storefrontId
tags
templateSuffix
title
totalInventory
totalVariants
tracksInventory
updatedAt
variants(first: 5) {
edges {
node {
displayName
}
}
}
vendor
}
}
We are trying to reduce the processing load in our systems, but without being able to use `updated_at`, we would need to deduplicate messages considering the entire payload, comparing against previously received webhooks.
If needed, we can provide more information about the specific shop_id/product_id we used for the current investigation.
Thanks in advance for the support,
We are facing exact same issue, on top of it sitemap.xml is also updated and last modified date on sitemap is also showing as fresh while nothing changed on the product…
We have exactly the same issue, update_at gets updated without any field or metafield on the actual product being changed. I believe it is because an inventory change also counts as an "update" on a product.
It is a massive problem for us as we try to pull updated products into our integrations we have to do a lot of de-duplication with hash comparisons and when we get 1000's of "updated" products per day (when there is only a handful real updates), the load on our services can be quite heavy.
This is even a much bigger problem. By changing this field with every order, the competition can see exactly which product was purchased and when. The total turnover of the store can be calculated and is public. Some browser extensions and tools are already available.
The inventory levels are updated not only by Orders related to specific purchased product (I agree that it can be used to track the sales) but also by fulfillment apps or ERP apps which are making a bulk requests to set Inventory levels of multiple products.
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023