PayRuns


Overview

URL https://api.xero.com/payroll.xro/1.0/PayRuns
Methods Supported POST, GET
Description Allows you to retrieve, add and update pay runs in a Xero organisation

Elements for PayRuns

The following are required to create a new pay run
PayRunPeriodEndDate Period End Date for the PayRun
PayRunStatus See PayRun Status types

Other Elements for PayRuns

PayRunID Xero identifier for pay run
PayrollCalendarID See PayrollCalendars
PayslipMessage Payslip message for the PayRun
The following are returned on a GET request
Payslips See Payslip
PayRunPeriodStartDate Period Start Date for the PayRun
PaymentDate Payment Date for the PayRun
Wages Total Wages for the PayRun
Deductions Total Deduction for the PayRun
Tax Total Tax for the PayRun
Super Total Super for the PayRun
Reimbursement Total Reimbursement for the PayRun
NetPay Total NetPay for the PayRun

GET PayRuns

Optional parameters for GET PayRuns

Record filter You can specify an individual record by appending the value to the endpoint, i.e.
GET https://…/PayRuns/{identifier}
PayRunID The Xero identifier for a Pay run e.g. 297c2dc5-cc47-4afd-0000-74990b8761e9
Modified After The ModifiedAfter filter is actually an HTTP header: ‘If-Modified-Since‘.
A UTC timestamp (yyyy-mm-ddThh:mm:ss) . Only employees created or modified since this timestamp will be returned e.g. 2009-11-12T00:00:00
page By default the number of records returned per call is 100. You can add GET https://…/payruns?page=2 to get the next set of records
Where Use PayRunStatus==Draft for all Draft Payrun and use PayRunStatus==Posted for all posted payruns. Filter by an any element (see Filters)
order Order by any element returned (see Order By)

Example response for GET PayRuns/{identifier}

<PayRuns>
   <PayRun>
     <Deductions>260.04</Deductions>
     <NetPay>18831.25</NetPay>
     <PayRunID>e3bdb2f7-2b20-45e6-ac8d-ec67d17de9f4</PayRunID>
     <PayRunPeriodEndDate>2012-01-07T00:00:00</PayRunPeriodEndDate>
     <PayRunPeriodStartDate>2012-01-01T00:00:00</PayRunPeriodStartDate>
     <PayRunStatus>Posted</PayRunStatus>
     <PaymentDate>2012-01-08T00:00:00</PaymentDate>
     <PayrollCalendarID>bfac31bd-ea62-4fc8-a5e7-7965d9504b15</PayrollCalendarID>
     <Payslips>
       <Payslip>
         <Deductions>0.00</Deductions>
         <EmployeeID>f3f29c96-77d7-44f0-80fc-0e87dea2320d</EmployeeID>
         <FirstName>Bucky</FirstName>
         <LastEdited>2012-03-27T23:33:35</LastEdited>
         <LastName>Lasek</LastName>
         <NetPay>441.00</NetPay>
         <PayslipID>2d3a0cf2-6b1c-499d-a2bb-dda0cdad7634</PayslipID>
         <Reimbursements>0.00</Reimbursements>
         <Super>43.56</Super>
         <Tax>43.00</Tax>
         <Wages>484.00</Wages>
       </Payslip>
       <Payslip>
         <Deductions>0.00</Deductions>
         <EmployeeID>dcdb554d-2dbf-4a4f-99dd-c3fc6fafb7f3</EmployeeID>
         <FirstName>Chet</FirstName>
         <LastEdited>2012-03-27T23:33:39</LastEdited>
         <LastName>Taylor</LastName>
         <NetPay>1261.20</NetPay>
         <PayslipID>3586f5b4-9a04-4c2d-8ab6-3e1b34de0b62</PayslipID>
         <Reimbursements>0.00</Reimbursements>
         <Super>151.31</Super>
         <Tax>420.00</Tax>
         <Wages>1681.20</Wages>
       </Payslip>       
       <Payslip>
         <Deductions>0.00</Deductions>
         <EmployeeID>c3896c4a-da46-489c-89c6-e48bcef655ef</EmployeeID>
         <FirstName>Ray</FirstName>
         <LastEdited>2012-03-27T23:41:28</LastEdited>
         <LastName>Barbee</LastName>
         <NetPay>889.33</NetPay>
         <PayslipID>c7196baa-3248-4801-ad7b-ae353b7b2f8c</PayslipID>
         <Reimbursements>0.00</Reimbursements>
         <Super>100.11</Super>
         <Tax>223.00</Tax>
         <Wages>1112.33</Wages>
       </Payslip>       
     </Payslips>
     <Super>2539.97</Super>
     <Tax>6651.00</Tax>
     <Wages>25742.29</Wages>
   </PayRun>
 </PayRuns>

