# Retrieve a payroll detail

Operation ID: `getPayrollDetail`

Group: Accounting › Payroll Details

[Open in the interactive reference](https://docs.api.lensing.ai/lensing/v1/endpoints/getPayrollDetail)

`GET /accounting/payroll-details/{id}`

Read-only: Reads and returns; changes nothing.

Retrieves a payroll detail. Use the payroll detail's id, not its payrollDetailNumber.

A payroll detail is a set of payroll lines, one per employee or department, recorded in a journal entry for one legal entity. The response includes the lines, which GET accounting/payroll-details doesn't return.

POST accounting/payroll-details/search returns the same record for each match.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · 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`. |
| `id` | path | string | yes | The unique identifier of the payroll detail you want to retrieve. Example: `"3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45"`. |

## Response

`200` Success

Under `data` (getPayrollDetailOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the payroll run. |
| `payrollDetailNumber` | string | no | The payroll run number. Absent until a number has been assigned. |
| `description` | string | no | A description of the payroll run. |
| `periodName` | string | no | The name of the payroll period this run covers, for example '2026-08'. |
| `payrollDate` | date | yes | The date the payroll is dated. Format YYYY-MM-DD. |
| `startDate` | date | no | The first day of the period the run covers. Format YYYY-MM-DD. |
| `endDate` | date | no | The last day of the period the run covers. Format YYYY-MM-DD. |
| `currency` | string | yes | The currency the run is denominated in. Format ISO 4217, for example 'USD'. Governs openAmount and every line amount. |
| `grouping` | string | no | How the payroll run is grouped. Values include 'Employee', 'Department' and 'Multi-level'. |
| `paymentStatus` | string | no | The payment status of the run. Values include 'unpaid', 'partiallyPaid', 'fullyPaid', 'pending', 'notApplicable' and 'voided'. |
| `openAmount` | decimal | no | The amount still unpaid on this run, in currency. |
| `isImported` | boolean | no | Whether the run was imported from a payroll provider rather than entered by hand. |
| `entityId` | string | no | The legal entity the run belongs to. See id on GET base/entities. |
| `entityName` | string | no | The name of the legal entity the run belongs to. |
| `templateId` | string | no | The payroll template this run was created from. See id on GET accounting/payroll-templates/:id. |
| `lastModifiedDate` | date-time | yes | The date and time the payroll run last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `origin` | string | no | The source system this record came from, as free-form text. Absent when none was supplied. |
| `lines` | array<object> | no | The payroll lines, one per employee or department depending on grouping. An empty array when the run has none. |
| `lines[].id` | string | yes | The unique identifier for the line. |
| `lines[].lineNumber` | string | no | The line number. |
| `lines[].lineLevel` | string | no | The level this line sits at. |
| `lines[].employeeName` | string | no | The name of the employee this line pays. |
| `lines[].unmatchedEmployeeName` | string | no | The employee name as it arrived from the payroll provider when it matched no employee on file. |
| `lines[].departmentName` | string | no | The name of the department this line is charged to. |
| `lines[].departmentCode` | string | no | The code of that department. |
| `lines[].departmentNumber` | string | no | The number of that department. |
| `lines[].totalAmount` | decimal | no | The total amount on the line, in the run currency. |
| `lines[].totalGrossAmount` | decimal | no | The gross pay on the line, in the run currency. |
| `lines[].totalNetAmount` | decimal | no | The net pay on the line, in the run currency. |
| `lines[].totalEmployerAmount` | decimal | no | The employer-side contributions on the line, in the run currency. |
| `lines[].errorMessage` | string | no | Why this line could not be processed, when it failed. |

```json
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "payrollDetailNumber": "<payrollDetailNumber>",
    "description": "<description>",
    "periodName": "<periodName>",
    "payrollDate": "2026-01-15",
    "startDate": "2026-01-15",
    "endDate": "2026-01-15",
    "currency": "<currency>",
    "grouping": "<grouping>",
    "paymentStatus": "<paymentStatus>",
    "openAmount": "19.99",
    "isImported": true,
    "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityName": "<entityName>",
    "templateId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "lastModifiedDate": "2026-01-15T09:30:00.000Z",
    "origin": "<origin>",
    "lines": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "lineNumber": "<lineNumber>",
        "lineLevel": "<lineLevel>",
        "employeeName": "<employeeName>",
        "unmatchedEmployeeName": "<unmatchedEmployeeName>",
        "departmentName": "<departmentName>",
        "departmentCode": "<departmentCode>",
        "departmentNumber": "<departmentNumber>",
        "totalAmount": "19.99",
        "totalGrossAmount": "19.99",
        "totalNetAmount": "19.99",
        "totalEmployerAmount": "19.99",
        "errorMessage": "<errorMessage>"
      }
    ]
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Errors

| Code | Status |
| --- | --- |
| `NOT_FOUND` | 400 |

## Statuses

- `400` — Invalid request or business failure. Codes: NOT_FOUND
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
