Update Payroll Detail
PATCH /accounting/payroll-details/{id}
Group: Accounting › Payroll Details · Operation ID: updatePayrollDetail
Updates the payroll run with the given identifier. Only the fields in the request body change.
Only the fields in the request body change. entityId cannot be changed, so a payroll cannot change owner. lines and attachments are complete replacement sets, not verb arrays: sending lines replaces all of them, omitting it keeps the stored lines, and sending an empty array clears the set. Child ids are neither published nor preserved. The same guards as create apply to the result: the payroll must still balance, every category must still be reachable from the template, and the posting period must still be open for the resulting posting date. The response is empty. Read the record with GET accounting/payroll-details/:id.
Open in the interactive reference
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | "v1" |
yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
Idempotency-Key |
header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored. |
id |
path | string | yes | The unique identifier for the payroll run to update. |
Request body
Required, application/json: updatePayrollDetailInput.
| Field | Type | Required | Description |
|---|---|---|---|
templateId |
string | no | The payroll template this run uses. See id on GET accounting/payroll-templates/:id. Omit to leave unchanged. |
grouping |
string | no | How the payroll is grouped. Values include 'Employee', 'Department' and 'Multi-level'. Omit to leave unchanged. |
status |
string | no | The status of the payroll. Omit to leave unchanged. |
payrollDate |
string (date) | no | The issue date of the payroll. Use format YYYY-MM-DD. Omit to leave unchanged. |
startDate |
string (date) | no | The first day of the payroll period. Use format YYYY-MM-DD. Omit to leave unchanged. |
endDate |
string (date) | no | The last day of the payroll period. Use format YYYY-MM-DD. Omit to leave unchanged. |
currency |
string | no | The currency the payroll is denominated in. Format ISO 4217, for example 'USD'. Omit to leave unchanged. |
description |
string | no | A description of the payroll. Omit to leave unchanged. |
isNetPayCategoryMapped |
boolean | no | Whether the net-pay category is matched in the account mapping. Omit to leave unchanged. |
origin |
string | no | The source system this record came from, as free-form text, for example 'Ramp'. Omit it and it stays unset. The server does not set a value. |
lines |
array of object | no | The complete replacement set of lines. Omit to keep the stored lines. Send an empty array to clear them. Child ids are neither published nor preserved. |
lines[].employeeId |
string | no | The employee this line is for. There is no endpoint for it. With grouping 'Employee', a line that names an employee but no department has the department backfilled from that employee's primary job. |
lines[].departmentId |
string | no | The department this line is charged to. See id on GET departments/:id. |
lines[].lineItems |
array of object | yes | The amounts on this line, one per payroll category. Each category must be reachable from the payroll's template. An item whose amount is null is dropped before the payroll is saved. |
lines[].lineItems[].categoryId |
string | yes | The payroll category this amount belongs to. There is no endpoint for it. It must be an active category of the payroll's template, or one the payroll already uses. |
lines[].lineItems[].amount |
string (decimal) | yes | The amount for this category, as a decimal in the payroll's currency. |
attachments |
array of object | no | Files to attach to the payroll, as a complete replacement set. Omit to keep the stored attachments. Send an empty array to clear them. |
attachments[].fileName |
string | yes | The display name of the attached file. |
attachments[].fileId |
string | yes | The identifier of the uploaded file in file storage, as a text reference. There is no endpoint for it. |
Example:
{
"templateId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"grouping": "<grouping>",
"status": "<status>",
"payrollDate": "2026-01-15",
"startDate": "2026-01-15",
"endDate": "2026-01-15",
"currency": "<currency>",
"description": "August 2026 payroll (revised)",
"isNetPayCategoryMapped": true,
"origin": "<origin>",
"lines": [
{
"employeeId": "3f1a8c25-9d47-4e60-b892-0c5a7e3b1d84",
"lineItems": [
{
"categoryId": "9b2d5e10-4c78-4a36-8f51-6e0a3c7b2d95",
"amount": "5200.00"
},
{
"categoryId": "e5c7a390-1d64-4b28-9a07-2f8b6d4c1e53",
"amount": "5200.00"
}
]
}
],
"attachments": [
{
"fileName": "<fileName>",
"fileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
}
Response
200 Success
Response headers
Idempotency-Replayed— Present andtrueonly when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent asfalse.
Errors
| Code | Status |
|---|---|
NOT_FOUND |
400 |
REFERENCE_NOT_FOUND |
400 |
CATEGORY_NOT_IN_TEMPLATE |
400 |
INVALID_DATE_RANGE |
400 |
AMOUNT_NOT_BALANCED |
400 |
NO_ACCOUNTING_BOOK |
400 |
NO_ACCOUNTING_PERIOD |
400 |
POSTING_PERIOD_CLOSED |
400 |
TOO_MANY_LINES |
400 |
ATTACHMENT_REQUIRED |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: NOT_FOUND, REFERENCE_NOT_FOUND, CATEGORY_NOT_IN_TEMPLATE, INVALID_DATE_RANGE, AMOUNT_NOT_BALANCED, NO_ACCOUNTING_BOOK, NO_ACCOUNTING_PERIOD, POSTING_PERIOD_CLOSED, TOO_MANY_LINES, ATTACHMENT_REQUIRED401— Missing or invalid access token403— Not authorized404— Not found409— The Idempotency-Key is still being processed by another request.422— The Idempotency-Key was already used with a different request payload.429— Too many requests500— Internal server error