Managing the Employee

The employee data object represents a single employee. Employees are stored under the employer object and reference a single Pay Schedule.

The Employee is a revisible object.

See the [Reference Data] for a complete breakdown of all the employee properties.

Supported HTTP methods are:

[GET] an Employee

This example demonstrates how to [GET] an existing employee instance.

Revisible objects support [GET] with an effective date. This allows revisions to be selected by date.
Effective date example: /Employer/ER001/Employee/EE001/2017-04-06

curl -X GET
   https://api.test.payrun.io/Employer/ER001/Employee/EE001
   -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/Employer/ER001/Employee/EE001
   -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"?>
<Employee xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EffectiveDate>2017-04-06</EffectiveDate>
    <Revision>0</Revision>
    <Code>EMP002</Code>
    <Title>Mr</Title>
    <FirstName>Timmy</FirstName>
    <MiddleName>T</MiddleName>
    <Initials>TTT</Initials>
    <LastName>Tester</LastName>
    <NINumber>AB123456A</NINumber>
    <DateOfBirth>1970-01-01</DateOfBirth>
    <DirectorshipAppointmentDate xsi:nil="true" />
    <Gender>Male</Gender>
    <NIcLiability>IsFullyLiable</NIcLiability>
    <Region>England</Region>
    <Territory>UnitedKingdom</Territory>
    <PaySchedule href="/Employer/ER001/PaySchedule/SCH001" />
    <StartDate>2017-04-06</StartDate>
    <StarterDeclaration xsi:nil="true" />
    <LeavingDate xsi:nil="true" />
    <LeaverReason xsi:nil="true" />
    <RuleExclusions>None</RuleExclusions>
    <WorkingWeek>AllWeekDays</WorkingWeek>
    <Address>
        <Address1>House</Address1>
        <Address2>Road</Address2>
        <Address3>Town</Address3>
        <Address4>County</Address4>
        <Postcode>TE1 1ST</Postcode>
        <Country>United Kingdom</Country>
    </Address>
    <HoursPerWeek>37.5</HoursPerWeek>
    <PassportNumber>0123456789</PassportNumber>
    <Seconded>NotSet</Seconded>
    <EEACitizen>true</EEACitizen>
    <EPM6>true</EPM6>
    <PaymentToANonIndividual>false</PaymentToANonIndividual>
    <IrregularEmployment>false</IrregularEmployment>
    <OnStrike>false</OnStrike>
    <PaymentMethod>Cash</PaymentMethod>
    <MaritalStatus>Married</MaritalStatus>
    <BankAccount>
        <AccountName>Mr TT Tester</AccountName>
        <AccountNumber>01234567</AccountNumber>
        <SortCode>01-23-45</SortCode>
    </BankAccount>
    <EmployeePartner>
        <FirstName>Tina</FirstName>
        <MiddleName>T</MiddleName>
        <Initials>TTT</Initials>
        <LastName>Tester</LastName>
        <NINumber>AA000001A</NINumber>
    </EmployeePartner>
    <IsAgencyWorker>false</IsAgencyWorker>
    <Deactivated>false</Deactivated>
</Employee>
{
    "Employee": {
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "EffectiveDate": "2017-04-01",
        "Revision": "1",
        "Code": "EMP001",
        "FirstName": "Terry",
        "LastName": "Tester",
        "DateOfBirth": "1960-01-01",
        "DirectorshipAppointmentDate": {
            "@xsi:nil": "true"
        },
        "Gender": "Male",
        "NIcLiability": "IsFullyLiable",
        "Region": "England",
        "Territory": "UnitedKingdom",
        "PaySchedule": {
            "@title": "SCH001: [My Monthly:Monthly]",
            "@href": "/Employer/ER001/PaySchedule/SCH001",
            "@rel": "PaySchedule"
        },
        "StartDate": "2017-01-01",
        "StarterDeclaration": "A",
        "LeavingDate": {
            "@xsi:nil": "true"
        },
        "LeaverReason": {
            "@xsi:nil": "true"
        },
        "RuleExclusions": "None",
        "WorkingWeek": "AllWeekDays",
        "Address": {
            "Address1": "House",
            "Address2": "Street",
            "Address3": "Town",
            "Address4": "County",
            "Postcode": "TE1 1ST",
            "Country": "United Kingdom"
        },
        "HoursPerWeek": "0.0000",
        "Seconded": "NotSet",
        "EEACitizen": "false",
        "EPM6": "false",
        "PaymentToANonIndividual": "false",
        "IrregularEmployment": "false",
        "OnStrike": "false",
        "PaymentMethod": "NotSet",
        "MaritalStatus": "NotSet",
        "IsAgencyWorker": "false",
        "Deactivated": "false"
    }
}

