Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
benedict-odonovan opened this issue Jun 9, 2023 · 3 comments

Comments

@benedict-odonovan
Copy link

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

  • Xero.NetStandard.OAuth2 3.32.0
  • Xero.NetStandard.OAuth2Client 1.6.0

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
Copy link

github-actions bot commented Jun 9, 2023

PETOSS-301

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

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

@a-stankevich
Copy link

a-stankevich commented Jun 9, 2023

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants