Employee Pay Statement Service

Introduction

With UKG Pro Web Services, you can leverage your UKG Pro data for solving business application and integration needs.

This document describes how to use the Employee Pay Statement web service and is intended for individuals who are familiar with software development and web service technologies.

Employee Pay Statement Service API

The UKG Pro Employee Pay Statement Service API enables the user to programmatically retrieve the last employee pay statement information or a range of pay statements.

Overview

This document describes the methods of the service and provides code examples using Microsoft’s Visual Studio 2008 using C# and XML (.NET Framework 3.0 or higher).

The following information describes the service requirements.

Service Specifications
ProtocolSimple Object Access Protocol (SOAP) 1.2
SSL SupportRequired
Signup and Licensing
Account RequiredUKG Pro Service Account or UKG Pro Web User with Web Services Permissions

Using an UKG Pro Service Account is recommended. For information regarding establishing and maintaining an UKG Pro Service Account, please refer to the document Maintaining Service Accounts located in the UKG Pro Technical Content section of the Ultimate Library under UKG Pro Web Services and APIs.

Employee Pay Statement Object

The employee pay statement object includes the following properties and collections. Please note when using certain method, the paging properties must be entered. Please see the Methods sections later in this document.

Base Object

PropertyTypeDescription
AddressLine1StringAddress line 1
AddressLine2StringAddress line 2
CityStringEmployee city
CompanyAddressCityStringCompany address city
CompanyAddressCountryStringCompany address country
CompanyAddressCountyStringCompany county
CompanyAddressLine1StringCompany address line 1
CompanyAddressLine2StringCompany address line 2
CompanyAddressPostalCodeStringCompany postal code
CompanyAddressStateOrProvinceStringCompany state or province
CompanyNameStringCompany name
CompanyPhoneStringCompany phone
CompanyPhoneExtStringCompany phone extension
CountryStringEmployee country
DeductionsCurrentDecimalTotal current deductions
DeductionsYTDDecimalTotal year to date deductions
DocumentStringPay statement document number
EmployeeNumberStringEmployee number
FederalAdditionalAmountWithheldDecimalAdditional amount of federal taxes withheld
FederalAllowancesClaimedIntegerFederal allowances claimed
FederalFilingStatusStringFederal filing status
FederalTaxableWagesCurrentDecimalCurrent federal taxable wages
FederalTaxableWagesYTDDecimalYear to date federal taxable wages
FullNameStringEmployee full name
GrossWagesCurrentDecimalCurrent gross wages
GrossWagesYTDDecimalYear to date gross wages
JobStringEmployee job
LocationStringEmployee location
NetPayCurrentDecimalCurrent net pay
NetPayYTDDecimalYear to date net pay
OrgLevel1StringOrganizational 1
OrgLevel2StringOrganizational 2
OrgLevel3StringOrganizational 3
OrgLevel4StringOrganizational 4
PayDateDatePay statement pay date
PayFrequencyStringPay frequency code
PayGroupStringPay group
PayIdentifierStringUnique check identifier
PayRateDecimalEmployee’s rate of pay
PeriodEndDateDatePay period end date
PeriodStartDateDatePay period start date
PostalCodeStringPostal code
ResidentStateAllowancesClaimedIntegerResident State allowances
ResidentStateFilingStatusStringResident state filing status
SSNStringSocial Security Number
StateOrProvinceStringState or Province
TaxesCurrentDecimalCurrent total taxes
TaxesYTDDecimalYear to date total taxes
WorkStateAllowancesClaimedIntegerWork state allowances
WorkStateFilingStatusStringWork state filing status

Accruals Collection

PropertyTypeDescription
AmountCurrentDecimalCurrent accrual amount
AmountTypeString

Type of accrual

H=Hours

D=Dollars

BalanceDecimalAccrual balance
PlanCodeStringAccrual plan code
PlanDescriptionStringAccrual plan description

Deductions Collection

