Reporting

Every application instance (in the PayRun.io API) includes a default suite of reports. These system reports are ReadOnly and cannot be altered.
In addition to the default suite, you are free to copy and create your own report definitions.

What is a report?

Reports are saved queries written using the PayRun.io report query language (RQL).

The report definitions also include the ability to specify arguments that allow filtering of report results.

Report definitions are controlled like any other API resource, using [GET], [POST], [PUT] and [DELETE].

In addition to the normal resource management features, reports can be invoked by calling the "run" url and including an optional set of parameters via url query parameters.

See the API Explorer for more examples of running the system reports and report definition resource management.

Example Report Invocation

This example demonstates the pay slip report invocation including query parameters.

curl -X GET
   https://api.test.payrun.io/report/PAYSLIP/run?EmployerKey=ER001&TaxYear=2016&TaxPeriod=1&EmployeeCodes=EMP001
   -H 'Content-type: application/xml'
   -H 'Accept: application/xml'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
curl -X GET
   https://api.test.payrun.io/report/PAYSLIP/run?EmployerKey=ER001&TaxYear=2016&TaxPeriod=1&EmployeeCodes=EMP001
   -H 'Content-type: application/json'
   -H 'Accept: application/json'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'

Response Example

<?xml version="1.0"?>
<PayslipReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Generated="2017-07-10T07:52:59">
  <PayRun TaxYear="2017" TaxPeriod="1" PaymentDate="2017-04-30" Schedule="My Monthly" Frequency="Monthly">
    <Employee Code="EMP001">
      <Link href="/Employer/ER001/Employee/EE001" />
      <Payments>
        <PayLine type="PayLineBasic">
          <Generated>2017-07-10T07:52:58.3419325</Generated>
          <PayCode>BASIC</PayCode>
          <PayCodeType>Payment</PayCodeType>
          <Value>2083.3400</Value>
          <PaymentDate>2017-04-30</PaymentDate>
          <TaxYear>2017</TaxYear>
          <TaxPeriod>1</TaxPeriod>
          <Rate>2083.3400</Rate>
          <RateUoM>Month</RateUoM>
          <Units>1.0000</Units>
          <ProRataMethodApplied>NotSet</ProRataMethodApplied>
        </PayLine>
      </Payments>
      <Deductions>
        <PayLine type="PayLineNI">
          <Generated>2017-07-10T07:52:59.1169768</Generated>
          <PayCode>NI</PayCode>
          <PayCodeType>Deduction</PayCodeType>
          <Value>-168.4000</Value>
          <PaymentDate>2017-04-30</PaymentDate>
          <TaxYear>2017</TaxYear>
          <TaxPeriod>1</TaxPeriod>
          <LEL>490.0000</LEL>
          <LELtoPT>190.0000</LELtoPT>
          <PTtoST>0.0000</PTtoST>
          <STtoUAP>0.0000</STtoUAP>
          <UAPtoUEL>0.0000</UAPtoUEL>
          <UELtoUST>0.0000</UELtoUST>
          <UELtoAUST>0.0000</UELtoAUST>
          <AboveUST>0.0000</AboveUST>
          <STtoUEL>1403.3400</STtoUEL>
          <AboveAUST>0.0000</AboveAUST>
          <EmployerNI>-193.6600</EmployerNI>
          <DirCalculationMethod>Off</DirCalculationMethod>
          <NILetter>A</NILetter>
          <NIablePay>2083.3400</NIablePay>
          <RebateEE>0.0000</RebateEE>
          <RebateER>0.0000</RebateER>
        </PayLine>
        <PayLine type="PayLineTax">
          <Generated>2017-07-10T07:52:59.1069763</Generated>
          <PayCode>TAX</PayCode>
          <PayCodeType>Deduction</PayCodeType>
          <Value>-224.8000</Value>
          <PaymentDate>2017-04-30</PaymentDate>
          <TaxYear>2017</TaxYear>
          <TaxPeriod>1</TaxPeriod>
          <TaxBasis>Cumulative</TaxBasis>
          <TaxCode>1150L</TaxCode>
          <TaxablePay>2083.3400</TaxablePay>
        </PayLine>
      </Deductions>
      <PeriodTotals>
        <SumTotal Value="-193.6600" Key="Employer NI" />
        <SumTotal Value="2083.3400" Key="NIable Pay" />
        <SumTotal Value="2083.3400" Key="Taxable Pay" />
        <SumTotal Value="2083.3400" Key="Payments" />
        <SumTotal Value="-393.2000" Key="Deductions" />
        <SumTotal Value="1690.1400" Key="Net Pay" />
      </PeriodTotals>
      <YTDTotals>
        <SumTotal Value="-168.4000" Key="Employee NI" />
        <SumTotal Value="-193.6600" Key="Employer NI" />
        <SumTotal Value="-224.8000" Key="Tax" />
        <SumTotal Value="2083.3400" Key="NIable Pay" />
        <SumTotal Value="2083.3400" Key="Taxable Pay" />
        <SumTotal Value="2083.3400" Key="Payments" />
        <SumTotal Value="-393.2000" Key="Deductions" />
        <SumTotal Value="1690.1400" Key="Net Pay" />
      </YTDTotals>
    </Employee>
  </PayRun>
