In the API docs for the Delivery Updated Webhook, the schema body has all fields set as optional.
This is a difficult schema to build against as it requires a lot of additional defensive code. I imagine that it’s hard to define because the schema’s required fields will be different depending on the status of the delivery.
I was wondering if this is the case and if so, is it possible to get a more detailed schema of which fields i can expect to be sent for each delivery status?
My best advice would be to play around in our Sandbox environment, here you can create orders and receive webhook updates with the payloads mimicking our Production environment.
Our Sandbox environment is currently set up for happy path testing, where the final order status is ‘delivered’. However, I can tell you that the ‘cancellation’ object is most likely what you need when it comes to unhappy path statuses. More information on tracking our unhappy paths can be found in our API documentation here.
Don’t hesitate to reach out if you have additional questions, we are also available to help you run edge case testing in our Sandbox environment if you’d like to test any of those scenarios in the linked cancellation reasons page.