Developer Resources
Calculate Year-To-Date (YTD) Wages
Learn how to calculate year-to-date (YTD) gross wages for individual employees using data returned from Finch Organization endpoints.
A common use case for Finch APIs is to calculate YTD gross wages for individual employees. This useful and powerful information can be calculated easily by using the right approach.
Logic Flow
The general flow for calculating individual YTD wages works like this:
- Call the
/payment
endpoint and pass astart_date
of the first day of the year (January 01) and anend_date
of the current date. - Loop over the array of returned payment objects and collect all of the payment
id
s. - Call the
/pay-statement
endpoint and pass all of thepayment_id
s as a batched request. - Loop over the array of returned pay statements and aggregate each individual’s gross pay amounts.
Sequence Diagram
Was this page helpful?