QuickBooks-V3-DotNET-SDK
QuickBooks-V3-DotNET-SDK copied to clipboard
Error converting value "Bounced Email" to type DeliveryErrorTypeEnum
When attempting to deserialize the JSON result of a QuickBooks Query API request into an Intuit.Ipp.Data.Invoice object, I am encountering the following error for some invoices:
Error converting value "Bounced Email" to type 'Intuit.Ipp.Data.DeliveryErrorTypeEnum'.
It seems the QB API is returning the delivery error type with a whitespace character, which the SDK is failing to parse to the DeliveryErrorTypeEnum.BouncedEmail value.
Is this an issue with the SDK or the API? I posted a similar question on the Intuit Developer site, but haven't yet received any useful feedback.
Thanks!
Json snipppet:
"QueryResponse": { "Invoice": [ { ... "DeliveryInfo": { "DeliveryType": "Email", "DeliveryTime": "2021-12-09T07:39:49-08:00", "DeliveryErrorType": "Bounced Email" } } ], "startPosition": 1, "maxResults": 1, "totalCount": 1 }, "time": "2021-12-10T12:44:45.752-08:00"
Which minorversion are you on? Yeah, this seems like an API issue to me as we never had this issue in the past.
We're using v14.6.1 of the SDK and minorversion 62 of the API. I tried minorversion 63 from my local environment, but unfortunately encountered the same error.
@arolloff I am not able to replicate this issue in my local. Can you please share the code where you are facing the issue
@rkasaraneni20 I've created a repo with a simple console app that reproduces the behavior, including a genericized JSON response (BouncedEmailResponse.json) that causes the issue. Repo
The error occurs in QuickbooksService.ExecuteHttpRequestAsync on line 75, when trying to hydrate the JSON response into a QueryResponse object.
This code works for the overwhelming majority of our client's invoices; it only fails in the rare cases where the DeliveryInfo portion of the response contains "DeliveryErrorType": "Bounced Email".