PropertyTypeDescription
BasisAmountDecimalDeduction basis amount. The amount of wages the deduction is based on.
DeductionCodeStringDeduction code
DeductionDescriptionStringDeduction description
EmployeeAmountDecimalCurrent employee deduction amount
EmployeeAmountYtdDecimalYear to date deduction amount
EmployerAmountDecimalCurrent employer deduction amount
EmployerAmountYtdDecimalYear to date employer deduction amount
PreTaxBooleanIs the deduction pre tax

Earnings Collection

PropertyTypeDescription
AmountDecimalCurrent employee earnings
AmountYtdDecimalYtd employee earnings amount
HoursDecimalCurrent hours
HoursYtdDecimalYtd hours
PayCodeStringEarnings pay code
PayDescriptionStringEarning pay description
PayRateDecimalRate of pay
PeriodEndDatePay period end date
PeriodStartDatePay period start date
PieceCountDecimalCurrent piece count
PiecePayRateDecimalPiece pay rate

NetPay Collection

PropertyTypeDescription
AccountNumberStringBank account number
AccountTypeString

Bank account type

C=Checking

S=Savings

AmountDecimalDistribution amount to the bank account

Taxes Collection

PropertyTypeDescription
AmountDecimalCurrent tax amount
AmountYtdDecimalYtd tax amount
BasisAmountDecimalTax basis amount. The amount of wages the tax is based on.
TaxDescriptionStringTax description

Quick Start

This section provides steps for creating a sample application in your development environment to retrieve and update the employee pay statement information.

Prerequisites

In order to use the service, you will need the following items:

  • An UKG Pro Service Account username and password OR an UKG Pro Web User username and password
  • The Customer API key from the UKG Pro Web Service administrative page
  • If you use an UKG Pro Service Account:
    • You will need the User API key from the Service Account administrative page.
    • You must have appropriate permissions granted to the Service Account for the Employee Pay Statement service on the Service Account administrative page.
  • If you use an UKG Pro Web User account:
    • You will need the User API key from the Web Service administrative page.

Methods

This section introduces the API methods for the Employee Pay Statement Web Service.

FindLastPayStatement

This method provides a way to query the web service based on one or more filter criteria. See the Getting Started with UKG Pro Web Services guide for a list of query properties and operations supported. When calling this method, the last employee pay statement will be returned for the given query criteria. It will return zero or one pay statements in an Employee Pay Statement collection.

Note that the paging properties are required to be set when using this method. You can specify the PageNumber and PageSize. The page number indicates which page you want to return and the PageSize refers to the number of paystatements to return per PageNumber. You can return a maximum of 100 pay statements per PageNumber.

GetLastPayStatementByEmployeeIdentifier

This method allows you to retrieve an individual pay statement by providing an employee identifier. This is helpful if you are designing an application that is aware of the employees to retrieve.

Syntax
Binding.GetLastPayStatementByEmployeeIdentifier(employeeIdentifier)

GetEmployeePayStatementByRange

This method returns zero or more pay statements for a specific employee identified by the passed-in employee identifier. The pay statement returned is based on the start date and the end date passed in.

For large data sets, paging is implemented for this method. Set the page number you want to land on and the number per page. The maximum per page is 1000.

GetPayStatementSummaryByRange

This method returns zero or more pay statement summaries for a given start date and end date. The pay summary information gives you a quick view of the total earnings, deductions and taxes. You may also pass in a PayGroup or CompanyIdentifer to further filter the list of pay summaries returned.

Pay summary information includes the following properties.

PropertyDescription
EmployeeIdentiferIdentifier that represents the employee
PayIdentifierIdentifier that represents a pay statement. This can be used to call the GetPayStatementByPayIdentifier to get the pay statement details.
PayDatePay statement pay date
DocumentPay statement document number
TotalEarningsSum total of earnings for the pay statement
TotalDeductionsSum total of deductions for the pay statement
TotalTaxesSum total of taxes for the pay statement

For large data sets, paging is implemented for this method. Set the page number you want to land on and the number per page. The maximum per page is 1000.

GetPayStatementByPayIdentifier

This function returns zero or one pay statements based on the given pay identifier. The pay identifier is a string value that represents a unique pay statement.

C# Example

Generate the Service Reference

