Generating a P60

Each April every employer must issue a P60 to each of their employees. It must provided by 31 May, on paper or electronically. The P60 details the amount of tax paid in that employement for the tax year (6th April to 5th April). If an employee has multiple jobs then they can expect a P60 from each of their employers.

Executing the P60 report

The P60 is a system defined report in the PayRun.io API, as with all reports you can request the report in either XML or JSON format.

To execute a report you must invoke the run endpoint and pass any required variables as query string parameters.

Variable Description Required
EmployerKey The target employer's resource unique key. Yes
EmployeeKey The target employee's resource unique key. Yes
TaxYear The desired tax year for the report e.g. 2017 for 2017/18 Yes

This example demonstrates how to [GET] the report P60 output.

curl -X GET
   https://api.test.payrun.io/Report/P60/run?EmployerKey=ER001&EmployeeKey=EE001&TaxYear=2017
   -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/P60/run?EmployerKey=ER001&EmployeeKey=EE001&TaxYear=2017
   -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"?>
<P60Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Generated="2017-12-17T10:51:19">
    <Employer>
        <Link href="/Employer/ER001" />
        <Name>P60 employer</Name>
        <EmployerPayeRef>451/A451</EmployerPayeRef>
        <Address>
            <Address1>Address 1</Address1>
            <Address2>Address 2</Address2>
            <Address3>Address 3</Address3>
            <Address4>Address 4</Address4>
            <Postcode>TE1 1ST</Postcode>
            <Country>United Kingdom</Country>
        </Address>
        <Employees>
            <Employee>
                <Link href="/Employer/ER001/Employee/EE001" />
                <Code>EMP001</Code>
                <FirstName>Shirley</FirstName>
                <MiddleName>Janice</MiddleName>
                <Initials></Initials>
                <LastName>Trotter</LastName>
                <NiNumber>JS123456B</NiNumber>
                <Address>
                    <Address1>Many Waters</Address1>
                    <Address2>Bridford</Address2>
                    <Address3>Exeter</Address3>
                    <Address4>Devon</Address4>
                    <Postcode>EX6 7JE</Postcode>
                    <Country>United Kingdom</Country>
                </Address>
                <TaxSummary>
                    <TaxCode>1150L/1</TaxCode>
                    <ThisEmployment>
                        <TaxablePay>1,500.00</TaxablePay>
                        <TaxPaid>382.35</TaxPaid>
                    </ThisEmployment>
                    <PrevEmployment>
                        <TaxablePay>0.00</TaxablePay>
                        <TaxPaid>0.00</TaxPaid>
                    </PrevEmployment>
                    <Totals>
                        <TaxablePay>1,500.00</TaxablePay>
                        <TaxPaid>382.35</TaxPaid>
                    </Totals>
                </TaxSummary>
                <NationalInsurance>
                    <NiLetterAndValues NiLetter="M">
                        <AtLEL>113.00</AtLEL>
                        <LELtoPT>44.00</LELtoPT>
                        <PTtoUEL>709.00</PTtoUEL>
                        <AbovePT>97.76</AbovePT>
                    </NiLetterAndValues>
                </NationalInsurance>
                <StatutoryPayments>
                    <SMP>300.00</SMP>
                    <SAP>400.00</SAP>
                    <SPP>200.00</SPP>
                    <SHPP>500.00</SHPP>
                </StatutoryPayments>
                <StudentLoan>
                    <TotalDeduction>0.00</TotalDeduction>
                </StudentLoan>
            </Employee>
        </Employees>
    </Employer>
</P60Report>
{
    "P60Report": {
        "@Generated": "2017-12-17T10:43:25",
        "Employer": {
            "Link": {
                "@href": "/Employer/ER001"
            },
            "Name": "P60 employer",
            "EmployerPayeRef": "451/A451",
            "Address": {
                "Address1": "Address 1",
                "Address2": "Address 2",
                "Address3": "Address 3",
                "Address4": "Address 4",
                "Postcode": "TE1 1ST",
                "Country": "United Kingdom"
            },
            "Employees": {
                "Employee": {
                    "Link": {
                        "@href": "/Employer/ER001/Employee/EE001"
                    },
                    "Code": "EMP001",
                    "FirstName": "Shirley",
                    "MiddleName": "Janice",
                    "Initials": "",
                    "LastName": "Trotter",
                    "NiNumber": "JS123456B",
                    "Address": {
                        "Address1": "Many Waters",
                        "Address2": "Bridford",
                        "Address3": "Exeter",
                        "Address4": "Devon",
                        "Postcode": "EX6 7JE",
                        "Country": "United Kingdom"
                    },
                    "TaxSummary": {
                        "TaxCode": "1150L/1",
                        "ThisEmployment": {
                            "TaxablePay": "1,500.00",
                            "TaxPaid": "382.35"
                        },
                        "PrevEmployment": {
                            "TaxablePay": "0.00",
                            "TaxPaid": "0.00"
                        },
                        "Totals": {
                            "TaxablePay": "1,500.00",
                            "TaxPaid": "382.35"
                        }
                    },
                    "NationalInsurance": {
                        "NiLetterAndValues": {
                            "@NiLetter": "M",
                            "AtLEL": "113.00",
                            "LELtoPT": "44.00",
                            "PTtoUEL": "709.00",
                            "AbovePT": "97.76"
                        }
                    },
                    "StatutoryPayments": {
                        "SMP": "300.00",
                        "SAP": "400.00",
                        "SPP": "200.00",
                        "SHPP": "500.00"
                    },
                    "StudentLoan": {
                        "TotalDeduction": "0.00"
                    }
                }
            }
        }
    }
}

Exporting the P60 as a PDF

The PayRun.io API supports exporting specific statutory reports into the completed HMRC formatted forms. This uses an API feature known as transforming; a specific system transform has been included for the P60.

Warning
ReportDataUri value must be url encoded, failing to correctly encode the query string parameter will result in the request failing with a 401 - Not Authorised as the OAuth signature will not match the expected.

Variable Description Required
ReportDataUri The relative url to the report run endpoint including the required query string parameters. Yes
TransformDefinitionKey For P60 as a PDF this is P60-2017-Pdf Yes

Note: The TransformDefinitionId is tax year specific this is beacuse a new P60 template is issued each tax year.

This example demonstrates how to [GET] the P60 report as a PDF, using the same P60 report as used above.

curl -X GET
   https://api.test.payrun.io/ReportTransform?ReportDataUri=%2Freport%2FP60%2Frun%3FEmployerKey%3DER001%26EmployeeKey%3DEE001%26TaxYear%3D2017&TransformDefinitionKey=P60-2017-Pdf
   -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/ReportTransform?ReportDataUri=%2Freport%2FP60%2Frun%3FEmployerKey%3DER001%26EmployeeKey%3DEE001%26TaxYear%3D2017&TransformDefinitionKey=P60-2017-Pdf
   -H 'Content-type: application/json'
   -H 'Accept: application/json'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'

The response from a successful transform request will always be a binary stream with a mime-type of application/pdf.