I'm trying to integrate with a client's custom fulfillment application only for a specific type of "card" that will be offered for purchase through Shopify.
So far I've created the unique product in Shopify, then I setup an Order Payment webhook to fire on every order upon successful payment. My application will then loop through the order line items and detect if the specific product ID is present. If present, it executes the rest of the code.
My question is, can I somehow just trigger a webhook if a specific product is present in the order? Has anyone created something similar and willing to share their method?
I'm fairly certain the Shopify webhooks are event driven. If you have subscribed to a specific event type, then the requests are sent for any event that matches of that specific event type. I think as the receiver you are responsible for sending back a response within a certain period of time, and then handling the request data that was sent over. In other words, I think the mechanism isn't granular enough to only send requests for a specific record. It's up to you to parse the requests and only take action based upon the record you are looking for.