This example demonstrates how to [GET] links to all employees under a single employer.

Revisible objects support [GET] links with an effective date. This allows links to be selected by date.
Effective date example: /Employer/ER001/Employees/2017-04-06

curl -X GET
   https://api.test.payrun.io/Employer/ER001/Employees
   -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/Employer/ER001/Employees
   -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"?>
<LinkCollection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Links>
        <Link title="Employee: [Terry Tester:EMP001]" href="/Employer/ER001/Employee/EE001" rel="Employee" />
        <Link title="Employee: [Timmy Tester:EMP002]" href="/Employer/ER001/Employee/EE002" rel="Employee" />
    </Links>
</LinkCollection>
{
    "LinkCollection": {
        "Links": {
            "Link": [
                {
                    "@title": "Employee: [Terry Tester:EMP001]",
                    "@href": "/Employer/ER001/Employee/EE001",
                    "@rel": "Employee"
                },
                {
                    "@title": "Employee: [Timmy Tester:EMP002]",
                    "@href": "/Employer/ER001/Employee/EE002",
                    "@rel": "Employee"
                }
            ]
        }
    }
}

[POST] a new Employee

This example demonstrates creating a new employee using a [POST].

When performing a [POST] the API will generate default resource location unique keys.
Default employee unique key pattern is:

  • EE001
  • EE002
  • etc...
curl -X POST
   https://api.test.payrun.io/Employer/ER001/Employees
   -H 'Content-type: application/xml'
   -H 'Accept: application/xml'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '<?xml version="1.0"?>
<Employee xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EffectiveDate>2017-04-06</EffectiveDate>
    <Revision>0</Revision>
    <Code>EMP002</Code>
    <Title>Mr</Title>
    <FirstName>Timmy</FirstName>
    <MiddleName>T</MiddleName>
    <Initials>TTT</Initials>
    <LastName>Tester</LastName>
    <NINumber>AB123456A</NINumber>
    <DateOfBirth>1970-01-01</DateOfBirth>
    <DirectorshipAppointmentDate xsi:nil="true" />
    <Gender>Male</Gender>
    <NIcLiability>IsFullyLiable</NIcLiability>
    <Region>England</Region>
    <Territory>UnitedKingdom</Territory>
    <PaySchedule href="/Employer/ER001/PaySchedule/SCH001" />
    <StartDate>2017-04-06</StartDate>
    <StarterDeclaration xsi:nil="true" />
    <LeavingDate xsi:nil="true" />
    <LeaverReason xsi:nil="true" />
    <RuleExclusions>None</RuleExclusions>
    <WorkingWeek>AllWeekDays</WorkingWeek>
    <Address>
        <Address1>House</Address1>
        <Address2>Road</Address2>
        <Address3>Town</Address3>
        <Address4>County</Address4>
        <Postcode>TE1 1ST</Postcode>
        <Country>United Kingdom</Country>
    </Address>
    <HoursPerWeek>37.5</HoursPerWeek>
    <PassportNumber>0123456789</PassportNumber>
    <Seconded>NotSet</Seconded>
    <EEACitizen>true</EEACitizen>
    <EPM6>true</EPM6>
    <PaymentToANonIndividual>false</PaymentToANonIndividual>
    <IrregularEmployment>false</IrregularEmployment>
    <OnStrike>false</OnStrike>
    <PaymentMethod>Cash</PaymentMethod>
    <MaritalStatus>Married</MaritalStatus>
    <BankAccount>
        <AccountName>Mr TT Tester</AccountName>
        <AccountNumber>01234567</AccountNumber>
        <SortCode>01-23-45</SortCode>
    </BankAccount>
    <EmployeePartner>
        <FirstName>Tina</FirstName>
        <MiddleName>T</MiddleName>
        <Initials>TTT</Initials>
        <LastName>Tester</LastName>
        <NINumber>AA000001A</NINumber>
    </EmployeePartner>
    <IsAgencyWorker>false</IsAgencyWorker>
    <Deactivated>false</Deactivated>
