XeroAPI / Xero-NetStandard

A wrapper of the Xero API in the .NetStandard 2.0 framework. Supports Accounting, Payroll AU/US, and Files
MIT License
118 stars 119 forks source link

Missing "RECEIVE-OVERPAYMENT" value from type "Accounting.Prepayment+TypeEnum" #477

Open benedict-odonovan opened 1 year ago

benedict-odonovan commented 1 year ago

SDK you're using (please complete the following information):

Describe the bug Calling GetPrepaymentsAsync throws a JSONSerializationException stating:

Error converting value "RECEIVE-OVERPAYMENT" to type 'Xero.NetStandard.OAuth2.Model.Accounting.Prepayment+TypeEnum'. Path 'Prepayments[0].Type', line 10, position 35.

and a null value is returned.

To Reproduce Steps to reproduce the behavior:

  1. Call await api.GetPrepaymentsAsync(accessToken, xeroTenantId, fromDate, page: page); with correct parameters that work for other API endpoints.

Expected behavior The results to serialize correctly and not return a null value.

github-actions[bot] commented 1 year ago

PETOSS-301

github-actions[bot] commented 1 year ago

Thanks for raising an issue, a ticket has been created to track your request

a-stankevich commented 1 year ago

Currently in response to GetPrepayments request Xero API returns extra records with types SPEND-OVERPAYMENT and RECEIVE-OVERPAYMENT. Those records can't be deserialized by the library which results in entire recordset being null.

The workaround that seems to work for now is to use where parameter with value Type=="RECEIVE-PREPAYMENT"||Type=="SPEND-PREPAYMENT"