Once you have a user and API keys, you need to create a service reference to the Login Service and the Pay Statement Service. In your development environment, add the service references.

In Visual Studio, select the Add Service Reference menu item from the Project menu. Once you enter the service information you should have the references display in the solution explorer.

Created service reference

Created service reference

Example Code

The following code is an example of retrieving employee pay statement information from your UKG Pro data in a console application. You can copy the entire contents to a C# console application and update the following values and have an operable application.
See the methods section for further explanation.

UserName = "YOUR SERVICE ACCOUNT OR WEB USER NAME ",
Password = "YOUR PASSWORD",
UserAPIkey = "YOUR USER API KEY",
CustomerAPIkey = "YOUR CUSTOMER API KEY"


//Example Quick Start Code Begin
namespace EmployeePayStatementSample
{
    using System;
    using System.ServiceModel;
    using System.ServiceModel.Channels;


    using ConsoleSample.EmployeePayStatementService;
    using ConsoleSample.LoginService;


    class Program
    {
        private const string CustomerApIkey = "";
        private const string UserApIkey = "";
        private const string Username = "";
        private const string Password = "";


        private const string ultiproTokenNamespace =
            "http://www.ultimatesoftware.com/foundation/authentication/ultiproToken";


        private const string ClientAccessKeyNamespace =
            "http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey";


        private static CompanyIdentifier companyIdentifier;
        private static EmployeeIdentifier employeeIdentifier;
        private static string payIdentifier;
        private static string payGroup;


        static void Main(string[] args)
        {
            string token;


            var loginClient = new LoginServiceClient();


            try
            {
                string message;
                loginClient.Authenticate(
                    CustomerApIkey,
                    Password,
                    UserApIkey,
                    Username,
                    out message,
                    out token);


                if (message != null)
                {
                    Console.WriteLine("Could not authenticate: " + message);
                    Console.WriteLine("Token: " + token);
                    Console.ReadLine();
                    return;
                }


                loginClient.Close();
            }
            catch (Exception ex)
            {
                loginClient.Abort();
                Console.WriteLine("Exception:" + ex);
                throw;
            }


            var client = new EmployeePayStatementClient();


            try
            {
                // The following is required to attach the necessary headers used for authentication of the service. 
                using (new OperationContextScope(client.InnerChannel))
                {
                    OperationContext.Current.OutgoingMessageHeaders.Add(
                        MessageHeader.CreateHeader("ultiproToken", ultiproTokenNamespace, token));


                    OperationContext.Current.OutgoingMessageHeaders.Add(
                        MessageHeader.CreateHeader("ClientAccessKey", ClientAccessKeyNamespace, CustomerApIkey));


                    FindLastPayStatement(client);
                    GetEmployeePayStatementByRange(client);
                    GetLastPayStatementByEmployeeIdentifier(client);
                    GetPayStatementByPayIdentifier(client);
                    GetPayStatementSummaryByRange(client);
                }


                client.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception: " + ex);
                client.Abort();
            }


            Console.ReadLine();
        }