</Employee>'
curl -X POST
   https://api.test.payrun.io/Employer/ER001/Employees
   -H 'Content-type: application/json'
   -H 'Accept: application/json'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '{
    "Employee": {
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "EffectiveDate": "2017-04-01",
        "Revision": "1",
        "Code": "EMP001",
        "FirstName": "Terry",
        "LastName": "Tester",
        "DateOfBirth": "1960-01-01",
        "DirectorshipAppointmentDate": {
            "@xsi:nil": "true"
        },
        "Gender": "Male",
        "NIcLiability": "IsFullyLiable",
        "Region": "England",
        "Territory": "UnitedKingdom",
        "PaySchedule": {
            "@title": "SCH001: [My Monthly:Monthly]",
            "@href": "/Employer/ER001/PaySchedule/SCH001",
            "@rel": "PaySchedule"
        },
        "StartDate": "2017-01-01",
        "StarterDeclaration": "A",
        "LeavingDate": {
            "@xsi:nil": "true"
        },
        "LeaverReason": {
            "@xsi:nil": "true"
        },
        "RuleExclusions": "None",
        "WorkingWeek": "AllWeekDays",
        "Address": {
            "Address1": "House",
            "Address2": "Street",
            "Address3": "Town",
            "Address4": "County",
            "Postcode": "TE1 1ST",
            "Country": "United Kingdom"
        },
        "HoursPerWeek": "0.0000",
        "Seconded": "NotSet",
        "EEACitizen": "false",
        "EPM6": "false",
        "PaymentToANonIndividual": "false",
        "IrregularEmployment": "false",
        "OnStrike": "false",
        "PaymentMethod": "NotSet",
        "MaritalStatus": "NotSet",
        "IsAgencyWorker": "false",
        "Deactivated": "false"
    }
}'

Response Example

The [POST] response is a link to the newly generated resource.

<?xml version="1.0"?>
<Link 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    title="EE001" 
    href="/Employer/ER001/Employee/EE001" 
    rel="Employee" 
/>
{
  "Link": {
    "@title": "EE001",
    "@href": "/Employer/ER001/Employee/EE001",
    "@rel": "Employee"
  }
}

[PUT] an Employee

This example demonstrates creating a new employee using [PUT]. You can use [PUT] to create new and updated existing objects.

When performing a [PUT] you specify the resource location unique key. This allows you to use your own resource managment naming conventions.
Example:

  • /Employer/ER001/Employee/MyEmployeeKey
  • /Employer/ER001/Employee/AnotherEmployeeKey
curl -X PUT
   https://api.test.payrun.io/Employer/ER001/Employee/EE001
   -H 'Content-type: application/xml'
   -H 'Accept: application/xml'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '<?xml version="1.0"?>
<Employee xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EffectiveDate>2017-04-06</EffectiveDate>
    <Revision>0</Revision>
    <Code>EMP002</Code>
    <Title>Mr</Title>
    <FirstName>Timmy</FirstName>
    <MiddleName>T</MiddleName>
    <Initials>TTT</Initials>
    <LastName>Tester</LastName>
    <NINumber>AB123456A</NINumber>
    <DateOfBirth>1970-01-01</DateOfBirth>
    <DirectorshipAppointmentDate xsi:nil="true" />
    <Gender>Male</Gender>
    <NIcLiability>IsFullyLiable</NIcLiability>
    <Region>England</Region>
    <Territory>UnitedKingdom</Territory>
    <PaySchedule href="/Employer/ER001/PaySchedule/SCH001" />
    <StartDate>2017-04-06</StartDate>
    <StarterDeclaration xsi:nil="true" />
    <LeavingDate xsi:nil="true" />
    <LeaverReason xsi:nil="true" />
    <RuleExclusions>None</RuleExclusions>
    <WorkingWeek>AllWeekDays</WorkingWeek>
    <Address>
        <Address1>House</Address1>
        <Address2>Road</Address2>
        <Address3>Town</Address3>
        <Address4>County</Address4>
        <Postcode>TE1 1ST</Postcode>
        <Country>United Kingdom</Country>
    </Address>
    <HoursPerWeek>37.5</HoursPerWeek>
    <PassportNumber>0123456789</PassportNumber>
    <Seconded>NotSet</Seconded>
    <EEACitizen>true</EEACitizen>
    <EPM6>true</EPM6>
    <PaymentToANonIndividual>false</PaymentToANonIndividual>
    <IrregularEmployment>false</IrregularEmployment>
    <OnStrike>false</OnStrike>
    <PaymentMethod>Cash</PaymentMethod>
    <MaritalStatus>Married</MaritalStatus>
    <BankAccount>
        <AccountName>Mr TT Tester</AccountName>
        <AccountNumber>01234567</AccountNumber>
        <SortCode>01-23-45</SortCode>
    </BankAccount>
    <EmployeePartner>
        <FirstName>Tina</FirstName>
        <MiddleName>T</MiddleName>
        <Initials>TTT</Initials>
        <LastName>Tester</LastName>
        <NINumber>AA000001A</NINumber>
    </EmployeePartner>
    <IsAgencyWorker>false</IsAgencyWorker>
    <Deactivated>false</Deactivated>
