This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Pay Stubs in Xero



Overview

The following operations allow you to work with pay stubs. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with pay stubs, see Sample configuration

OperationDescription

getPayStubs

Retrieves pay stubs.

postPayStubsCreates or updates pay stubs.

Operation details

This section provides further details on the operations related to pay stubs.

Retrieving pay stubs

The getPayStubs operation retrieves one or more pay stubs.

getPayStubs
<xero.getPayStubs>
	<payStubsId>{$ctx:payStubsId}</payStubsId>
</xero.getPayStubs>
Properties
  • payStubsId: The unique identifier of the pay stub.
Sample request

Following is a sample REST/XML request that can be handled by the getPayStubs operation.

Sample Request for getPayStubs
<getPayStubs>
    <consumerKey>QTOZOQXH5QWF5RUD98XI2RLZVYPUWT</consumerKey>
    <consumerSecret>KYPLCBPH3TF8ZQO3S2K1WCRVBJVZAQ</consumerSecret>
    <accessToken>S0VQ1N7O4OLMHXCMC1HWWFV9FWFFVG</accessToken>
    <accessTokenSecret>EZR4W7CMCA2KCSZLJRZR4U6IXDXGLB</accessTokenSecret>
    <acceptType>application/json</acceptType>
    <apiUrl>https://api.xero.com</apiUrl>
	<payStubsId>0b204c3a-6d18-48fc-a023-1ca7a02bbb15</payStubsId>
</getPayStubs>
Related Xero documentation
http://developer.xero.com/documentation/payroll-api-us/pay-stubs/#GET

Creating or updating pay stubs

The postPayStubs operation creates or updates one or more pay stubs. 

postPayStubs
<xero.postPayStubs>
	<payStubs>{$ctx:payStubs}</payStubs>
</xero.postPayStubs>
Properties
  • payStubs: You can pass details of one or more pay stubs through this property.
Sample request

Following is a sample REST/XML request that can be handled by the postPayStubs operation.

Sample Request for postPayStubs
<postPayStubs>
   <consumerKey>QTOZOQXH5QWF5RUD98XI2RLZVYPUWT</consumerKey>
   <consumerSecret>KYPLCBPH3TF8ZQO3S2K1WCRVBJVZAQ</consumerSecret>
   <accessToken>GQB01NGSA9X2TC64SF0GEDUXISGWJN</accessToken>
   <accessTokenSecret>ABDWFU94ZMNRGKHTJJU7NBXBN4VPSL</accessTokenSecret>
   <acceptType>application/json</acceptType>
   <apiUrl>https://api.xero.com</apiUrl>
   <payStubs>
        <Paystub>
          <EmployeeID>b57b566e-c24e-4004-a06f-7403b9b3c5a9</EmployeeID>
          <PaystubID>0b204c3a-6d18-48fc-a023-1ca7a02bbb15</PaystubID>
          <EarningsLines>
            <EarningsLine>
              <EarningsTypeID>91ab8d89-f728-45fa-b15d-ca65e07d7fd8</EarningsTypeID>
              <RatePerUnit>30.0000</RatePerUnit>
              <NumberOfUnits>43.0000</NumberOfUnits>
            </EarningsLine>
    	 	</EarningsLines>
        </Paystub>
   </payStubs>
</postPayStubs>
Related Xero documentation
http://developer.xero.com/documentation/payroll-api-us/pay-stubs/#POST

Sample configuration

Following is a sample proxy service that illustrates how to connect to Xero with the init operation and use the getPayStubs operation. The sample request for this proxy can be found in getPayStubs sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="xero_getPayStubs"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="consumerKey" expression="//consumerKey/text()"/>
         <property name="accessToken" expression="//accessToken/text()"/>
         <property name="accessTokenSecret" expression="//accessTokenSecret/text()"/>
         <property name="apiUrl" expression="//apiUrl/text()"/>
         <property name="consumerSecret" expression="//consumerSecret/text()"/>
         <property name="acceptType" expression="//acceptType/text()"/>
         <property name="payStubsId" expression="//payStubsId/text()"/>
         <xero.init>
            <consumerKey>{$ctx:consumerKey}</consumerKey>
            <accessToken>{$ctx:accessToken}</accessToken>
            <accessTokenSecret>{$ctx:accessTokenSecret}</accessTokenSecret>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <consumerSecret>{$ctx:consumerSecret}</consumerSecret>
            <acceptType>{$ctx:acceptType}</acceptType>
         </xero.init>
         <xero.getPayStubs>
            <payStubsId>{$ctx:payStubsId}</payStubsId>
         </xero.getPayStubs>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>