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 Runs in Xero
Overview
The following operations allow you to work with pay runs. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with pay runs, see Sample configuration.
Operation | Description |
---|---|
Retrieves pay runs. | |
postPayRuns | Creates or updates pay runs. |
Operation details
This section provides further details on the operations related to pay runs.
Retrieving pay runs
The getPayRuns
operation retrieves one or more pay runs.
<xero.getPayRuns> <payRunId>{$ctx:payRunId}</payRunId> <order>{$ctx:order}</order> <page>{$ctx:page}</page> <modifiedAfter>{$ctx:modifiedAfter}</modifiedAfter> <where>{$ctx:where}</where> </xero.getPayRuns>
Properties
The identifier of a pay run.payRunId:
The parameter by which the pay runs to be retrieved are sorted.order:
The page number of the list of pay runs that needs to be retrieved.page:
The timestamp after which the pay runs are retrieved. If specified, only pay runs created or modified after this timestamp will be retrieved.modifiedAfter:
The parameter by which the pay runs to be retrieved are filtered.where:
Sample request
Following is a sample REST/XML request that can be handled by the getPayRuns
operation.
<getPayRuns> <consumerKey>MTNHJDG982PLCI6TPSPNHL2XVFU0ZS</consumerKey> <consumerSecret>ESGHJSFWNTWX5ZG8WRP61PF69SX9BP</consumerSecret> <accessToken>X6BQ4JJHF9QQT0ARIA3T55FHYDZHUV</accessToken> <accessTokenSecret>X5NTNOIY29TPX1WBM1WEV7ORJUCEVB</accessTokenSecret> <acceptType></acceptType> <apiUrl>https://api.xero.com</apiUrl> <payRunId></payRunId> <order></order> <page>1</page> <modifiedAfter></modifiedAfter> <where></where> </getPayRuns>
Related Xero documentation
http://developer.xero.com/documentation/payroll-api-us/pay-runs/#GET
Creating or updating pay runs
The postPayRuns operation creates or updates one or more pay runs.
<xero.postPayRuns> <payRuns>{$ctx:payRuns}</payRuns> </xero.postPayRuns>
Properties
Pay run details. You can pass details of one or more pay runs through this property.payRuns:
Sample request
Following is a sample REST/XML request that can be handled by the postPayRuns operation.
<postPayRuns> <consumerKey>MTNHJDG982PLCI6TPSPNHL2XVFU0ZS</consumerKey> <consumerSecret>ESGHJSFWNTWX5ZG8WRP61PF69SX9BP</consumerSecret> <accessToken>X6BQ4JJHF9QQT0ARIA3T55FHYDZHUV</accessToken> <accessTokenSecret>X5NTNOIY29TPX1WBM1WEV7ORJUCEVB</accessTokenSecret> <acceptType>application/json</acceptType> <apiUrl>https://api.xero.com</apiUrl> <payRuns> <PayRun> <PayScheduleID>825e768e-a675-4ac7-9e4d-f9c86dab2940</PayScheduleID> </PayRun> </payRuns> </postPayRuns>
Related Xero documentation
http://developer.xero.com/documentation/payroll-api-us/pay-runs/#POST
Sample configuration
Following is a sample proxy service that illustrates how to connect to Xero with the init
operation and use the getPayRuns operation. The sample request for this proxy can be found in getPayRuns sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="xero_getPayRuns" 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="payRunId" expression="//payRunId/text()"/> <property name="order" expression="//order/text()"/> <property name="page" expression="//page/text()"/> <property name="modifiedAfter" expression="//modifiedAfter/text()"/> <property name="where" expression="//where/text()"/> <property name="acceptType" expression="//acceptType/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.getPayRuns> <payRunId>{$ctx:payRunId}</payRunId> <order>{$ctx:order}</order> <page>{$ctx:page}</page> <modifiedAfter>{$ctx:modifiedAfter}</modifiedAfter> <where>{$ctx:where}</where> </xero.getPayRuns> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>