.NET SDK test webhook subscription fails to deserialize into model.
Describe the bug The TestWebhookSubscriptionResponse type does not match the payload for the test webhook subscription response, and therefore doesn't deserialize and the response objects contains no data.
Expected behavior The TestWebhookSubscriptionResponse type should match the payload that is returned in the response for proper deserialization.
To Reproduce Steps to reproduce the bug:
- Create a webhook subscription in C#
- Retrieve the subscription id from the create response.
- Call the SquareClient.Webhooks.Subscriptions.TestAsync() method given a TestWebhooSubscriptionRequest object with the created event type and subscription ID in the required properties.
- await and inspect the response object.
Screenshots If applicable, add screenshots to help explain the bug.
Square SDK version .tested in net 42.0.2 and 42.2.0
Additional context API reference response shown here: https://developer.squareup.com/reference/square/webhook-subscriptions-api/test-webhook-subscription
{
"subscription_test_result": {
"id": "23eed5a9-2b12-403e-b212-7e2889aea0f6",
"status_code": 404,
"payload": "{...}",
"created_at": "2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746",
"updated_at": "2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746"
}
}
The above matches what should be the TestWebhookSubscription .NET type: https://github.com/square/square-dotnet-sdk/blob/9a98fde9c6e36797ffd0e1cf2abd33afc61f3409/src/Square/Types/TestWebhookSubscriptionResponse.cs#L15
The following is the response returned in the API Explorer.
This is also the format that is returned when testing on the sandbox through postman and my .net code.
I have not tested the live square api.
https://developer.squareup.com/explorer/square/webhook-subscriptions-api/test-webhook-subscription
{
"notification_url": "https://.../webhooks/customer-custom-attribute-updated",
"status_code": 504,
"passes_filter": true,
"payload": {
"merchant_id": "...",
"type": "customer.custom_attribute.owned.updated",
"event_id": "b0db917c-f556-4271-b90b-d1f0c3eb400e",
"created_at": "2025-11-19T09:57:05Z",
"data": {
"type": "custom_attribute",
"id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR",
"object": {
"created_at": "2022-04-21T21:40:54Z",
"key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink",
"updated_at": "2022-04-21T21:40:54Z",
"value": "Double-shot breve",
"version": 1,
"visibility": "VISIBILITY_READ_ONLY"
}
}
}
}