0

Xero Payroll API

Hi There

I'm wanting to connect to the Xero Payroll API (https://developer.xero.com/documentation/payroll-api/overview/) 

I've replaced the "api.xero.com" domain with "api-partner.network.xero.com" but still I get a 401 error.  As an example, I tried creating a connection to https://api-partner.network.xero.com/payroll.xro/1.0/PayRuns

Does anyone know whether this is possible or what we need to do to get it working?

According to Xero you need to add special scope querystring parameter to the oAuth (eg. &scope=payroll.employees) but not sure if this is applicable to the api-partner.network oauth process as well.

Thanks

Marcus

 

 

3 comments

  • 0
    Avatar
    Live Numbers

    Okay

    I just tested it out and if I manually add the scope property to the OAUTH page then I can access the Payroll API

    &scope=payroll.employees%2Cpayroll.superfunds%2Cpayroll.leaveapplications%2Cpayroll.payitems%2Cpayroll.payrollcalendars%2Cpayroll.payruns%2Cpayroll.payslip%2Cpayroll.timesheets%2Cpayroll.settings

     

    So on the Xero Auth page I added above to the URL and reloaded page and then selected the Business as per normal.  Now I can call the Payroll API endpoints.

    Perhaps you (Klipfolio) could look at having an option when you connect to Xero to say "Include Payroll" which adds this querystring automatically?

    Regards,

    Marcus

     

     

  • 0
    Avatar
    Stephen Yates

    Hi Marcus, thank you for sharing this. We will investigate adding this to our Xero integration.

     

  • 0
    Avatar
    Dashboard Magic admin

    Hi Stephen,

    Any idea if the payroll timesheets and other payroll scopes (other than employees, which is already added) are going to be added to the Xero Authentication?

    The above workaround no longer seems to work and we are looking to pull timesheet data. After checking the auth page, it looks like this is not included in the scope and is subsequently resulting in a 401 when we try to pull this.

    Thanks

    Chris

Please sign in to leave a comment.