Payroll Item
Payroll items store values for payroll transaction line items. Payroll items are used with payroll transactions generated by the Payroll feature, but these transactions are managed by NetSuite and are generally not used in integrations. You will most likely be using payroll items with the Paycheck Journal transaction that is designed for use in SOAP web services integrations with external payroll systems. For more information, see Paycheck Journal Feature.
The payroll item record is defined in the lists employees XSD.
Supported Operations
The following operations can be used with payroll item records:
add | addList | delete | deleteList | get | getDeleted | getList | search | update | updateList | upsert | upsertList
You can also use the asynchronous equivalents of SOAP web services list operations. For information about asynchronous operations, see SOAP Web Services Asynchronous Operations. For more information about request processing, see Synchronous Versus Asynchronous Request Processing.
Field Definitions
The SOAP Schema Browser includes definitions for all body fields, sublist fields, search filters, and search joins available to this record. For details, see the SOAP Schema Browser’s payroll item reference page.
For information on using the SOAP Schema Browser, see SOAP Schema Browser.
Usage Notes
Payroll Item Types
The following table lists supported payroll item types and their internal IDs:
Payroll Item Type |
Internal ID |
---|---|
Deduction |
16 |
Earning : Addition |
6 |
Earning : Commission |
7 |
Earning : Salary |
2 |
Earning : Sick |
3 |
Earning : Vacation |
4 |
Earning : Wage |
5 |
Employer : Contribution |
17 |
Employer : Expense |
19 |
Tax |
8 |
The Tax item type can be either an employee tax or a company tax, depending on whether the value of the employeePaid field is True or False.
Some payroll item types have hidden fields:
-
For Earning types, liabilityAccount and vendor fields are hidden.
-
For Deduction type, expenseAccount field is hidden.
-
For Tax type with employeePaid=True, expenseAccount field is hidden.
Code Samples
The following code adds an Earning:Addition type payroll item.
SOAP Request
/*
Request
<soapenv:Body>
<add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record externalId="Pineapple10732612" xsi:type="ns6:PayrollItem" xmlns:ns6="urn:employees_2017_1.lists.webservices.netsuite.com">
<ns6:subsidiary internalId="1" type="subsidiary" xsi:type="ns7:RecordRef" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/>
<ns6:itemType internalId="6" type="payrollItem" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>
<ns6:name xsi:type="xsd:string">Re-Employment Service Fund</ns6:name>
<ns6:expenseAccount internalId="67" type="account" xsi:type="ns9:RecordRef" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com"/>
</record>
</add>
</soapenv:Body>
*/
Java
public void addPayrollItem_EarningAddition() throws Exception
{
// This operation requires a valid session
this.login(true);
PayrollItem pi = new PayrollItem();
RecordRef rrSubsidiary = new RecordRef();
rrSubsidiary.setType(RecordType.subsidiary);
rrSubsidiary.setInternalId("1"); //Parent Company
pi.setSubsidiary(rrSubsidiary);
pi.setName("Re-Employment Service Fund");
RecordRef rrItemType = new RecordRef();
rrItemType.setType(RecordType.payrollItem);
rrItemType.setInternalId("6"); //Earning:Addition
pi.setItemType(rrItemType);
RecordRef rrExpenseAccount = new RecordRef();
rrExpenseAccount.setType(RecordType.account);
rrExpenseAccount.setInternalId("67"); //Expense Account : Dues & Subscriptions
pi.setExpenseAccount(rrExpenseAccount);
_port.add(pi);
}
The following code adds a deduction type payroll item.
SOAP Request
/*
* <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
* <record externalId="Melon10133881" xsi:type="ns6:PayrollItem" xmlns:ns6="urn:employees_2017_1.lists.webservices.netsuite.com">
<ns6:subsidiary internalId="1" type="subsidiary" xsi:type="ns7:RecordRef" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/>
<ns6:itemType internalId="16" type="payrollItem" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>
<ns6:name xsi:type="xsd:string">Meal Charges</ns6:name>
<ns6:liabilityAccount internalId="27" type="account" xsi:type="ns9:RecordRef" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com"/>
</record>
</add>
*
*/
Java
public void addPayrollItem_Deduction() throws Exception
{
// This operation requires a valid session
this.login(true);
PayrollItem pi = new PayrollItem();
RecordRef rrSubsidiary = new RecordRef();
rrSubsidiary.setType(RecordType.subsidiary);
rrSubsidiary.setInternalId("1"); //Parent Company
pi.setSubsidiary(rrSubsidiary);
pi.setName("Meal Charges");
RecordRef rrItemType = new RecordRef();
rrItemType.setType(RecordType.payrollItem);
rrItemType.setInternalId("16"); //Earning:Addition
pi.setItemType(rrItemType);
RecordRef rrLiabilityAccount = new RecordRef();
rrLiabilityAccount.setType(RecordType.account);
rrLiabilityAccount.setInternalId("27"); //Accrued expenses
pi.setLiabilityAccount(rrLiabilityAccount);
_port.add(pi);
}
The following code gets values for an Earning:Salary type payroll item.
SOAP Request
/*
<get xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<baseRef internalId="2" type="payrollItem" xsi:type="ns6:RecordRef" xmlns:ns6="urn:core_2017_1.platform.webservices.netsuite.com"/>
</get>
*/
Java
public void readPayrollItem() throws Exception
{
// This operation requires a valid session
this.login(true);
RecordRef rrPayrollItem = new RecordRef();
rrPayrollItem.setType(RecordType.payrollItem);
rrPayrollItem.setInternalId("2"); // internalId of existing Payroll Item
PayrollItem pi = (PayrollItem)_port.get(rrPayrollItem).getRecord();
}
The following code updates a payroll item.
SOAP Request
/*
* <update xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record internalId="2" xsi:type="ns6:PayrollItem" xmlns:ns6="urn:employees_2017_1.lists.webservices.netsuite.com">
<ns6:name xsi:type="xsd:string">Meal Charges class1</ns6:name>
</record>
</update>
*/
Java
public void updatePayrollItem() throws Exception
{
// This operation requires a valid session
this.login(true);
PayrollItem pi = new PayrollItem();
pi.setInternalId("2");
pi.setName("Meal Charges class1");
WriteResponse wr = _port.update(pi);
if(wr.getStatus().isIsSuccess()){
RecordRef rrPayrollItem = new RecordRef();
rrPayrollItem.setInternalId("2");
rrPayrollItem.setType(RecordType.payrollItem);
PayrollItem piGet = (PayrollItem)_port.get(rrPayrollItem).getRecord();
System.out.println("PayrollItem Name :" + piGet.getName());
}
}
The following code deletes a payroll item.
SOAP Request
/*
* <soapenv:Body>
<delete xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<baseRef internalId="2" type="payrollItem" xsi:type="ns6:RecordRef" xmlns:ns6="urn:core_2017_1.platform.webservices.netsuite.com"/>
</delete>
</soapenv:Body>
*/
Java
public void deletePayrollItem() throws Exception
{
// This operation requires a valid session
this.login(true);
RecordRef rrPayrollItem = new RecordRef();
rrPayrollItem.setInternalId("2");
rrPayrollItem.setType(RecordType.payrollItem);
_port.delete(rrPayrollItem);
}
The following code gets payroll items deleted on a specific date. In the SOAP request, the date is explicitly set. In the Java code, the date is determined by the getTodaysDate function.
SOAP Request
/*
* <soapenv:Body>
<getDeleted xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<getDeletedFilter>
<ns6:deletedDate operator="on" xmlns:ns6="urn:core_2017_1.platform.webservices.netsuite.com">
<ns6:searchValue>2012-07-24T16:00:00.000Z</ns6:searchValue>
</ns6:deletedDate>
<ns7:type operator="anyOf" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com">
<ns7:searchValue>payrollItem</ns7:searchValue>
</ns7:type>
</getDeletedFilter>
</getDeleted>
</soapenv:Body>
*
*/
Java
public void getDeletedPayrollItem() throws Exception
{
// This operation requires a valid session
this.login(true);
GetDeletedFilter gdf = new GetDeletedFilter();
SearchDateField sdf = new SearchDateField();
sdf.setOperator(SearchDateFieldOperator.on);
sdf.setSearchValue(Util.getTodaysDate());
gdf.setDeletedDate(sdf);
SearchEnumMultiSelectField sems = new SearchEnumMultiSelectField();
sems.setOperator(SearchEnumMultiSelectFieldOperator.anyOf);
sems.setSearchValue(new String[] {"payrollItem"});
gdf.setType(sems);
_port.getDeleted(gdf);
}