I am using the C# SDK Api communicating to a local filew on my network and I can successfully create and then get the employee. I want to then update that employees PayrollDetails. However, I get a 409 conflic error and I cannot see what I am doing wrong. Below is my code. The repositories definately return the correct employee and payroll details but when I call the update method it gives me a 409 conflict error and nothing else
I create the employee first and then do another call to get the employee. This allows me to then populate the payrolldetails
Should I be creating the employee and the payroll details at the same time? The endpoint doco says that payroll details are only GET, PUT
//gets the employee
var employee = _myobEmployeeRepository.Get(uri);
//gets the payroll details of the employee
var prd =_myobEmployeeRepository.GetPayrollDetails(employee.EmployeePayrollDetails.UID);
prd.Employee = new EmployeeLink{UID = employee.UID};
prd.DateOfBirth = DateTime.Parse(request.MyobEmployeeDto.DateOfBirth);
prd.StartDate = DateTime.Now;
prd.EmploymentBasis = EmploymentBasis.Individual;
prd.EmploymentCategory = EmploymentCategory.Permanent;
prd.PaySlipDelivery = PaySlipDelivery.ToBeEmailed;
prd.PaySlipEmail = request.MyobEmployeeDto.PrimaryEmail;
prd.RowVersion = "10";
//attempt to update
var service = new EmployeePayrollDetailsService();
var e = service.Update(CompanyFile, employeePayrollDetails, Credentials); //throws 409 conflict