</PayslipReport>
{
  "PayslipReport": {
    "@Generated": "2017-07-11T17:15:29",
    "PayRun": {
      "@TaxYear": "2017",
      "@TaxPeriod": "1",
      "@PaymentDate": "2017-04-30",
      "@Schedule": "My Monthly",
      "@Frequency": "Monthly",
      "Employee": {
        "@Code": "EMP001",
        "Link": {
          "@href": "/Employer/ER001/Employee/EE001"
        },
        "Payments": {
          "PayLine": {
            "@type": "PayLineBasic",
            "Generated": "2017-07-11T17:15:28.054103",
            "PayCode": "BASIC",
            "PayCodeType": "Payment",
            "Value": "2083.3400",
            "PaymentDate": "2017-04-30",
            "TaxYear": "2017",
            "TaxPeriod": "1",
            "Rate": "2083.3400",
            "RateUoM": "Month",
            "Units": "1.0000",
            "ProRataMethodApplied": "NotSet"
          }
        },
        "Deductions": {
          "PayLine": [
            {
              "@type": "PayLineNI",
              "Generated": "2017-07-11T17:15:28.8351476",
              "PayCode": "NI",
              "PayCodeType": "Deduction",
              "Value": "-168.4000",
              "PaymentDate": "2017-04-30",
              "TaxYear": "2017",
              "TaxPeriod": "1",
              "LEL": "490.0000",
              "LELtoPT": "190.0000",
              "PTtoST": "0.0000",
              "STtoUAP": "0.0000",
              "UAPtoUEL": "0.0000",
              "UELtoUST": "0.0000",
              "UELtoAUST": "0.0000",
              "AboveUST": "0.0000",
              "STtoUEL": "1403.3400",
              "AboveAUST": "0.0000",
              "EmployerNI": "-193.6600",
              "DirCalculationMethod": "Off",
              "NILetter": "A",
              "NIablePay": "2083.3400",
              "RebateEE": "0.0000",
              "RebateER": "0.0000"
            },
            {
              "@type": "PayLineTax",
              "Generated": "2017-07-11T17:15:28.824147",
              "PayCode": "TAX",
              "PayCodeType": "Deduction",
              "Value": "-224.8000",
              "PaymentDate": "2017-04-30",
              "TaxYear": "2017",
              "TaxPeriod": "1",
              "TaxBasis": "Cumulative",
              "TaxCode": "1150L",
              "TaxablePay": "2083.3400"
            }
          ]
        },
        "PeriodTotals": {
          "SumTotal": [
            {
              "@Value": "-193.6600",
              "@Key": "Employer NI"
            },
            {
              "@Value": "2083.3400",
              "@Key": "NIable Pay"
            },
            {
              "@Value": "2083.3400",
              "@Key": "Taxable Pay"
            },
            {
              "@Value": "2083.3400",
              "@Key": "Payments"
            },
            {
              "@Value": "-393.2000",
              "@Key": "Deductions"
            },
            {
              "@Value": "1690.1400",
              "@Key": "Net Pay"
            }
          ]
        },
        "YTDTotals": {
          "SumTotal": [
            {
              "@Value": "-168.4000",
              "@Key": "Employee NI"
            },
            {
              "@Value": "-193.6600",
              "@Key": "Employer NI"
            },
            {
              "@Value": "-224.8000",
              "@Key": "Tax"
            },
            {
              "@Value": "2083.3400",
              "@Key": "NIable Pay"
            },
            {
              "@Value": "2083.3400",
              "@Key": "Taxable Pay"
            },
            {
              "@Value": "2083.3400",
              "@Key": "Payments"
            },
            {
              "@Value": "-393.2000",
              "@Key": "Deductions"
            },
            {
              "@Value": "1690.1400",
              "@Key": "Net Pay"
            }
          ]
        }
      }
    }
  }
}

Report Query Language

Reports (and queries) are defined using the PayRun.io Report Query Language. Using a combination of API resource locators, filters and output specifications, complex reports can be produced.

A more detailed explanation of the PayRun.io RQL will be added at a later date.

See the Query reference data for more on the RQL query objects.