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

# Write deductions

> Send one-time deductions, like a monthly benefit contribution, into your customers' payroll tools and follow each one until a pay run processed it.

> [!WARNING]
>
> **Closed beta:** We're still testing this API and it can change. If anything
> is unclear, let us know through your Kombo contact or
> [support](mailto:support@kombo.dev).

With the Write Deductions API you send deductions straight into your customers' payroll tools. You schedule a batch with Kombo. Kombo saves it right away and tells you which pay run and deduction code each deduction will use. Kombo then writes the deductions to the payroll tool with its next regular sync. Until then, you can see every queued deduction and cancel the ones you don't want anymore. After that, you can follow each deduction until a pay run has processed it.

## How it works

**1. Set up once in the dashboard**

Create your deduction types, map them to deduction codes for each
connection.

**2. Schedule deductions**

Call [`POST
        /payroll/one-time-deductions/schedule`](https://docs.kombo.dev/payroll/v1/post-one-time-deductions-schedule.md)
with up to 1,000 deductions. Kombo checks each one, saves it as&#x20;
QUEUED, and tells you right away which pay run it goes
into.

**3. Kombo writes them with the next sync**

With its next regular sync, Kombo writes each queued deduction into the pay
run it picked. Each status changes to show the result, up to
PROCESSED once a pay run picked it up.

**4. Check and clean up**

[List your deductions](https://docs.kombo.dev/payroll/v1/get-one-time-deductions.md) to see what's
queued, written, processed, or failed.
[Cancel](https://docs.kombo.dev/payroll/v1/post-one-time-deductions-cancel.md) queued deductions you
don't want anymore, before Kombo writes them.

The whole flow, from your app through Kombo to the payroll tool:

![Your app schedules deductions with Kombo and gets a result per item right away. With the next sync Kombo writes each queued deduction to the payroll tool. You list deductions to see their status and cancel the ones still queued or failed.](https://mintcdn.com/kombo/EtNOBowu71MZpAV6/images/payroll/write-deductions-flow.svg?fit=max\&auto=format\&n=EtNOBowu71MZpAV6\&q=85\&s=dadd73fcf0e73272e58f960e59600566)

## Step 1: Set up deduction types

You do this once in the Kombo dashboard, before you schedule anything.

1. **Create deduction types (once per environment).** Add a fixed set of deduction types that match your product, each with a stable key, for example `gym_membership`. The keys are the same for all your customers. If your customer sets up their mapping that way, the payroll tool shows the label you give each type as the deduction's description.
2. **Map them to deduction codes (per connection).** For each connection, pick the deduction code in your customer's payroll tool that each type should use, for example `GYM01`. The mapping also decides the currency.
3. **Choose if HR has to approve deductions (per connection).** Some tools, like UKG, write deductions as pending, so HR approves them before payroll runs. Others, like DATEV, apply them right away. Kombo only shows this setting if the connected tool supports both.

## Step 2: Schedule deductions

[`POST /payroll/one-time-deductions/schedule`](https://docs.kombo.dev/payroll/v1/post-one-time-deductions-schedule)

Send a list of `items`, with **1 to 1,000 items per request**. Each item is one deduction for one employment. One request can mix employees from different pay groups and pay schedules: you never send a pay group, Kombo takes it from the employment. If you have more than 1,000 deductions, split them over several requests. The [API reference](https://docs.kombo.dev/payroll/v1/post-one-time-deductions-schedule.md) has the full request with code samples.

> [accordion] Example request body
>
> ```json theme={null}
> {
>   "items": [
>     {
>       "origin_id": "inv-2026-11-emp-123",
>       "deduction": {
>         "employment_id": "3Rr5mVhEoJ4zQJMDfRfkYcFi",
>         "deduction_type": "gym_membership",
>         "employee_contribution": { "type": "FLAT", "amount": 19.9 },
>         "effective_at": { "type": "NEXT_AVAILABLE_PAY_RUN" }
>       }
>     },
>     {
>       "origin_id": "inv-2026-11-emp-456",
>       "deduction": {
>         "employment_id": "9mKq2TfWxB7nLpYc4ZsDhEuA",
>         "deduction_type": "gym_membership",
>         "employee_contribution": { "type": "FLAT", "amount": 29.9 },
>         "effective_at": { "type": "NEXT_AVAILABLE_PAY_RUN" }
>       }
>     }
>   ]
> }
> ```

> [accordion] Request fields
>
> | Field | Description |
> | - | - |
> | `origin_id` | Your own unique ID for this deduction. Protects against double deductions ([see below](#avoiding-double-deductions)). |
> | `deduction.employment_id` | Kombo ID of the employment, from [`GET /hris/employments`](https://docs.kombo.dev/hris/v1/get-employments) or the employments on each employee. |
> | `deduction.deduction_type` | Key of a deduction type from the dashboard. Your mapping decides the deduction code and currency. |
> | `deduction.employee_contribution` | Always `FLAT` with an `amount` greater than 0 and at most 2 decimals, for example `19.90`. No currency: it comes from the mapping. |
> | `deduction.effective_at` | Which pay run to use. Always `{ "type": "NEXT_AVAILABLE_PAY_RUN" }` ([see Step 3](#how-kombo-picks-the-pay-run)). |

### The response

Kombo checks every item against what it already knows: the request format, the deduction type mapping, the employment, and your earlier `origin_id` values. Then it answers with one result per item, each with the `origin_id` you sent. The results don't have to come back in the order you sent them, so match them by `origin_id`. Each result has either `data` or an `error`:

* **`data`** is the saved deduction, in the same shape as the list endpoint. A new one is QUEUED, already with its `deduction_code` and planned `pay_run`.
* **`error`** means nothing was saved for this item, and the `code` says why ([see Deduction errors](https://docs.kombo.dev/payroll/guides/deduction-errors.md#when-you-schedule)). The other items in the request are still saved.

> [accordion] Example response
>
> ```json theme={null}
> {
>   "status": "success",
>   "data": {
>     "results": [
>       {
>         "origin_id": "inv-2026-11-emp-123",
>         "data": {
>           "id": "26vafvWSRmbhNcxJYqjCzuJg",
>           "status": "QUEUED",
>           "remote_id": null,
>           "deduction_code": {
>             "id": "Bq9zVXhSPZ4nEmT6yWkLdRc2",
>             "remote_id": "GYM01",
>             "name": "Wellness benefit 1"
>           },
>           "employee_contribution": {
>             "type": "FLAT",
>             "amount": 19.9,
>             "currency": "EUR"
>           },
>           "pay_run": {
>             "id": "4nQx8sLbWm2TcRvYk7HdJpZe",
>             "start_date": "2026-12-01",
>             "end_date": "2026-12-31",
>             "pay_date": "2026-12-31"
>           },
>           "...": "..."
>         }
>       },
>       {
>         "origin_id": "inv-2026-11-emp-456",
>         "error": {
>           "code": "PAYROLL.EMPLOYMENT_NOT_FOUND",
>           "title": "The employment could not be found or has no pay run left.",
>           "message": "No employment with this ID exists for the integration.",
>           "log_url": "https://app.kombo.dev/my-prod/logs?interactionId=123456"
>         }
>       }
>     ]
>   }
> }
> ```

> [!WARNING]
>
> **`data` means Kombo has your deduction, not the payroll tool.** Kombo writes
> it with the next sync, and it can still fail there, for example if the payroll
> tool rejects it. Check the status afterwards ([Step
> 4](#step-4-check-and-clean-up)).

### Avoiding double deductions

A deduction is real money taken from someone's salary, and it's hard to undo once payroll has run. That's why every deduction needs an `origin_id`: your own stable ID for it, for example your invoice line per employee and month. Kombo matches `origin_id` per integration.

| You send | What Kombo does |
| - | - |
| A new `origin_id` | Saves a new deduction, even if the employee, amount, and month match another one, and returns it in `data`. |
| The `origin_id` of a `CANCELLED` deduction | Saves a new deduction and returns it in `data`. The cancelled one stays in the list as `CANCELLED`. |
| A known `origin_id` with the same values | Changes nothing and returns the existing deduction in `data`, with its current status. |
| A known `origin_id` with any other value | Returns an `error` with `PAYROLL.ORIGIN_ID_CONFLICT`. The existing deduction stays as it is. |

> [!TIP]
>
> **Safe to retry.** If a request times out or you're not sure it went through,
> send it again. Deductions Kombo already has come back as they are, so nothing
> is saved or written twice.

> [accordion] Need to change a deduction?
>
> As long as it's QUEUED, cancel it and schedule it again
> with the new values. You can reuse the same `origin_id`, because the
> cancelled deduction was never deducted.

> [accordion] Retrying a failed deduction?
>
> A FAILED deduction keeps its `origin_id`. Sending it again
> with the same values only returns the failed deduction, and with other
> values you get `PAYROLL.ORIGIN_ID_CONFLICT`. So cancel it first, then
> schedule it again with the same `origin_id`. Or use a new `origin_id`, and
> the failed one stays in the list as it is.

> [accordion] Scheduling every month?
>
> Use a new `origin_id` each month, for example `inv-2026-11-emp-123` for
> November and `inv-2026-12-emp-123` for December.

## Step 3: Kombo writes them with the next sync

Kombo writes deductions with its regular sync, the same one that reads data from the payroll tool, by default every 3 hours. Each sync takes all QUEUED deductions of the connection and writes them to the payroll tool. Kombo handles the tool's rate limits and retries, so you don't have to spread out your requests. After that, Kombo keeps reading each written deduction back with every sync until it's processed, declined, or failed.

Want them out sooner, for example right after your monthly billing run? Call [`POST /hris/force-sync`](https://docs.kombo.dev/hris/v1/post-force-sync) to start a sync now.

The sync doesn't care which request a deduction came from. Say you send three requests with 100 deductions each: if all 300 are queued when the next sync starts, that one sync writes all 300. Deductions you schedule while a sync is already running wait for the next one.

**No deduction is written twice.** Only one sync runs per connection at a time. While a sync writes, it locks the deductions it picked up, so they can't be cancelled or picked up again halfway through.

Everything you schedule waits as QUEUED until the next sync. That's your window to check the list and [cancel](#cancel-deductions) anything that shouldn't go out, before it reaches the payroll tool.

### Deduction statuses

![A deduction starts as QUEUED in Kombo. With the next sync it becomes PENDING\_APPROVAL or PENDING in the payroll tool, or FAILED if the tool rejects it or Kombo misses the cutoff. PENDING\_APPROVAL becomes PENDING when HR approves it or DECLINED when HR declines it. PENDING becomes PROCESSED after the pay run, or FAILED if HR removed it or the employee left. A QUEUED or FAILED deduction becomes CANCELLED when you cancel it with POST cancel.](https://mintcdn.com/kombo/EtNOBowu71MZpAV6/images/payroll/deduction-statuses.svg?fit=max\&auto=format\&n=EtNOBowu71MZpAV6\&q=85\&s=8f9c606bdf256d3ba8ac3e996084b6ae)

| Status | Where it is | Meaning | Can you cancel it? |
| - | - | - | - |
| QUEUED | In Kombo | Saved in Kombo. Kombo writes it with the next sync. | Yes |
| PENDING\_APPROVAL | In the tool | Waiting for HR to approve it. Only in tools where approval is turned on. | No |
| PENDING | In the tool | Scheduled for its pay run. HR can still change or remove it there. | No |
| PROCESSED | Final | A finished pay run processed it. Kombo's part is done. | No |
| DECLINED | Final | HR declined it while it was PENDING\_APPROVAL. Nothing is taken. | No |
| FAILED | Final | It never got into a pay run: the tool rejected the write, Kombo missed the cutoff, HR removed it, or the employee left with no pay run remaining. `error` tells you why. | Yes |
| CANCELLED | Final | You cancelled it while it was QUEUED or FAILED. Only shows up in the list when you filter for it. | Already cancelled |

> [!NOTE]
>
> **How does Kombo know?** The tool answers the write with an ID or an error,
> which gives PENDING, PENDING\_APPROVAL or&#x20;
> FAILED. For everything after that, Kombo keeps reading the
> item back, for example a processed pending pay item in UKG.&#x20;
> PROCESSED means a pay run picked the deduction up, not that
> the full amount was taken: if the employee didn't earn enough, the payroll
> tool handles the rest, for example as arrears. In tools where Kombo can't read
> this status, the deduction stays PENDING.

> [!NOTE]
>
> **If Kombo can't log in to the payroll tool**, the sync fails and your
> deductions stay QUEUED. They go out with the first sync
> after your customer reconnects, as long as their pay run's cutoff hasn't
> passed. Keep an eye on deductions that stay QUEUED after a
> sync ran.

### How Kombo picks the pay run

Pay schedules differ per pay group and per tool, and dates shift with month lengths and holidays. So you don't send a date or a pay run. You send a rule, `NEXT_AVAILABLE_PAY_RUN`, and Kombo tells you in `pay_run` which pay run that is. Kombo picks it once, when you schedule, and never changes it afterwards.

`NEXT_AVAILABLE_PAY_RUN` puts the deduction into the employee's next **regular** pay run that still takes deductions. Off-cycle runs are never picked, so a deduction never lands on a bonus or correction run by accident.

1. Kombo takes the pay group from the employment.
2. From that pay group's pay schedule, Kombo picks the next regular pay run.
3. If that pay run is already past its cutoff, Kombo uses the one after it.

Kombo does this when it accepts the deduction, so `pay_run` shows the planned pay run right away. When the sync writes the deduction, Kombo only checks that this pay run still takes deductions. If it doesn't, the deduction fails with `PAYROLL.CUTOFF_MISSED` instead of moving ([see The cutoff](#the-cutoff)). Every deduction gets its own pay run, so a request with employees on monthly and biweekly schedules just works.

### The cutoff

The cutoff is the last day a pay run still takes deductions. Kombo takes it from the payroll tool, or from the connection settings if the tool doesn't have one.

Kombo makes sure it writes each deduction before the cutoff of its pay run. If the next regular sync would come too late, Kombo syncs earlier. Kombo never moves a deduction to another pay run on its own: `pay_run` stays what Kombo told you when you scheduled it.

![The December pay run takes deductions until its cutoff on December 26. A deduction scheduled on December 14 is written with the next sync and goes into December. A deduction scheduled on December 28 is past the cutoff, so Kombo plans it for January right away.](https://mintcdn.com/kombo/EtNOBowu71MZpAV6/images/payroll/pay-run-cutoff.svg?fit=max\&auto=format\&n=EtNOBowu71MZpAV6\&q=85\&s=9174aa84ad078b622b25ecf80eb1baf9)

If Kombo still can't write it in time, for example because it can't log in to the payroll tool until after the cutoff, the deduction becomes FAILED with `PAYROLL.CUTOFF_MISSED`. Nothing is taken. Cancel it and schedule it again: Kombo then plans it for the next pay run.

## Step 4: Check and clean up

### List deductions

[`GET /payroll/one-time-deductions`](https://docs.kombo.dev/payroll/v1/get-one-time-deductions)

See where your deductions are. Results are paginated like other Kombo list endpoints. Filters that take a list accept comma-separated values.

> [accordion] Filters
>
> | Filter | Description |
> | - | - |
> | `ids` | Kombo deduction IDs |
> | `origin_ids` | Your own `origin_id` values |
> | `employment_ids` | Only deductions for these employments |
> | `pay_run_ids` | Only deductions planned for or written into these pay runs |
> | `statuses` | Only these statuses, for example `QUEUED,FAILED`. Cancelled ones only show up when you ask for them. |
> | `updated_after` | Only deductions that changed after this time. Handy to pick up what the last sync wrote. |

> [accordion] Example result: a failed deduction
>
> ```json theme={null}
> {
>   "id": "8hTq3WnZkR5vLmYc2XsBdPfA",
>   "origin_id": "inv-2026-11-emp-789",
>   "remote_id": null,
>   "employment_id": "5JkP9sQwYt3mNcVb8ZrLhGeD",
>   "deduction_type": "gym_membership",
>   "employee_contribution": {
>     "type": "FLAT",
>     "amount": 29.9,
>     "currency": "EUR"
>   },
>   "deduction_code": {
>     "id": "Bq9zVXhSPZ4nEmT6yWkLdRc2",
>     "remote_id": "GYM01",
>     "name": "Wellness benefit 1"
>   },
>   "pay_run": {
>     "id": "4nQx8sLbWm2TcRvYk7HdJpZe",
>     "start_date": "2026-12-01",
>     "end_date": "2026-12-31",
>     "pay_date": "2026-12-31"
>   },
>   "status": "FAILED",
>   "error": {
>     "code": "REMOTE.INPUT_INVALID",
>     "title": "The remote system rejected the input.",
>     "message": "Pay code GYM01 is not active for this company.",
>     "log_url": "https://app.kombo.dev/my-prod/logs?interactionId=123456"
>   },
>   "created_at": "2026-12-02T10:12:00.000Z",
>   "updated_at": "2026-12-02T13:04:51.000Z"
> }
> ```

### Cancel deductions

[`POST /payroll/one-time-deductions/cancel`](https://docs.kombo.dev/payroll/v1/post-one-time-deductions-cancel)

Cancel 1 to 1,000 deductions by `origin_id`. You can cancel a deduction that never got into a pay run: one that's still QUEUED, or one that FAILED. A cancelled deduction won't be written, gets the status CANCELLED, and stays in the list. Its `origin_id` is free again. Like when scheduling, each result has either `data` (the deduction, now cancelled) or an `error`.

> [accordion] Example request body
>
> ```json theme={null}
> { "origin_ids": ["inv-2026-11-emp-123", "inv-2026-11-emp-456"] }
> ```

Once a deduction is PENDING\_APPROVAL, PENDING, PROCESSED, or DECLINED, it's in the payroll tool and Kombo can't cancel it. That item comes back with an `error` with the code `PAYROLL.DEDUCTION_ALREADY_WRITTEN`. Ask your customer's HR team to remove it in the payroll tool.

> [!TIP]
>
> **Safe to retry.** Cancelling a deduction that's already cancelled returns it
> in `data` again, still CANCELLED.

> [!WARNING]
>
> **You can't cancel while a sync is writing a deduction.** The sync locks the
> deductions it's writing, so that item comes back with
> `PAYROLL.DEDUCTION_LOCKED`. List the deduction once the sync is done: if it&#x20;
> FAILED, you can cancel it then.

## Errors

Rejected items and failed deductions carry an `error` with a `code` to build your logic on. [Deduction errors](https://docs.kombo.dev/payroll/guides/deduction-errors.md) lists every code, when you see it, and what to do.

## Coming later: payslip checks

PROCESSED is the last status in the beta. Later, Kombo will
also check the amount on the employee's payslip. [Payslip
checks](https://docs.kombo.dev/payroll/guides/payslip-checks.md) shows how that will work.

> [card] [Schedule deductions](https://docs.kombo.dev/payroll/v1/post-one-time-deductions-schedule.md)
>
> The full endpoint reference with every field.

> [card] [Pay runs](https://docs.kombo.dev/payroll/v1/get-pay-runs.md)
>
> See the pay runs and their pay periods.

> [card] [Deduction errors](https://docs.kombo.dev/payroll/guides/deduction-errors.md)
>
> Every error code, when you see it, and what to do.


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