> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onsi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# End of Cycle Processing

> Learn how to efficiently process end of cycle deductions and integrate them with your payroll system using the Onsi API.

## Recommended Strategy

Our recommended approach for end of cycle deduction processing follows a simple polling pattern that ensures you never miss a cycle and can easily integrate with any payroll system.

<Steps>
  <Step title="Set up regular polling">
    Configure your system to poll the [Get Cycles](/api-reference/pay/get-cycles) endpoint on a regular cadence (daily
    is recommended, but you can adjust based on your needs).
  </Step>

  <Step title="Identify the latest closed cycle">
    From the cycles response, find the most recent cycle with status `Closed`. This indicates that no more withdrawals
    can be made and the cycle is ready for final accounting.

    <Warning>
      It's worth noting that only when a Pay Cycle is `Closed` are members no longer able to make withdrawals. Don't
      process your payroll until the cycle is `Closed`.
    </Warning>
  </Step>

  <Step title="Retrieve cycle deductions">
    Use the [Get Cycle Deductions](/api-reference/pay/get-cycle-deductions) endpoint to get a complete list of all
    members and their total deduction amounts for the cycle.
  </Step>

  <Step title="Handle pagination">
    Paginate through all deduction results to ensure you capture every member's deductions. The endpoint supports
    pagination with `skip` and `take` parameters.
  </Step>

  <Step title="Integrate with your payroll system">
    Feed the deduction data into your payroll system using your preferred method - API integration, CSV upload, or
    automation tools.
  </Step>
</Steps>
