A common error we see with IRD payday filing is where FlexiTime accounts are connected to the wrong myIR accounts, or to an account that doesn't have access to do payday filing. When you authorise with myIR, FlexiTime is not told what myIR login was used, and cannot tell if there is a problem until we come to file a pay. An 'Unauthorised Delegation' error returned from the IRD when we file the pay is saying that the myIR account doesn't have permission to do the filing.
If you're a new company, ensure that you are registered as an employer with the IRD.
You need to ensure you have the correct permissions for payday filing. If your myIR login does not have the 'owner' role then you will need to get the owner to grant you new access. This article explains how to go about this. Alternatively, use the myIR login with the owner role when you connect FlexiTime to IRD.
Another common way this comes about is where you are automatically logged in by IRD to the latest myIR account you used. You may have been logged into your personal myIR account or a myIR account for another company. Then when you do the authorisation step in FlexiTime, instead of going to the login page for IRD, you're automatically logged in to the previous company and so the link is going to the wrong place.
To correct you should go to Setup > Company Settings > Connect, and Disconnect from payday filing, then authorise again. If you're still automatically logged in (so aren't prompted for a myIR username and password) then you should open a new window, go directly to myIR, then explicitly log out. Now repeat the authorisation from FlexiTime, and this time you'll have to log in to myIR.
If you're a tax agent, ensure that the myIR user you are using has filing access for the company.
Finally, check that the IRD number entered for the company under Setup > Company Settings is correct.
Once you've resolved the issue you should resend any pays for the current period to IRD. View the pay and under Options you can select Resend to IRD.