> ## 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.

# Applying the Toku Deduction in ADP

> How Toku applies the stablecoin deduction through ADP's Pay Data Input event API

Each pay cycle, Toku applies one dedicated deduction per participating worker, using ADP's Pay Data Input event API. This is the only write Toku performs against your ADP account.

## Endpoint

Before posting, Toku calls the API's meta endpoint — `GET /events/payroll/v1/pay-data-input.modify/meta` (filterable by `companyCode`/`fileNumber`) — to confirm the Toku deduction code is valid for your payroll group. It then submits a pay data batch:

```bash theme={null}
curl -X POST "https://api.adp.com/events/payroll/v1/pay-data-input.modify" \
  --cert toku.crt --key toku.key \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d @pay-data-batch.json
```

A trimmed request envelope:

```json theme={null}
{
  "events": [
    {
      "data": {
        "eventContext": {
          "payrollGroupCode": { "codeValue": "ABC" },
          "payrollProcessingJobID": "1234567"
        },
        "transform": {
          "payDataInput": {
            "payeePayInputs": [
              {
                "associateOID": "G3349PZGBADQY8H8",
                "payrollProfilePayInputs": [
                  {
                    "payrollFileNumber": "078765",
                    "payInputs": [
                      {
                        "deductionInputs": [
                          {
                            "deductionCode": { "codeValue": "TOKU" },
                            "deductionRate": { "rateValue": 250.00, "currencyCode": "USD" }
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    }
  ]
}
```

The scope used is `/payroll/payrollManagement/payrollProcessing/payDataInputManagement/pay-data-input.modify`. See ADP's reference to validate the call: [Pay Data Input v1 API Explorer](https://developers.adp.com/apis/api-explorer/hcm-offrg-wfn/hcm-offrg-wfn-payroll-pay-data-input-v1-pay-data-input) and [ADP's sample payloads on GitHub](https://github.com/adpllc/marketplace-sample-payloads).

## How the Amount Is Set

* The worker's stablecoin election in Toku determines the amount for each pay cycle.
* Toku recalculates and posts the deduction before each run, so one-off changes (bonuses, prorated periods, paused elections) are handled automatically.
* The line item appears on the worker's pay statement under the Toku deduction code configured during onboarding, so payslips stay self-explanatory.

## Guarantees

| Behavior         | Detail                                                             |
| ---------------- | ------------------------------------------------------------------ |
| One line item    | Exactly one Toku deduction per participating worker per run        |
| No gross changes | Gross pay, taxes, and every other pay code are untouched           |
| Bounded amount   | The deduction is validated against pay before it is posted         |
| Reversible       | Removing a worker's election stops the deduction from the next run |

<Warning>
  ADP accepts a pay data batch only while the pay cycle is in the **Entering Payroll Information** or **Correcting Input** state, and a single invalid entry fails the entire multi-employee batch. Toku validates every entry against the meta endpoint before posting and retries per-employee, so one worker's issue never blocks the rest of the run.
</Warning>

## Reconciliation

After the payroll is processed, Toku reads the finalized payroll output, confirms each applied deduction, and releases the matching on-chain stablecoin payments. Any mismatch blocks settlement and is surfaced in the Toku dashboard before funds move.

## Next

<CardGroup cols={2}>
  <Card title="Integration Overview" icon="map" href="/integrations/adp">
    Back to the ADP integration overview
  </Card>

  <Card title="Employee Sync" icon="users" href="/integrations/adp/employee-sync">
    How Toku reads your worker roster
  </Card>
</CardGroup>