</Employee>'
curl -X PUT
   https://api.test.payrun.io/Employer/ER001/Employee/EE001
   -H 'Content-type: application/json'
   -H 'Accept: application/json'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '{
    "Employee": {
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "EffectiveDate": "2017-04-01",
        "Revision": "1",
        "Code": "EMP001",
        "FirstName": "Terry",
        "LastName": "Tester",
        "DateOfBirth": "1960-01-01",
        "DirectorshipAppointmentDate": {
            "@xsi:nil": "true"
        },
        "Gender": "Male",
        "NIcLiability": "IsFullyLiable",
        "Region": "England",
        "Territory": "UnitedKingdom",
        "PaySchedule": {
            "@title": "SCH001: [My Monthly:Monthly]",
            "@href": "/Employer/ER001/PaySchedule/SCH001",
            "@rel": "PaySchedule"
        },
        "StartDate": "2017-01-01",
        "StarterDeclaration": "A",
        "LeavingDate": {
            "@xsi:nil": "true"
        },
        "LeaverReason": {
            "@xsi:nil": "true"
        },
        "RuleExclusions": "None",
        "WorkingWeek": "AllWeekDays",
        "Address": {
            "Address1": "House",
            "Address2": "Street",
            "Address3": "Town",
            "Address4": "County",
            "Postcode": "TE1 1ST",
            "Country": "United Kingdom"
        },
        "HoursPerWeek": "0.0000",
        "Seconded": "NotSet",
        "EEACitizen": "false",
        "EPM6": "false",
        "PaymentToANonIndividual": "false",
        "IrregularEmployment": "false",
        "OnStrike": "false",
        "PaymentMethod": "NotSet",
        "MaritalStatus": "NotSet",
        "IsAgencyWorker": "false",
        "Deactivated": "false"
    }
}'

Response Example

The [PUT] response is the entire updated resource.

<?xml version="1.0"?>
<Employee xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EffectiveDate>2017-04-06</EffectiveDate>
    <Revision>0</Revision>
    <Code>EMP002</Code>
    <Title>Mr</Title>
    <FirstName>Timmy</FirstName>
    <MiddleName>T</MiddleName>
    <Initials>TTT</Initials>
    <LastName>Tester</LastName>
    <NINumber>AB123456A</NINumber>
    <DateOfBirth>1970-01-01</DateOfBirth>
    <DirectorshipAppointmentDate xsi:nil="true" />
    <Gender>Male</Gender>
    <NIcLiability>IsFullyLiable</NIcLiability>
    <Region>England</Region>
    <Territory>UnitedKingdom</Territory>
    <PaySchedule href="/Employer/ER001/PaySchedule/SCH001" />
    <StartDate>2017-04-06</StartDate>
    <StarterDeclaration xsi:nil="true" />
    <LeavingDate xsi:nil="true" />
    <LeaverReason xsi:nil="true" />
    <RuleExclusions>None</RuleExclusions>
    <WorkingWeek>AllWeekDays</WorkingWeek>
    <Address>
        <Address1>House</Address1>
        <Address2>Road</Address2>
        <Address3>Town</Address3>
        <Address4>County</Address4>
        <Postcode>TE1 1ST</Postcode>
        <Country>United Kingdom</Country>
    </Address>
    <HoursPerWeek>37.5</HoursPerWeek>
    <PassportNumber>0123456789</PassportNumber>
    <Seconded>NotSet</Seconded>
    <EEACitizen>true</EEACitizen>
    <EPM6>true</EPM6>
    <PaymentToANonIndividual>false</PaymentToANonIndividual>
    <IrregularEmployment>false</IrregularEmployment>
    <OnStrike>false</OnStrike>
    <PaymentMethod>Cash</PaymentMethod>
    <MaritalStatus>Married</MaritalStatus>
    <BankAccount>
        <AccountName>Mr TT Tester</AccountName>
        <AccountNumber>01234567</AccountNumber>
        <SortCode>01-23-45</SortCode>
    </BankAccount>
    <EmployeePartner>
        <FirstName>Tina</FirstName>
        <MiddleName>T</MiddleName>
        <Initials>TTT</Initials>
        <LastName>Tester</LastName>
        <NINumber>AA000001A</NINumber>
    </EmployeePartner>
    <IsAgencyWorker>false</IsAgencyWorker>
    <Deactivated>false</Deactivated>
