Reports
Create Year to Date Report
Start an asynchronous job to generate a Year to Date (YTD) report summarizing cumulative payroll totals for a company.
POST
/
reports
/
ytd
Create Year to Date Report
curl --request POST \
--url https://api.zeal.com/reports/ytd \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"companyID": "fcc26cc444450ac8a33ry32a3z34462",
"employeeID": [
"6266y546eyecc34458aef1",
"6556fabfcf2eab26e23331"
],
"year": "2023",
"media_type": "json"
}
'import requests
url = "https://api.zeal.com/reports/ytd"
payload = {
"companyID": "fcc26cc444450ac8a33ry32a3z34462",
"employeeID": ["6266y546eyecc34458aef1", "6556fabfcf2eab26e23331"],
"year": "2023",
"media_type": "json"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyID: 'fcc26cc444450ac8a33ry32a3z34462',
employeeID: ['6266y546eyecc34458aef1', '6556fabfcf2eab26e23331'],
year: '2023',
media_type: 'json'
})
};
fetch('https://api.zeal.com/reports/ytd', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zeal.com/reports/ytd",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'companyID' => 'fcc26cc444450ac8a33ry32a3z34462',
'employeeID' => [
'6266y546eyecc34458aef1',
'6556fabfcf2eab26e23331'
],
'year' => '2023',
'media_type' => 'json'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zeal.com/reports/ytd"
payload := strings.NewReader("{\n \"companyID\": \"fcc26cc444450ac8a33ry32a3z34462\",\n \"employeeID\": [\n \"6266y546eyecc34458aef1\",\n \"6556fabfcf2eab26e23331\"\n ],\n \"year\": \"2023\",\n \"media_type\": \"json\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zeal.com/reports/ytd")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyID\": \"fcc26cc444450ac8a33ry32a3z34462\",\n \"employeeID\": [\n \"6266y546eyecc34458aef1\",\n \"6556fabfcf2eab26e23331\"\n ],\n \"year\": \"2023\",\n \"media_type\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeal.com/reports/ytd")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyID\": \"fcc26cc444450ac8a33ry32a3z34462\",\n \"employeeID\": [\n \"6266y546eyecc34458aef1\",\n \"6556fabfcf2eab26e23331\"\n ],\n \"year\": \"2023\",\n \"media_type\": \"json\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"job_id": "4a25e61a9-9bd2-4445-ba70-f3e874d772d2",
"status": "pending",
"request_body": {
"companyID": "fcc26cc444450ac8a33ry32a3z34462",
"employeeID": [
"6266y546eyecc34458aef1",
"6556fabfcf2eab26e23331"
],
"year": "2023",
"media_type": "json",
"has_live_key": true,
"job_type": "reports",
"report_format": "ytd"
},
"created_at": "2023-12-07T16:25:35.575Z"
}
}{
"success": false,
"errors": [
{
"message": "Date is not a valid date",
"code": 44
}
]
}Authorizations
Body
application/json
The ID of the company
The year to query for the report
The media_type of the report
Available options:
json, csv Array of employee IDs to grab YTD data for. If this field is omitted, or an empty array is provided, then the report will include all employees
Include migrated data in the report
⌘I
Create Year to Date Report
curl --request POST \
--url https://api.zeal.com/reports/ytd \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"companyID": "fcc26cc444450ac8a33ry32a3z34462",
"employeeID": [
"6266y546eyecc34458aef1",
"6556fabfcf2eab26e23331"
],
"year": "2023",
"media_type": "json"
}
'import requests
url = "https://api.zeal.com/reports/ytd"
payload = {
"companyID": "fcc26cc444450ac8a33ry32a3z34462",
"employeeID": ["6266y546eyecc34458aef1", "6556fabfcf2eab26e23331"],
"year": "2023",
"media_type": "json"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyID: 'fcc26cc444450ac8a33ry32a3z34462',
employeeID: ['6266y546eyecc34458aef1', '6556fabfcf2eab26e23331'],
year: '2023',
media_type: 'json'
})
};
fetch('https://api.zeal.com/reports/ytd', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zeal.com/reports/ytd",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'companyID' => 'fcc26cc444450ac8a33ry32a3z34462',
'employeeID' => [
'6266y546eyecc34458aef1',
'6556fabfcf2eab26e23331'
],
'year' => '2023',
'media_type' => 'json'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zeal.com/reports/ytd"
payload := strings.NewReader("{\n \"companyID\": \"fcc26cc444450ac8a33ry32a3z34462\",\n \"employeeID\": [\n \"6266y546eyecc34458aef1\",\n \"6556fabfcf2eab26e23331\"\n ],\n \"year\": \"2023\",\n \"media_type\": \"json\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zeal.com/reports/ytd")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyID\": \"fcc26cc444450ac8a33ry32a3z34462\",\n \"employeeID\": [\n \"6266y546eyecc34458aef1\",\n \"6556fabfcf2eab26e23331\"\n ],\n \"year\": \"2023\",\n \"media_type\": \"json\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeal.com/reports/ytd")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyID\": \"fcc26cc444450ac8a33ry32a3z34462\",\n \"employeeID\": [\n \"6266y546eyecc34458aef1\",\n \"6556fabfcf2eab26e23331\"\n ],\n \"year\": \"2023\",\n \"media_type\": \"json\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"job_id": "4a25e61a9-9bd2-4445-ba70-f3e874d772d2",
"status": "pending",
"request_body": {
"companyID": "fcc26cc444450ac8a33ry32a3z34462",
"employeeID": [
"6266y546eyecc34458aef1",
"6556fabfcf2eab26e23331"
],
"year": "2023",
"media_type": "json",
"has_live_key": true,
"job_type": "reports",
"report_format": "ytd"
},
"created_at": "2023-12-07T16:25:35.575Z"
}
}{
"success": false,
"errors": [
{
"message": "Date is not a valid date",
"code": 44
}
]
}