       private static void FindLastPayStatement(EmployeePayStatementClient client)
        {
            Console.WriteLine("Calling FindLastPayStatement...");


            var query = new EmployeeQuery
            {
                CompanyCode = String.Empty,
                CompanyName = String.Empty,
                Country = String.Empty,
                EmployeeNumber = String.Empty,
                FirstName = String.Empty,
                FormerName = String.Empty,
                FullOrPartTime = String.Empty,
                Job = String.Empty,
                LastHire = String.Empty,
                LastName = String.Empty,
                Location = String.Empty,
                OrganizationLevel1 = String.Empty,
                OrganizationLevel2 = String.Empty,
                OrganizationLevel3 = String.Empty,
                OrganizationLevel4 = String.Empty,
                OriginalHire = String.Empty,
                PageNumber = "1",
                PageSize = "1",
                PayGroup = String.Empty,
                Status = String.Empty,
                SupervisorLastName = String.Empty,
                TerminationDate = String.Empty,
                TimeClockId = String.Empty,
            };


            PayStatementFindResponse response = client.FindLastPayStatement(query);


            // The results of the operation, includes details such as success, failure,
            // warnings, and paging information
            if (!response.OperationResult.Success)
            {
                foreach (var message in response.OperationResult.Messages)
                {
                    Console.WriteLine(message.Code + Environment.NewLine +
                        "\t" + message.Message + Environment.NewLine +
                        "\t" + message.PropertyName + Environment.NewLine +
                        "\t" + message.Severity + Environment.NewLine +
                        "\t" + message.LogEntryId);
                }


                return;
            }


            var pagingInfo = response.OperationResult.PagingInfo;


            Console.WriteLine("Paging Info:");


            Console.WriteLine("The employee query returned a total of " + pagingInfo.TotalItems + " records.");
            Console.WriteLine("The employee query returned a total of " + pagingInfo.PageTotal + " pages.");
            Console.WriteLine("Each page contains " + pagingInfo.PageSize + " records.");
            Console.WriteLine("The Results contain the records for page " + pagingInfo.CurrentPage + ".");


            // An array of summary information. Ties employees to their pay statements
            // One pay statement per employee matching the query
            EmployeePayStatement[] payStatementInfos = response.Results;


            foreach (var payStatementInfo in payStatementInfos)
            {
                Console.WriteLine("Pay Statement Info:");


                Console.WriteLine("CompanyCode : " + payStatementInfo.CompanyCode);
                Console.WriteLine("EmployeeNumber : " + payStatementInfo.EmployeeNumber);
                Console.WriteLine("FirstName : " + payStatementInfo.FirstName);
                Console.WriteLine("LastName : " + payStatementInfo.LastName);


                companyIdentifier = new CompanyCodeIdentifier { CompanyCode = payStatementInfo.CompanyCode };


                // Detailed pay statements
                foreach (var payStatement in payStatementInfo.PayStatements)
                {
                    Console.WriteLine("\tAddressLine1 : " + payStatement.AddressLine1);
                    Console.WriteLine("\tAddressLine2 : " + payStatement.AddressLine2);
                    Console.WriteLine("\tCity : " + payStatement.City);
                    Console.WriteLine("\tCompanyAddressCity : " + payStatement.CompanyAddressCity);
                    Console.WriteLine("\tCompanyAddressCountry : " + payStatement.CompanyAddressCountry);
                    Console.WriteLine("\tCompanyAddressCounty : " + payStatement.CompanyAddressCounty);
                    Console.WriteLine("\tCompanyAddressLine1 : " + payStatement.CompanyAddressLine1);
                    Console.WriteLine("\tCompanyAddressLine2 : " + payStatement.CompanyAddressLine2);
                    Console.WriteLine("\tCompanyAddressPostalCode : " + payStatement.CompanyAddressPostalCode);
                    Console.WriteLine("\tCompanyAddressStateOrProvince : " + payStatement.CompanyAddressStateOrProvince);
                    Console.WriteLine("\tCompanyName : " + payStatement.CompanyName);
                    Console.WriteLine("\tCompanyPhone : " + payStatement.CompanyPhone);
                    Console.WriteLine("\tCompanyPhoneExt : " + payStatement.CompanyPhoneExt);
                    Console.WriteLine("\tCountry : " + payStatement.Country);
                    Console.WriteLine("\tDeductionsCurrent : " + payStatement.DeductionsCurrent);
                    Console.WriteLine("\tDeductionsYTD : " + payStatement.DeductionsYTD);
                    Console.WriteLine("\tDocument : " + payStatement.Document);
                    Console.WriteLine("\tEmployeeNumber : " + payStatement.EmployeeNumber);
                    Console.WriteLine("\tFederalAdditionalAmountWithheld : " + payStatement.FederalAdditionalAmountWithheld);
                    Console.WriteLine("\tFederalAllowancesClaimed : " + payStatement.FederalAllowancesClaimed);
                    Console.WriteLine("\tFederalFilingStatus : " + payStatement.FederalFilingStatus);
                    Console.WriteLine("\tFederalTaxableWagesCurrent : " + payStatement.FederalTaxableWagesCurrent);
                    Console.WriteLine("\tFederalTaxableWagesYTD : " + payStatement.FederalTaxableWagesYTD);
                    Console.WriteLine("\tFullName : " + payStatement.FullName);
                    Console.WriteLine("\tGrossWagesCurrent : " + payStatement.GrossWagesCurrent);
                    Console.WriteLine("\tGrossWagesYTD : " + payStatement.GrossWagesYTD);
                    Console.WriteLine("\tJob : " + payStatement.Job);
                    Console.WriteLine("\tLocation : " + payStatement.Location);
                    Console.WriteLine("\tNetPayCurrent : " + payStatement.NetPayCurrent);
                    Console.WriteLine("\tNetPayYTD : " + payStatement.NetPayYTD);
                    Console.WriteLine("\tOrgLevel1 : " + payStatement.OrgLevel1);
                    Console.WriteLine("\tOrgLevel2 : " + payStatement.OrgLevel2);
                    Console.WriteLine("\tOrgLevel3 : " + payStatement.OrgLevel3);
                    Console.WriteLine("\tOrgLevel4 : " + payStatement.OrgLevel4);
                    Console.WriteLine("\tPayDate : " + payStatement.PayDate);
                    Console.WriteLine("\tPayFrequency : " + payStatement.PayFrequency);
                    Console.WriteLine("\tPayGroup : " + payStatement.PayGroup);
                    Console.WriteLine("\tPayIdentifier : " + payStatement.PayIdentifier);
                    Console.WriteLine("\tPayRate : " + payStatement.PayRate);
                    Console.WriteLine("\tPeriodEndDate : " + payStatement.PeriodEndDate);
                    Console.WriteLine("\tPeriodStartDate : " + payStatement.PeriodStartDate);
                    Console.WriteLine("\tPostalCode : " + payStatement.PostalCode);
                    Console.WriteLine("\tResidentStateAllowancesClaimed : " + payStatement.ResidentStateAllowancesClaimed);
                    Console.WriteLine("\tResidentStateFilingStatus : " + payStatement.ResidentStateFilingStatus);
                    Console.WriteLine("\tSSN : " + payStatement.SSN);
                    Console.WriteLine("\tStateOrProvince : " + payStatement.StateOrProvince);
                    Console.WriteLine("\tTaxesCurrent : " + payStatement.TaxesCurrent);
                    Console.WriteLine("\tTaxesYTD : " + payStatement.TaxesYTD);
                    Console.WriteLine("\tWorkStateAllowancesClaimed : " + payStatement.WorkStateAllowancesClaimed);
                    Console.WriteLine("\tWorkStateFilingStatus : " + payStatement.WorkStateFilingStatus);


                    // Employee identifier
                    employeeIdentifier = payStatement.EmployeeIdentifier;
                    payGroup = payStatement.PayGroup;


                    Console.WriteLine("\tAccruals:");
                    // Accruals
                    foreach (var accrual in payStatement.Accruals)
                    {
                        Console.WriteLine("\t[ ]");
                        Console.WriteLine("\t\tAmountCurrent : " + accrual.AmountCurrent);
                        Console.WriteLine("\t\tAmountType : " + accrual.AmountType);
                        Console.WriteLine("\t\tBalance : " + accrual.Balance);
                        Console.WriteLine("\t\tPlanCode : " + accrual.PlanCode);
                        Console.WriteLine("\t\tPlanDescription : " + accrual.PlanDescription);
                    }


                    Console.WriteLine("\tDeductions:");
                    // Deductions
                    foreach (var deduction in payStatement.Deductions)
                    {
                        Console.WriteLine("\t[ ]");
                        Console.WriteLine("\t\tBasisAmount : " + deduction.BasisAmount);
                        Console.WriteLine("\t\tDeductionCode : " + deduction.DeductionCode);
                        Console.WriteLine("\t\tDeductionDescription : " + deduction.DeductionDescription);
                        Console.WriteLine("\t\tEmployeeAmount : " + deduction.EmployeeAmount);
                        Console.WriteLine("\t\tEmployeeAmountYtd : " + deduction.EmployeeAmountYtd);
                        Console.WriteLine("\t\tEmployerAmount : " + deduction.EmployerAmount);
                        Console.WriteLine("\t\tEmployerAmountYtd : " + deduction.EmployerAmountYtd);
                        Console.WriteLine("\t\tPreTax : " + deduction.PreTax);
                    }


                    Console.WriteLine("\tEarnings:");
                    // Earnings
                    foreach (var earning in payStatement.Earnings)
                    {
                        Console.WriteLine("\t[ ]");
                        Console.WriteLine("\t\tAmount : " + earning.Amount);
                        Console.WriteLine("\t\tAmountYtd : " + earning.AmountYtd);
                        Console.WriteLine("\t\tHours : " + earning.Hours);
                        Console.WriteLine("\t\tHoursYtd : " + earning.HoursYtd);
                        Console.WriteLine("\t\tPayCode : " + earning.PayCode);
                        Console.WriteLine("\t\tPayDescription : " + earning.PayDescription);
                        Console.WriteLine("\t\tPayRate : " + earning.PayRate);
                        Console.WriteLine("\t\tPeriodEnd : " + earning.PeriodEnd);
                        Console.WriteLine("\t\tPeriodStart : " + earning.PeriodStart);
                        Console.WriteLine("\t\tPieceCount : " + earning.PieceCount);
                        Console.WriteLine("\t\tPiecePayRate : " + earning.PiecePayRate);
                    }


                    Console.WriteLine("\tNetPay: ");
                    // Net Pay
                    foreach (var netPay in payStatement.NetPay)
                    {
                        Console.WriteLine("\t[ ]");
                        Console.WriteLine("\t\t : " + netPay.AccountNumber);
                        Console.WriteLine("\t\t : " + netPay.AccountType);
                        Console.WriteLine("\t\t : " + netPay.Amount);
                    }




                    Console.WriteLine("\tTaxes:");
                    // Taxes
                    foreach (var tax in payStatement.Taxes)
                    {
                        Console.WriteLine("\t[ ]");
                        Console.WriteLine("\t\tAmount : " + tax.Amount);
                        Console.WriteLine("\t\tAmountYtd : " + tax.AmountYtd);
                        Console.WriteLine("\t\tBasisAmount : " + tax.BasisAmount);
                        Console.WriteLine("\t\tTaxCode : " + tax.TaxCode);
                        Console.WriteLine("\t\tTaxDescription : " + tax.TaxDescription);
                    }
                }
            }
        }


