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

# Gusto Payroll Sync

> How Toku tracks pay periods and payroll status in Gusto

Toku tracks your Gusto payroll calendar so the Toku deduction is always applied to the right pay period — and so on-chain delivery lines up with your check date.

## Endpoint

Toku reads payrolls through Gusto's company payrolls resource, filtered to upcoming (unprocessed) runs:

```bash theme={null}
curl "https://api.gusto.com/v1/companies/<company_id>/payrolls?processing_statuses=unprocessed&include=totals" \
  -H "Authorization: Bearer <access_token>"
```

A trimmed example response:

```json theme={null}
[
  {
    "payroll_uuid": "f2a8c3de-91b4-4f2e-8a77-3d0c1c9e5b21",
    "pay_period": {
      "start_date": "2026-07-01",
      "end_date": "2026-07-15"
    },
    "check_date": "2026-07-20",
    "processed": false,
    "off_cycle": false
  }
]
```

See Gusto's reference for the full schema: [Get all payrolls for a company](https://docs.gusto.com/embedded-payroll/reference/get-v1-companies-company_id-payrolls).

## What Toku Reads

| Field                                | Purpose                                                 |
| ------------------------------------ | ------------------------------------------------------- |
| `payroll_uuid`                       | Ties each Toku pay cycle to the exact Gusto payroll run |
| `pay_period.start_date` / `end_date` | Determines which elections apply to the run             |
| `check_date`                         | Schedules on-chain stablecoin delivery                  |
| `processed`                          | Confirms the run is finalized before Toku settles       |

## Sync Behavior

* Upcoming pay periods appear in the Toku dashboard as soon as they exist in Gusto.
* When a payroll's status flips to processed, Toku reconciles the applied deductions against the run and releases the corresponding stablecoin payments.
* Off-cycle payrolls are detected and skipped by default (configurable during onboarding).

<Note>
  Payroll sync is read-only. Toku never creates, calculates, or submits payrolls in Gusto — your team keeps full control of running payroll.
</Note>

## Next

<CardGroup cols={2}>
  <Card title="The Toku Deduction" icon="money-bill-transfer" href="/integrations/gusto/deduction">
    How the deduction is applied via the Gusto API
  </Card>

  <Card title="Authentication" icon="lock" href="/integrations/gusto/authentication">
    OAuth 2.0 scopes and token handling
  </Card>
</CardGroup>