</Employee>
{
    "Employee": {
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "EffectiveDate": "2017-04-01",
        "Revision": "1",
        "Code": "EMP001",
        "FirstName": "Terry",
        "LastName": "Tester",
        "DateOfBirth": "1960-01-01",
        "DirectorshipAppointmentDate": {
            "@xsi:nil": "true"
        },
        "Gender": "Male",
        "NIcLiability": "IsFullyLiable",
        "Region": "England",
        "Territory": "UnitedKingdom",
        "PaySchedule": {
            "@title": "SCH001: [My Monthly:Monthly]",
            "@href": "/Employer/ER001/PaySchedule/SCH001",
            "@rel": "PaySchedule"
        },
        "StartDate": "2017-01-01",
        "StarterDeclaration": "A",
        "LeavingDate": {
            "@xsi:nil": "true"
        },
        "LeaverReason": {
            "@xsi:nil": "true"
        },
        "RuleExclusions": "None",
        "WorkingWeek": "AllWeekDays",
        "Address": {
            "Address1": "House",
            "Address2": "Street",
            "Address3": "Town",
            "Address4": "County",
            "Postcode": "TE1 1ST",
            "Country": "United Kingdom"
        },
        "HoursPerWeek": "0.0000",
        "Seconded": "NotSet",
        "EEACitizen": "false",
        "EPM6": "false",
        "PaymentToANonIndividual": "false",
        "IrregularEmployment": "false",
        "OnStrike": "false",
        "PaymentMethod": "NotSet",
        "MaritalStatus": "NotSet",
        "IsAgencyWorker": "false",
        "Deactivated": "false"
    }
}

[PATCH] an Employee

This example demonstrates updating an existing employee using [PATCH].

[PATCH] allows updates by supplying only the changes.
Creates and returns a new object revision including the specified changes.
When [PATCH]ing revisible objects, you must supply a valid EffectiveDate.

curl -X PATCH
   https://api.test.payrun.io/Employer/ER001/Employee/ER002
   -H 'Content-type: application/xml'
   -H 'Accept: application/xml'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '<?xml version="1.0"?>
<Employee xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EffectiveDate>2017-04-06</EffectiveDate>
    <DateOfBirth>1971-01-01</DateOfBirth>
    <Address>
        <Address1>House 2</Address1>
        <Address2>Street 2</Address2>
        <Address3>Town 2</Address3>
        <Address4>County 2</Address4>
        <Postcode>TE2 2ST</Postcode>
        <Country>United Kingdom</Country>
    </Address>
</Employee>'
curl -X PATCH
   https://api.test.payrun.io/Employer/ER002
   -H 'Content-type: application/json'
   -H 'Accept: application/json'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '{
  "Employee": {
    "EffectiveDate": "2017-04-06",
    "DateOfBirth": "1971-01-01",
    "Address": {
      "Address1": "House 2",
      "Address2": "Street 2",
      "Address3": "Town 2",
      "Address4": "County 2",
      "Postcode": "TE2 2ST",
      "Country": "United Kingdom 2"
    }
  }
}'

Response Example

The [PATCH] response is the entire updated resource.

