#### URL Expired

The URL for this request expired after 30 days.

Creates a Year-to-date report for specified employees returning gross pay, net pay, taxes, total employer taxes, total employee taxes, deductions for each check associated with the employees as well as a summary of totals for all of the above parameters for all employee checks. Payroll information will only be taken into account for reports from checks that are in a processed state.

This endpoint will return a `job_id` instead of the raw data itself. As the data returned from this endpoint can be large, we utilize a job queue to process this data instead of an immediate synchronous response. Once the [job status](https://docs.zeal.com/reference/get-job-status) is marked as **complete**, the report can be downloaded using the [Download Report](https://docs.zeal.com/reference/retrieve-report-download) endpoint.

## Returns   [Skip link to Returns](https://docs.zeal.com/reference/year-to-date-report#returns)

| attribute | type | description |
| --- | --- | --- |
| success | boolean | Response status |
| data | object | `job_id` for Year to Date report |
| errors | array | Contains a list of error objects which consists of:<br>`message`: Error message<br>`code`: Error code as described in [Error codes](https://docs.zeal.com/reference/error-codes) |

### Parameters

| Parameter | Type              | Required | Description |
| --------- | ----------------- | -------- | ----------- |
| companyID | string            | required | The ID of the company |
| employeeID | array of strings | Optional | 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 |
| year      | string            | required | The year to query for the report |
| media_type | string           | required | Defaults to json. The media_type of the report (Allowed: `json`, `csv`) |
| include_migrated | boolean     | Optional | Defaults to false. Include migrated data in the report |

# Sample Request

```bash
curl --request POST \
     --url https://api.zeal.com/reports/ytd \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{
  "media_type": "json",
  "include_migrated": false
}'
```

# Sample Responses

```json
// 200 - Result
{...}
```
```json
// 400 - Result
{...}
```
