# Retrieve a payroll template

Operation ID: `getPayrollTemplate`

Group: Accounting › Payroll Templates

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

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

Read-only: Reads and returns; changes nothing.

Retrieves a payroll template. A payroll template sets how a payroll detail becomes a journal entry, including the debit and credit account for each payroll category. The response includes the categories, which GET accounting/payroll-templates doesn't return. To find a template by name, use POST accounting/payroll-templates/search.

## 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 template you want to retrieve. Example: `"f6a1c0d2-7b45-4e39-8c1a-90de2b47f513"`. |

## Response

`200` Success

Under `data` (getPayrollTemplateOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the payroll template. |
| `name` | string | yes | The name of the payroll template. Unique across payroll templates. |
| `description` | string | no | A free-form description of the payroll template. |
| `groupBy` | string | yes | The level at which payroll amounts are entered. Possible values: 'Employee', 'Department', 'Multi-level'. |
| `journalEntryDate` | string | yes | The date the generated journal entry is posted on. Possible values: 'payrollDate', 'endDate'. |
| `journalEntryGroupBy` | string | yes | The default consolidation level for generated journal lines. Possible values: 'account', 'accountAndPayrollCategory', 'payrollCategory', 'payrollCategoryByEmployee'. |
| `deductionsType` | string | yes | Whether deduction amounts in imported data arrive positive or negative. Possible values: 'positive', 'negative'. |
| `source` | string | no | The payroll system this template imports from. Possible values: 'datev', 'datevEmployeePayroll', 'datevEmployeePayrollPersonLevel', 'rippling', 'lexware', 'briars', 'gusto', 'adpGLReport', 'adpPayrollHistory', 'sage', 'none'. |
| `status` | string | no | The lifecycle status of the payroll template. Possible values: 'create', 'active', 'inactive'. It is computed from the template's categories, not set through the API. |
| `clearingAccountId` | string | no | The general ledger account payroll amounts are cleared through. See id on GET accounting/accounts/:id. |
| `entities` | array<string> | yes | The names of the legal entities this template is mapped to. An empty array when it is mapped to none. |
| `lastModifiedDate` | date-time | yes | The date and time the payroll template last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `categories` | array<object> | no | The payroll categories defined on this template, each mapping one payroll line type onto a debit and a credit account. An empty array when the template has none. |
| `categories[].id` | string | yes | The unique identifier for the payroll category. |
| `categories[].name` | string | yes | The name of the category, for example 'Gross Salary'. Unique within the template. |
| `categories[].subType` | string | yes | The kind of payroll amount this category represents. Possible values: 'grossPay', 'deduction', 'netPay', 'employer'. |
| `categories[].status` | string | no | The lifecycle status of the category. Possible values: 'active', 'inactive'. |
| `categories[].payee` | string | no | Who the amount is paid to, as a payee code from your tenant's configured payee list, for example 'employee', 'payrollProvider', 'benefitsProvider' or 'taxOffice'. |
| `categories[].isManagedFromPayroll` | boolean | no | Whether payments for this category are recorded through payroll rather than separately. |
| `categories[].debitAccountId` | string | no | The general ledger account this category debits. See id on GET accounting/accounts/:id. |
| `categories[].debitJournalAggregation` | string | no | The consolidation level for journal lines posted to the debit account. Absent means the template default applies. |
| `categories[].creditAccountId` | string | no | The general ledger account this category credits. See id on GET accounting/accounts/:id. |
| `categories[].creditJournalAggregation` | string | no | The consolidation level for journal lines posted to the credit account. Absent means the template default applies. |
| `categories[].debitTags` | array<object> | no | Tags stamped on every journal line this category debits, one per dimension. Absent when none. |
| `categories[].debitTags[].dimension` | string | yes | The tag dimension, e.g. 'vendor'. |
| `categories[].debitTags[].id` | string | yes | The tagged record. For 'vendor', see id on GET accounting/vendors/:id. |
| `categories[].creditTags` | array<object> | no | Tags stamped on every journal line this category credits, one per dimension. Absent when none. |
| `categories[].creditTags[].dimension` | string | yes | The tag dimension, e.g. 'vendor'. |
| `categories[].creditTags[].id` | string | yes | The tagged record. For 'vendor', see id on GET accounting/vendors/:id. |

```json
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "<name>",
    "description": "<description>",
    "groupBy": "<groupBy>",
    "journalEntryDate": "<journalEntryDate>",
    "journalEntryGroupBy": "<journalEntryGroupBy>",
    "deductionsType": "<deductionsType>",
    "source": "<source>",
    "status": "<status>",
    "clearingAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entities": [
      "<entities>"
    ],
    "lastModifiedDate": "2026-01-15T09:30:00.000Z",
    "categories": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "<name>",
        "subType": "<subType>",
        "status": "<status>",
        "payee": "<payee>",
        "isManagedFromPayroll": true,
        "debitAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "debitJournalAggregation": "<debitJournalAggregation>",
        "creditAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "creditJournalAggregation": "<creditJournalAggregation>",
        "debitTags": [
          {
            "dimension": "<dimension>",
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
          }
        ],
        "creditTags": [
          {
            "dimension": "<dimension>",
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
          }
        ]
      }
    ]
  },
  "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
