Employees

Read-only and minimal, for the same reason as users, only more so. The stored row carries social security numbers, pay rates, bank details and tax withholding. None of that is returned and none of it is writable. This resource exists only so salesman.payrollid can be resolved to a name.

The object#

FieldTypeDescription
idread-onlyintegerEmployee id.
firstnameread-onlystring(30)The employee’s first name.
lastnameread-onlystring(30)The employee’s last name.
cancelread-onlybooleanTrue once cancelled.

Endpoints#

GET/premployees 200403

List employees.

Requires scope payroll:read.

Parameters
NameInTypeNotes
cancelquerystringDefaults to false. Pass true or any.
modifiedsincequerystringRFC 3339 UTC timestamp. Returns only records changed since then, including cancelled ones - so cancel defaults to any rather than false when this is used. The response carries _meta.synced_through; store it and send it back next time.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
403insufficient_scopeToken lacks premployees:read.
curl \
  'https://acme.nolapro.com/!/api/v2/premployees' \
  -H 'Authorization: Bearer $NP_TOKEN'
GET/premployees/{id} 200404

Retrieve one record.

Requires scope payroll:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe record id.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
404not_foundNo record with that id.
curl \
  'https://acme.nolapro.com/!/api/v2/premployees/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "id": 5,
    "firstname": "Jane",
    "lastname": "Smith",
    "cancel": false
}
GET/premployees/checks 200

Re-print a payroll cheque as a PDF

Re-draws a payroll cheque that has already been written. Records nothing. Answers application/pdf, not JSON. Because the body is binary it cannot be carried inside a /batch results array; asking for it there returns 415 not_batchable.

Requires scope payroll:read.

Parameters
NameInTypeNotes
checknbrrequiredquerystringThe cheque to draw.
curl \
  'https://acme.nolapro.com/!/api/v2/premployees/checks' \
  -H 'Authorization: Bearer $NP_TOKEN'
GET/premployees/w2 200

W-2 forms as a PDF

The W-2 run for a tax year, covering every employee paid in it. Answers application/pdf, not JSON. Because the body is binary it cannot be carried inside a /batch results array; asking for it there returns 415 not_batchable.

Requires scope payroll:read.

Parameters
NameInTypeNotes
yearquerystringFour-digit tax year. Defaults to last year.
curl \
  'https://acme.nolapro.com/!/api/v2/premployees/w2' \
  -H 'Authorization: Bearer $NP_TOKEN'