Webhook Object Help

Hi, I need help. I have a netcore project and I am sending my Event “customer.create” and I get the JSON, but how do I deserialize it to the object WEBHOOK? I can’t find it in the Square SDK from my nuget package in Visual Studio.

Please help

Here is the object I’m taking about.

You should be able to use the .NET functions to deserialize the JSON webhook body. :slightly_smiling_face:

ha, yeah that’s the easy part. I’m asking is there a Webhook model or class in the Square SDK that I can deserialize the json INTO?

Currently I am doing this, and it just looks messy to me:

var request = HttpContext.Request;
                var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();

                Customer customer = JsonConvert.DeserializeObject<Customer>(JObject.Parse(json)["data"]["object"]["customer"].ToString());