Example response for GET PayRuns

  <PayRuns>
    <PayRun>
      <Deductions>260.04</Deductions>
      <NetPay>18831.25</NetPay>
      <PayRunID>e3bdb2f7-2b20-45e6-ac8d-ec67d17de9f4</PayRunID>
      <PayRunPeriodEndDate>2012-01-07T00:00:00</PayRunPeriodEndDate>
      <PayRunPeriodStartDate>2012-01-01T00:00:00</PayRunPeriodStartDate>
      <PayRunStatus>Posted</PayRunStatus>
      <PaymentDate>2012-01-08T00:00:00</PaymentDate>
      <PayrollCalendarID>bfac31bd-ea62-4fc8-a5e7-7965d9504b15</PayrollCalendarID>
      <Super>2539.97</Super>
      <Tax>6651.00</Tax>
      <Wages>25742.29</Wages>
    </PayRun>
    <PayRun>
      <Deductions>260.04</Deductions>
      <NetPay>22463.25</NetPay>
      <PayRunID>7c998e04-1cee-4a19-bfe6-3cbfd5cb9cea</PayRunID>
      <PayRunPeriodEndDate>2012-01-14T00:00:00</PayRunPeriodEndDate>
      <PayRunPeriodStartDate>2012-01-08T00:00:00</PayRunPeriodStartDate>
      <PayRunStatus>Posted</PayRunStatus>
      <PaymentDate>2012-01-15T00:00:00</PaymentDate>
      <PayrollCalendarID>bfac31bd-ea62-4fc8-a5e7-7965d9504b15</PayrollCalendarID>
      <Super>2892.78</Super>
      <Tax>6939.00</Tax>
      <Wages>29662.29</Wages>
    </PayRun>   
  </PayRuns>

POST PayRuns

Example request for creating a scheduled PayRun

<PayRuns>
  <PayRun>
    <PayrollCalendarID>bba1d10f-63b1-4692-b5c5-a99f869523a4</PayrollCalendarID>    
  </PayRun>
</PayRuns>

Example request for creating an unscheduled PayRun

<PayRuns>
  <PayRun>
    <PayrollCalendarID>bba1d10f-63b1-4692-b5c5-a99f869523a2</PayrollCalendarID>
    <PayRunPeriodEndDate>2013-02-07T00:00:00</PayRunPeriodEndDate>
  </PayRun>
</PayRuns>

Example request for creating and Posting a scheduled PayRun

<PayRuns>
  <PayRun>
    <PayrollCalendarID>bba1d10f-63b1-4692-b5c5-a99f869523a2</PayrollCalendarID>
    <PayRunStatus>POSTED</PayRunStatus>
  </PayRun>
</PayRuns>

Example request for creating and Posting an unscheduled PayRun

<PayRuns>
  <PayRun>
    <PayrollCalendarID>bba1d10f-63b1-4692-b5c5-a99f869523a2</PayrollCalendarID>
    <PayRunPeriodEndDate>2013-02-07T00:00:00</PayRunPeriodEndDate>
    <PayRunStatus>POSTED</PayRunStatus>
  </PayRun>
</PayRuns>