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

# Report payrolls

> Tell Hammock what each payroll withheld and paid, and void one that changes.

Reporting a payroll is the core of the integration. Hammock doesn't create payrolls or guess at
them: you report each one, with your own ID, pay period and pay date, and Hammock funds accounts
from what you report.

## The loop

```mermaid theme={null}
sequenceDiagram
  participant P as Your platform
  participant H as Hammock
  participant B as Employer bank
  participant M as Employee accounts
  Note over P,H: Lock date, Mar 17
  P->>H: GET /deductions, pay_date 2027-03-19
  P->>H: GET /reimbursements, status pending
  P->>P: Approve the payroll
  P->>H: POST /payrolls with what was withheld and paid
  H-->>P: Payroll, status reported
  Note over P,H: Voidable until the pull starts
  Note over H,B: Pay date, Mar 19
  H->>B: ACH pull for the contributions
  H-->>P: Event payroll.funding_started
  B-->>H: Settles on Mar 24
  H->>M: Post contributions
  H-->>P: Event payroll.completed
```

## Report a payroll

Report a payroll when it locks, which for most payrolls is when it's approved.

```bash theme={null}
curl https://api.usehammock.co/payrolls \
  -H "Authorization: Bearer hmk_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d" \
  -d '{
    "employer": "empr_1Qx8Zt2eZvKYlo2C",
    "external_id": "payroll_2027_03_19",
    "type": "regular",
    "pay_schedule": "ps_7Hn3Kd9sLq2W",
    "pay_period": { "start_date": "2027-03-01", "end_date": "2027-03-15" },
    "pay_date": "2027-03-19",
    "deductions": [
      { "deduction": "ded_2Lp9Xc4vNm7K", "employee_amount": 15000, "employer_amount": 5000 },
      { "deduction": "ded_5Rt8Yu1iOp4A", "employee_amount": 20834, "employer_amount": 0 }
    ],
    "reimbursements": ["reimb_8Wq3Zr6tHy1D"]
  }'
```

* **`external_id`** is your payroll's ID. It's unique within the employer, so a payroll can't be
  reported twice. Reuse it only after voiding the earlier report.
* **`deductions`** lists what was actually withheld and contributed, per deduction. Report real
  amounts, including zero.
* **`reimbursements`** lists the pending [reimbursements](https://partners.usehammock.co/guides/reimbursements.md) this payroll
  pays.

```json theme={null}
{
  "id": "pay_6Mn2Bv8cXz4L",
  "object": "payroll",
  "employer": "empr_1Qx8Zt2eZvKYlo2C",
  "external_id": "payroll_2027_03_19",
  "type": "regular",
  "pay_schedule": "ps_7Hn3Kd9sLq2W",
  "pay_period": { "start_date": "2027-03-01", "end_date": "2027-03-15" },
  "pay_date": "2027-03-19",
  "status": "reported",
  "voidable_until": "2027-03-19T13:00:00Z",
  "pull": "pull_3Vb7Nm1qWe5R",
  "totals": {
    "employee_amount": 35834,
    "employer_amount": 5000,
    "reimbursement_amount": 12500,
    "currency": "usd"
  },
  "deductions": [
    {
      "deduction": "ded_2Lp9Xc4vNm7K",
      "employee": "emp_5Tg7Rw2nBx8P",
      "benefit_type": "hsa",
      "expected_employee_amount": 15000,
      "employee_amount": 15000,
      "expected_employer_amount": 5000,
      "employer_amount": 5000,
      "variance": "none"
    },
    {
      "deduction": "ded_5Rt8Yu1iOp4A",
      "employee": "emp_5Tg7Rw2nBx8P",
      "benefit_type": "dependent_care_fsa",
      "expected_employee_amount": 20834,
      "employee_amount": 20834,
      "expected_employer_amount": 0,
      "employer_amount": 0,
      "variance": "none"
    }
  ],
  "reimbursements": ["reimb_8Wq3Zr6tHy1D"]
}
```

## Statuses

| Status | Meaning |
| - | - |
| `reported` | Hammock has the payroll. You can void it until `voidable_until`. |
| `funding` | The ACH pull has started. |
| `completed` | The pull settled and contributions are in employees' accounts. |
| `voided` | You voided it. Nothing was pulled. |
| `failed` | The employer's bank returned the pull. Hammock support follows up with the employer. |

A payroll with nothing to pull, such as one that only pays reimbursements, has `"pull": null` and
moves from `reported` to `completed` on its pay date.

## When actuals differ from the deduction

Each reported line carries a `variance` comparing it with what the deduction called for.

| Variance | What happened | What Hammock does |
| - | - | - |
| `none` | The amounts match. | Funds them. |
| `under` | Less was withheld, for example on a short paycheck. | Funds what was withheld. The shortfall isn't caught up on later paychecks. |
| `over` | More was withheld. | Funds it and flags it for review. |
| `not_reported` | An active deduction was left out. | Records nothing withheld and flags it for review. |

An amount that would take an employee past an IRS annual limit is rejected with
`contribution_limit_exceeded`, and the payroll isn't created. Fix the line and report again.

## Off-cycle payrolls

Report a bonus run, a correction or a final paycheck the same way, with `"type": "off_cycle"`.
`pay_schedule` is optional for these. Include only the deductions and reimbursements that the run
actually carried.

## Void a payroll

If a reported payroll is reopened, changes or fails to fund, void it and report it again.

```bash theme={null}
curl -X POST https://api.usehammock.co/payrolls/pay_6Mn2Bv8cXz4L/void \
  -H "Authorization: Bearer hmk_live_..." \
  -H "Idempotency-Key: ad8a81e3-32e9-4b3a-a3cf-235906d5d1be"
```

Voiding cancels the pull and returns the payroll's reimbursements to `pending`. To correct one
paycheck, void the payroll and report it again with the corrected lines. You can reuse the same
`external_id`.

### The void window

A payroll can be voided until its pull starts. `voidable_until` gives the exact time.

| Reported | Pull starts | Window |
| - | - | - |
| On the lock date | On the pay date | From the report to the pay date |
| On or after the pay date | One business day after the report | One business day |

```mermaid theme={null}
sequenceDiagram
  participant P as Your platform
  participant H as Hammock
  P->>H: POST /payrolls on Mar 17
  H-->>P: reported, voidable_until Mar 19
  P->>P: Payroll reopened on Mar 18
  P->>H: POST /payrolls/pay_6Mn2Bv8cXz4L/void
  H-->>P: voided
  P->>H: POST /payrolls with corrected lines
  H-->>P: reported, a new payroll ID
```

### After the window

Once the pull has started, voiding returns an error:

```json theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "payroll_not_voidable",
    "message": "This payroll's pull has started, so it can no longer be voided. Contact Hammock support to correct it.",
    "doc_url": "https://docs.usehammock.co/api/errors#payroll_not_voidable",
    "request_id": "req_9Kd2Lm5nPq8R"
  }
}
```

Hammock support then corrects it with you, because money is already moving. That can mean
returning funds to the employer or taking a contribution back out of an employee's account.

> [!WARNING]
>
> If a payroll you reported doesn't pay, void it before the pay date. Otherwise Hammock pulls for
> contributions that were never withheld.

## If a report is missing

Hammock compares reports with each [pay schedule](https://partners.usehammock.co/guides/pay-schedules.md). When a payday passes
with no report for a schedule that has active deductions, you receive a
`pay_schedule.payroll_overdue` event. Report the payroll as soon as you can: until you do, the
money withheld from employees isn't in their accounts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.