Skip to content
Brian Tully edited this page Nov 29, 2017 · 19 revisions

First you must have a worker object instance

var worker;
Paychex.Workers.get('XXXXXX').then(function(w){
  worker = w;
  return worker;
});

worker.update(update)

Update a worker Returns the updated worker

worker.update({employmentType : 'FULL_TIME'}).then(function(worker){
  console.log(worker);
});

worker.payStandards()

Get workers compensation pay standards Returns worker pay standards

worker.payStandards().then(function(payStandards){
  console.log(payStandards);
});

worker.compensation()

Get information about a workers compensation

worker.compensation().then(function(compensation){
  console.log(compensation);
});

Communications

worker.communications()

Get communications Returns an array of communications for a worker

worker.communications().then(function(communications){
  console.log(communications);
});

worker.communications(communication)

Add a communication Returns a communication

worker.communications().then(function(communications){
  console.log(communications);
});

worker.communication(communicationId)

Get a communication by communicationId Returns a communication

worker.communication('XXXXXX').then(function(communication){
  console.log(communication);
});

worker.communication(communicationId, update)

Update a communication Returns a communication

worker.communication('XXXXXX',{}).then(function(communication){
  console.log(communication);
});

worker.deleteCommunication(communicationId)

Delete a communication by communicationId

worker.deleteCommunication('XXXXXX').then(function(result){
  console.log(result);
});

Pay Rates

worker.payRates()

Get Workers compensation pay rates profile

worker.payRates().then(function(payRates){
  console.log(payRates);
});

worker.payRates(data)

Add a pay rate Returns the single newly added workers compensation rate.

worker.payRates(data).then(function(payRate){
  console.log(payRate);
});

worker.payRate(rateId)

Get a pay rate by rateId Returns a pay rate

worker.payRate('XXXXXX').then(function(payRate){
  console.log(payRate);
});

worker.payRate(rateId, update)

Update a pay rate Returns updated pay rate

worker.payRate('XXXXXX',update).then(function(payRate){
  console.log(payRate);
});

worker.deletePayRate(rateId)

Delete a pay rate by rateId

worker.deletePayRate('XXXXXX').then(function(result){
  console.log(result);
});

Direct Deposits

worker.directDeposits()

Get Workers direct deposits

worker.directDeposits().then(function(directDeposits){
  console.log(directDeposits);
});

worker.directDeposits(data)

Add a direct deposit Returns the single newly added direct deposit.

worker.directDeposits(data).then(function(directDeposit){
  console.log(directDeposit);
});

worker.directDeposit(directDepositId)

Get a direct deposit by directDepositId Returns a direct deposit

worker.directDeposit('XXXXXX').then(function(directDeposit){
  console.log(directDeposit);
});

worker.directDeposit(directDepositId, update)

Update a direct deposit Returns updated direct deposit

worker.directDeposit('XXXXXX',update).then(function(directDeposit){
  console.log(directDeposit);
});

worker.deleteDirectDeposit(directDepositId)

Delete a direct deposit by directDepositId

worker.deleteDirectDeposit('XXXXXX').then(function(result){
  console.log(result);
});

Checks

worker.checks(payPeriodId)

Get check(s) that are for a specific worker within a pay period that has not been processed

worker.checks('XXXXXX').then(function(checks){
  console.log(checks);
});

worker.checks(payPeriodId, earnings)

Add a check to a worker
earnings object needs to define as one of the following :

  • payHours: Will use the default hourly rate defined on the worker to apply the hours against.
  • payHours & payRate: Will allow you to define the monetary rate that the hours will be applied against.
  • payHours & payRateId: Will allow you to define which workers predefined pay rate the hours will be applied against.
  • payUnits: Will use the default hourly rate defined on the worker to apply the units against.
  • payUnits & payRate: Will allow you to define the monetary rate that the units will be applied against.
  • payUnits & payRateId: Will allow you to define which workers predefined pay rate the units will be applied against.
  • payAmount: Will allow you to define straight monetary amount.
worker.checks('XXXXX', earnings).then(function(check){
  console.log(check);
});

worker.check(checkId)

Get a check by checkId Returns a check

worker.check('XXXXXX').then(function(check){
  console.log(check);
});

worker.deleteCheck(checkId)

Delete a check by checkId

worker.deleteCheck('XXXXXX').then(function(result){
  console.log(result);
});