0

I am attempting to create a single opening balances record against an existing employee but keep getting a 400 Bad Request response with this detail... At least one NZ opening balance item is required in the request

I am following the instructions as per this documentation...

https://developer.xero.com/documentation/api/payrollnz/employeeopeningbalances#post-opening-balances

URL : {DestinationID} is properly replaced with the employee GUID
https://api.xero.com/payroll.xro/2.0/employees/{DestinationID}/openingBalances

JSON Body
[{"periodEndDate":"2011-01-30T00:00:00","daysPaid":5.00,"unpaidWeeks":0.00,"grossEarnings":1442.31}]

The Xero forums and support is pretty unreliable so I'm posting here in the hopes for a better response.

Tommy Sharp
  • 65
  • 2
  • 8

1 Answers1

0

After some trial and error using the API Explorer that Xero provides I was able to get it working using their example....

I eventually learned that daysPaid and unpaidWeeks must both be integer whole numbers or else it fails.... The error message provided is misleading but this resolves the problem.

Tommy Sharp
  • 65
  • 2
  • 8