        private static void GetEmployeePayStatementByRange(EmployeePayStatementClient client)
        {
            Console.WriteLine("Calling GetEmployeePayStatementByRange...");


            var year2000 = new DateTime(2000, 1, 1);
            var year2010 = new DateTime(2010, 1, 1);


            const int PageNumber = 1;
            const int PageSize = 1;


            PayStatementGetResponse response = client.GetEmployeePayStatementByRange(employeeIdentifier, year2000, year2010, PageNumber, PageSize);


            if (!response.OperationResult.Success)
            {
                foreach (var message in response.OperationResult.Messages)
                {
                    Console.WriteLine(message.Code + Environment.NewLine +
                        "\t" + message.Message + Environment.NewLine +
                        "\t" + message.PropertyName + Environment.NewLine +
                        "\t" + message.Severity + Environment.NewLine +
                        "\t" + message.LogEntryId);
                }


                return;
            }


            foreach (var payStatement in response.Results)
            {
                // See FindLastPayStatement method for all fields


                Console.WriteLine("\tPayIdenfitier : " + payStatement.PayIdentifier);
            }
        }


        private static void GetLastPayStatementByEmployeeIdentifier(EmployeePayStatementClient client)
        {
            Console.WriteLine("Calling GetLastPayStatementByEmployeeIdentifier...");


            PayStatementGetResponse response = client.GetLastPayStatementByEmployeeIdentifier(employeeIdentifier);


            if (!response.OperationResult.Success)
            {
                foreach (var message in response.OperationResult.Messages)
                {
                    Console.WriteLine(message.Code + Environment.NewLine +
                        "\t" + message.Message + Environment.NewLine +
                        "\t" + message.PropertyName + Environment.NewLine +
                        "\t" + message.Severity + Environment.NewLine +
                        "\t" + message.LogEntryId);
                }


                return;
            }


            // Should only be a single payStatement within this array
            // Unless the user has no pay statements, then it will be empty
            PayStatement[] payStatements = response.Results;


            if (payStatements.Length > 0)
            {
                // See FindLastPayStatement method for all fields
                Console.WriteLine("\tPayIdenfitier : " + payStatements[0].PayIdentifier);


                payIdentifier = payStatements[0].PayIdentifier;
            }
        }


