Where can I find docs for webhooks types?

Nullndr
Shopify Partner
6 0 0

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.

Reply 1 (1)
PMike
Shopify Partner
134 12 19

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.

Fordeer Invoice Order Printer - The great tool for the best business!
https://link.fordeer.io/YZL4Ge