<?xml version="1.0"?>
<Employee xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EffectiveDate>2017-04-06</EffectiveDate>
    <Revision>3</Revision>
    <Code>EMP002</Code>
    <Title>Mr</Title>
    <FirstName>Timmy</FirstName>
    <MiddleName>T</MiddleName>
    <Initials>TTT</Initials>
    <LastName>Tester</LastName>
    <NINumber>AB123456A</NINumber>
    <DateOfBirth>1971-01-01</DateOfBirth>
    <DirectorshipAppointmentDate xsi:nil="true" />
    <Gender>Male</Gender>
    <NIcLiability>IsFullyLiable</NIcLiability>
    <Region>England</Region>
    <Territory>UnitedKingdom</Territory>
    <PaySchedule title="SCH001: [My Monthly:Monthly]" href="/Employer/ER001/PaySchedule/SCH001" rel="PaySchedule" />
    <StartDate>2017-04-06</StartDate>
    <StarterDeclaration xsi:nil="true" />
    <LeavingDate xsi:nil="true" />
    <LeaverReason xsi:nil="true" />
    <RuleExclusions>None</RuleExclusions>
    <WorkingWeek>AllWeekDays</WorkingWeek>
    <Address>
        <Address1>House 2</Address1>
        <Address2>Street 2</Address2>
        <Address3>Town 2</Address3>
        <Address4>County 2</Address4>
        <Postcode>TE2 2ST</Postcode>
        <Country>United Kingdom</Country>
    </Address>
    <HoursPerWeek>37.5000</HoursPerWeek>
    <PassportNumber>0123456789</PassportNumber>
    <Seconded>NotSet</Seconded>
    <EEACitizen>true</EEACitizen>
    <EPM6>true</EPM6>
    <PaymentToANonIndividual>false</PaymentToANonIndividual>
    <IrregularEmployment>false</IrregularEmployment>
    <OnStrike>false</OnStrike>
    <PaymentMethod>Cash</PaymentMethod>
    <MaritalStatus>Married</MaritalStatus>
    <BankAccount>
        <AccountName>Mr TT Tester</AccountName>
        <AccountNumber>01234567</AccountNumber>
        <SortCode>01-23-45</SortCode>
    </BankAccount>
    <EmployeePartner>
        <FirstName>Tina</FirstName>
        <MiddleName>T</MiddleName>
        <Initials>TTT</Initials>
        <LastName>Tester</LastName>
        <NINumber>AA000001A</NINumber>
    </EmployeePartner>
    <IsAgencyWorker>false</IsAgencyWorker>
    <Deactivated>false</Deactivated>
</Employee>
{
    "Employee": {
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "EffectiveDate": "2017-04-06",
        "Revision": "3",
        "Code": "EMP002",
        "Title": "Mr",
        "FirstName": "Timmy",
        "MiddleName": "T",
        "Initials": "TTT",
        "LastName": "Tester",
        "NINumber": "AB123456A",
        "DateOfBirth": "1971-01-01",
        "DirectorshipAppointmentDate": {
            "@xsi:nil": "true"
        },
        "Gender": "Male",
        "NIcLiability": "IsFullyLiable",
        "Region": "England",
        "Territory": "UnitedKingdom",
        "PaySchedule": {
            "@title": "SCH001: [My Monthly:Monthly]",
            "@href": "/Employer/ER001/PaySchedule/SCH001",
            "@rel": "PaySchedule"
        },
        "StartDate": "2017-04-06",
        "StarterDeclaration": {
            "@xsi:nil": "true"
        },
        "LeavingDate": {
            "@xsi:nil": "true"
        },
        "LeaverReason": {
            "@xsi:nil": "true"
        },
        "RuleExclusions": "None",
        "WorkingWeek": "AllWeekDays",
        "Address": {
            "Address1": "House 2",
            "Address2": "Street 2",
            "Address3": "Town 2",
            "Address4": "County 2",
            "Postcode": "TE2 2ST",
            "Country": "United Kingdom"
        },
        "HoursPerWeek": "37.5000",
        "PassportNumber": "0123456789",
        "Seconded": "NotSet",
        "EEACitizen": "true",
        "EPM6": "true",
        "PaymentToANonIndividual": "false",
        "IrregularEmployment": "false",
        "OnStrike": "false",
        "PaymentMethod": "Cash",
        "MaritalStatus": "Married",
        "BankAccount": {
            "AccountName": "Mr TT Tester",
            "AccountNumber": "01234567",
            "SortCode": "01-23-45"
        },
        "EmployeePartner": {
            "FirstName": "Tina",
            "MiddleName": "T",
            "Initials": "TTT",
            "LastName": "Tester",
            "NINumber": "AA000001A"
        },
        "IsAgencyWorker": "false",
        "Deactivated": "false"
    }
}

[DELETE] an Employee

This example demonstrates deleting an employee using the [DELETE] verb.

Revisable objects support 2 levels of [DELETE].

  1. Delete a single revision: [DELETE] /Employer/ER001/Empployee/EE001/2017-07-15
  2. Delete the entire object: [DELETE] /Employer/ER001/Empployee/EE001/

Note: You can only delete revisions if there are no dependent calculations.

curl -X DELETE
   https://api.test.payrun.io/Employer/ER001/Empployee/EE001
   -H 'Content-type: application/xml'
   -H 'Accept: application/xml'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
curl -X DELETE
   https://api.test.payrun.io/Employer/ER001/Empployee/EE001
   -H 'Content-type: application/json'
   -H 'Accept: application/json'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'