        private static void GetPayStatementByPayIdentifier(EmployeePayStatementClient client)
        {
            Console.WriteLine("Calling GetPayStatementByPayIdentifier...");


            PayStatementGetResponse response = client.GetPayStatementByPayIdentifier(payIdentifier);


            if (!response.OperationResult.Success)
            {
                foreach (var message in response.OperationResult.Messages)
                {
                    Console.WriteLine(message.Code + Environment.NewLine +
                        "\t" + message.Message + Environment.NewLine +
                        "\t" + message.PropertyName + Environment.NewLine +
                        "\t" + message.Severity + Environment.NewLine +
                        "\t" + message.LogEntryId);
                }


                return;
            }


            // Should only be a single payStatement within this array
            // Unless the payIdentifier was not valid
            PayStatement[] payStatements = response.Results;


            if (payStatements.Length > 0)
            {
                // see FindLastPayStatement method for all fields
                Console.WriteLine("\tPayIdenfitier : " + payStatements[0].PayIdentifier);
            }
        }


        private static void GetPayStatementSummaryByRange(EmployeePayStatementClient client)
        {
            Console.WriteLine("Calling GetPayStatementSummaryByRange...");


            var year2000 = new DateTime(2000, 1, 1);
            var year2010 = new DateTime(2010, 1, 1);


            const int PageSize = 1;
            const int PageNumber = 1;


            GetPayStatementSummaryResponse response = client.GetPayStatementSummaryByRange(companyIdentifier, year2000, year2010, payGroup, PageNumber, PageSize);


            if (!response.OperationResult.Success)
            {
                foreach (var message in response.OperationResult.Messages)
                {
                    Console.WriteLine(message.Code + Environment.NewLine +
                        "\t" + message.Message + Environment.NewLine +
                        "\t" + message.PropertyName + Environment.NewLine +
                        "\t" + message.Severity + Environment.NewLine +
                        "\t" + message.LogEntryId);
                }


                return;
            }


            foreach (var payStatementSummary in response.Results)
            {
                Console.WriteLine("[ ]");
                Console.WriteLine("\tDocument : " + payStatementSummary.Document);
                Console.WriteLine("\tPayDate : " + payStatementSummary.PayDate);
                Console.WriteLine("\tPayIdentifier : " + payStatementSummary.PayIdentifier);
                Console.WriteLine("\tTotalDeductions : " + payStatementSummary.TotalDeductions);
                Console.WriteLine("\tTotalEarnings : " + payStatementSummary.TotalEarnings);
                Console.WriteLine("\tTotalTaxes : " + payStatementSummary.TotalTaxes);


                // Also includes an employee identifier
            }


            // In order to get detailed information about the pay statements
            // the most efficient way is to call GetPayStatementByPayIdentifier
        }
    }
}


