Many of the methods for getting lists of things
(Employers,
Pay Runs, etc)
have a return type of Item[]
.
An Item
is a relatively lightweight object, allowing the API to quickly give you the information you need using as little bandwidth as possible.
The url
property gives you the url on which you can perform a GET
to retrieve the full version of this list item.
As you might have guessed, name
gives you the name of the item.
The id
is the id of the item. This is only present if it's relevant.
There are a small number of cases where this value is irrelevant and therefore
left empty.
The metadata
value is a dynamic object
.
The names of the fields it contains will vary depending on what is being listed.
It's purposes is to give a little extra information about the item.
[{
"id": "4b8bceb8-d3b1-46b1-9d04-6c0dfca51926",
"name": "Miss Annie Apiola",
"metadata": {
"payrollCode": "101",
"period": 12,
"basicPay": 1000.00
},
"url": "https://api-server/employers/6dd1459a-9230-4903-aa7d-6f1cb27acd5e/employee/4b8bceb8-d3b1-46b1-9d04-6c0dfca51926"
},
{
"id": "168ca68e-c3a7-408f-b0ab-4c4d410423ef",
"name": "Mr Gordon Guide",
"metadata": {
"payrollCode": "102",
"period": 12,
"basicPay": 1000.00
},
"url": "https://api-server/employers/6dd1459a-9230-4903-aa7d-6f1cb27acd5e/employee/168ca68e-c3a7-408f-b0ab-4c4d410423ef"
}
]