I am currently implementing the data integration of the GraphQL InventoryTransfer and InventoryShipment into our application and I have notices a couple of limitations/shortfalls regarding the tracking of this data using webhooks. See below;
- New InventoryTransfer - While I can query all available InventoryTransfer using the inventoryTransfers query, there is no webhook indicating when an InventoryTransfer is created. Currently the earliest a webhook is received is when a transfer is set to “ready to ship”. This means there is no update for InventoryTransfer objects while in draft mode. I am not sure if this is intentional as the inventoryTransfers query does return the draft InventoryTransfers object so the data is available in the API. Our application is subscribin to all the INVENTORY_TRANSFER and INVENTORY_SHIPMENT webhooks documented in Webhooks . Are all the topics documented or is there just no webhook to track draft InventoryTransfer objects?
- InventoryShipment link to InventoryTransfer - In the GraphQL API the InventoryTransfer object has an InventoryShipmentConnection which allows to link the InventoryShipment object to its parent InventoryTransfer object. However the InventoryShipment object does not have an InventoryTransfer object. Given that none of the inventory_shipments webhook includes the InventoryTransfer id it means there is no way to link the InventoryShipment to the associated InventoryTransfer object when tracking via webhook which is a problem for our users when reporting on this data. Would it be possible to consider adding an InventoryTransfer object or at least the InventoryTransfer id to the InventoryShipment object so these objects can be tracked together? If not we would at least need to have the inventory transfer id provided in all the inventory_shipments webhooks.
Hey @Mathieu_Nunez
From digging into this it seems that there’s no webhook topic that fires when an InventoryTransfer is created in draft mode. The earliest webhook event available is when the transfer is set to “ready to ship.”
To track draft InventoryTransfer objects, you’ll need to periodically poll the inventoryTransfers query and reconcile with your local state. Shopify recommends implementing reconciliation jobs for scenarios where webhook coverage is incomplete or not guaranteed.
Would it be possible to consider adding an InventoryTransfer object or at least the InventoryTransfer id to the InventoryShipment object so these objects can be tracked together? If not we would at least need to have the inventory transfer id provided in all the inventory_shipments webhooks.
Connecting internally to see if this is on our radar already - will report back! Can you describe specific usecases that this would be beneficial for you? Knowing these scenarios will help us to evaluate investing development work to support this.
@Liam-Shopify thank you for confirming. Unfortunately in this case the polling is not a real practical option. This entity does not have an updatedAt field which means we would need to poll for all InventoryTransfer objects which have not been completed or canceled yet to reconcile data which would mean a very large number of API queries to serve all merchants using our application.
Merchants are using our application to report on their store activities as part of their business workflow and they do require accurate data to be able to make decisions and take actions. Incomplete or stale data means the information cannot serve their purpose. Having webhook triggered every time an InventoryTransfer object is created is essential for merchants to keep track of their inventory activities as well as having webhook when those objects are updated. The other option would be to add an updatedAt field to the object so polling can be used as a reconciliation mechanism. For now the only thing we can do is let merchants know that until their inventory transfer is in “ready to ship” status the data cannot be made available.
@Liam-Shopify do you have any update on this topic? I did further testing and potentially the happenedAt field could be used to only poll the updated draft InventoryTransfer if it updates every time the InventoryTransfer is updated. Is that something you can check on your end?