// Example Quick Start Code End

XML Examples

Authentication Service (http://<address>/services/LoginService)
The Authentication Service is required to get the Token needed for all Core Web Service Calls. Please refer to the UKG Pro Login Service API Guide for further information.

GetPayStatementSummaryByRange

  <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Header>
<a:Action s:mustUnderstand="1">http://www.ultimatesoftware.com/services/employeepaystatement/IEmployeePayStatement/GetPayStatementSummaryByRange</a:Action> 
<ultiproToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiproToken">200edafb-34d1-4114-ace2-562365c8a72d</ultiproToken> 
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey> 
</s:Header>
  <s:Body>
  <GetPayStatementSummaryByRange xmlns="http://www.ultimatesoftware.com/services/employeepaystatement">
  <companyIdentifier xmlns:b="http://www.ultimatesoftware.com/contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:type="b:CompanyCodeIdentifier">
<b:CompanyCode>C0014</b:CompanyCode> 
</companyIdentifier>
<startDate>2013-04-15T00:00:00</startDate> 
<endDate>2013-04-30T00:00:00</endDate> 
<payGroup>BIWEEK</payGroup> 
<pageNumber>1</pageNumber> 
<pageSize>5</pageSize> 
</GetPayStatementSummaryByRange>
</s:Body>
</s:Envelope>

GetLastPayStatementByEmployeeIdentifier

  <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Header>
<a:Action s:mustUnderstand="1">http://www.ultimatesoftware.com/services/employeepaystatement/IEmployeePayStatement/GetLastPayStatementByEmployeeIdentifier</a:Action> 
<ultiproToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiproToken">200edafb-34d1-4114-ace2-562365c8a72d</ultiproToken> 
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey> 
</s:Header>
  <s:Body>
  <GetLastPayStatementByEmployeeIdentifier xmlns="http://www.ultimatesoftware.com/services/employeepaystatement">
  <employeeIdentifier xmlns:b="http://www.ultimatesoftware.com/contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:type="b:EmployeeNumberIdentifier">
<b:CompanyCode>C0014</b:CompanyCode> 
<b:EmployeeNumber>555667788</b:EmployeeNumber> 
</employeeIdentifier>
</GetLastPayStatementByEmployeeIdentifier>
</s:Body>
</s:Envelope>

GetEmployeePayStatementByRange

  <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Header>
<a:Action s:mustUnderstand="1">http://www.ultimatesoftware.com/services/employeepaystatement/IEmployeePayStatement/GetEmployeePayStatementByRange</a:Action> 
<ultiproToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiproToken">200edafb-34d1-4114-ace2-562365c8a72d</ultiproToken> 
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey> 
</s:Header>
  <s:Body>
  <GetEmployeePayStatementByRange xmlns="http://www.ultimatesoftware.com/services/employeepaystatement">
  <identifier xmlns:b="http://www.ultimatesoftware.com/contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:type="b:EmployeeNumberIdentifier">
<b:CompanyCode>C0014</b:CompanyCode> 
<b:EmployeeNumber>555667788</b:EmployeeNumber> 
</identifier>
<startDate>2013-02-15T00:00:00</startDate> 
<endDate>2013-04-30T00:00:00</endDate> 
<pageNumber>1</pageNumber> 
<pageSize>5</pageSize> 
</GetEmployeePayStatementByRange>
</s:Body>
</s:Envelope>

GetPayStatementByPayIdentifier

  <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Header>
<a:Action s:mustUnderstand="1">http://www.ultimatesoftware.com/services/employeepaystatement/IEmployeePayStatement/GetPayStatementByPayIdentifier</a:Action> 
<ultiproToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiproToken">ce40f973-aaa3-44a5-94f7-89d677ed3473</ultiproToken> 
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey> 
</s:Header>
  <s:Body>
  <GetPayStatementByPayIdentifier xmlns="http://www.ultimatesoftware.com/services/employeepaystatement">
<payIdentifier>76ZBPC00S0K0</payIdentifier> 
</GetPayStatementByPayIdentifier>
</s:Body>
</s:Envelope>

FindLastPayStatement

  <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Header>
<a:Action s:mustUnderstand="1">http://www.ultimatesoftware.com/services/employeepaystatement/IEmployeePayStatement/FindLastPayStatement</a:Action> 
<ultiproToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiproToken">ce40f973-aaa3-44a5-94f7-89d677ed3473</ultiproToken> 
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey> 
</s:Header>
  <s:Body>
  <FindLastPayStatement xmlns="http://www.ultimatesoftware.com/services/employeepaystatement">
<EmployeeNumber>= 638945004</EmployeeNumber> 
<LastName xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
<PageNumber>1</PageNumber> 
<PageSize>20</PageSize> 
</FindLastPayStatement>
</s:Body>
</s:Envelope>