# Payroll Templates

Group: Accounting

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

A payroll template maps an imported payroll file to the journal entry of a payroll detail, with a debit account and a credit account for each payroll category.

A template serves one or more legal entities, and each of its categories covers one kind of payroll amount, such as gross pay or net pay. Each payroll detail uses one template.

When a template is created or updated through these endpoints, its status is set to 'active' if it has an active netPay category and an active grossPay category, and to 'inactive' otherwise. No endpoint sets the status directly.

## Endpoints

- [List payroll templates](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/payrollTemplates.html): `GET /accounting/payroll-templates`
- [Create a payroll template](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/createPayrollTemplate.html): `POST /accounting/payroll-templates`
- [Search payroll templates](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/searchPayrollTemplate.html): `POST /accounting/payroll-templates/search`
- [Retrieve a payroll template](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/getPayrollTemplate.html): `GET /accounting/payroll-templates/{id}`
- [Update a payroll template](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/updatePayrollTemplate.html): `PATCH /accounting/payroll-templates/{id}`
- [Delete a payroll template](https://docs.api.lensing.ai/reference/lensing/v1/endpoints/deletePayrollTemplate.html): `DELETE /accounting/payroll-templates/{id}`
