Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
The docs for the webhooks show a bunch of examples (https://shopify.dev/docs/api/admin-rest/2023-01/resources/webhook#event-topics) without a proper type definition. Is there a page documenting the types? I'm validating the webhooks with zod (https://github.com/colinhacks/zod), and I would like to have the webhook full-typed.
While Shopify's webhook documentation provides examples of webhook payloads, there isn't a specific page that documents the types for each webhook event. However, you can use the Shopify API documentation to infer the types of the webhook payloads.
By referencing the API documentation for the corresponding resource and endpoint related to the webhook event, you can find the structure and types of the data being sent. You can then use this information to define the types in your validation library (such as zod) for handling the webhook payloads.
Make sure to check the specific API version you're using, as the structure of webhook payloads may vary between versions.