sprPayslipFiles

Prev Next

Represents a payslip file (PDF) generated for an employee for a registration month, including its creation status and, optionally, the file content.

Base URL

https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environmentName}/api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles

Supported operations

This is a read-only endpoint. POST, PATCH, and DELETE are not allowed.

Operation HTTP method Endpoint Description
List GET /sprPayslipFiles Returns a collection of payslip files.
Get GET /sprPayslipFiles({id}) Returns a single payslip file by its system ID.

Recommended usage: daily polling

To keep an external system (for example, an employee portal) in sync with payslip files, poll once a day for files that are new or changed since the previous poll, and include the file content in the same call:

GET /api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles?$orderby=lastModifiedDateTime asc&$filter=lastModifiedDateTime gt {lastPollDateTime} and paramIncludeFileContent eq 'true'
  1. On the first run, set {lastPollDateTime} to the date from which you want to load payslips (for example, 2026-01-31T23:59:59.000Z).
  2. Process every returned record:
    • status = Creation Completed and active = true — save or replace the employee's payslip for registrationMonth using fileContent.
    • active = false or status = Canceled — the file is no longer the current payslip; hide or remove it in your system.
    • status = Creation Pending or Creation Failed — skip. The record is returned again by a later poll when it changes.
  3. Save the lastModifiedDateTime of the last returned record and use it as {lastPollDateTime} in the next poll.

Because results are sorted by lastModifiedDateTime asc, you can resume from the last saved timestamp if a poll is interrupted.

Properties

Property Type Writable Description
id Guid No System-generated unique identifier (OData key).
entryNumber Integer No Sequential entry number of the payslip file.
employeeId Guid No System ID of the employee to whom the payslip belongs.
employeeNumber String No Number of the employee to whom the payslip belongs.
employeeFullName String No Full name of the employee.
employeeFirstName String No First name of the employee.
employeeMiddleName String No Middle name of the employee.
employeeSurname String No Surname of the employee.
registrationMonth Date No Registration month of the payslip.
active Boolean No true if this is the latest payslip file of the employee for the registration month. Creating the payslip again makes earlier files inactive.
fileName String No Name of the payslip file (always ends with .pdf).
passwordType String No How the payslip file is protected with a password: No Password, v.2 Azure, v.1 Payslip Password App (obsolete), or .PDF. See Remarks.
status String No Creation status of the payslip file: (blank), Creation Pending, Creation Completed, Creation Failed, or Canceled. See Remarks.
errorMessage String No Reason why the payslip file could not be created. Empty when creation succeeded.
fileContent String (Base64) No Base64-encoded content of the PDF file. Returned only when the request filters on paramIncludeFileContent eq 'true'; otherwise an empty string.
paramIncludeFileContent Boolean No Request parameter, not data. Use it in $filter to include fileContent in the response. The returned value carries no meaning.
createdDateTime DateTimeOffset No UTC timestamp when the record was created (system-managed).
lastModifiedDateTime DateTimeOffset No UTC timestamp of the last modification (system-managed).

Relationships / navigation properties

None.

Remarks

  • Read-only: Payslip files are created in Business Central from a payslip register. You can't create, update, cancel, or delete them through the API.

  • Including file content: By default fileContent is empty to keep responses small. To return the Base64-encoded PDF, add paramIncludeFileContent eq 'true' to $filter. Combine it with other conditions using and. Because the parameter is passed through $filter, a keyed GET (/sprPayslipFiles({id})) never returns file content — use $filter=id eq {id} and paramIncludeFileContent eq 'true' instead.

  • Limit result size with file content: Each PDF adds a large Base64 string to the response. Use $top and a selective $filter (for example, by employeeNumber or lastModifiedDateTime) when requesting file content.

  • Active file: An employee can have several payslip files for the same registrationMonth (for example, after the payslip is created again). Only the latest successfully created file has active = true. When the active file is cancelled or deleted, the previous Creation Completed file for the same employee and month becomes active again. To get the current payslip, filter on active eq true.

  • Status lifecycle:

    Status Meaning File content
    (blank) Not set. None.
    Creation Pending The file is queued for creation. None.
    Creation Completed The PDF was created successfully. Available.
    Creation Failed The PDF could not be created. The reason is in errorMessage. None.
    Canceled The file was cancelled by a user and is no longer active. Kept.
  • Password type:

    Value Meaning
    No Password The PDF is not password-protected.
    v.2 Azure Password protection through the v.2 Azure (.ZIP) service.
    v.1 Payslip Password App Obsolete. Replaced by v.2 Azure.
    .PDF The PDF file itself is password-protected.
  • Enum encoding: Enum values that contain spaces or special characters are XML-encoded in OData responses and filters (for example, Creation_x0020_Completed, No_x0020_Password).

  • Incremental synchronisation: See Recommended usage: daily polling.

Example requests

List all payslip files

GET /api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles

Response 200 OK:

{
    "value": [
        {
            "@odata.etag": "W/\"...\"",
            "id": "{id}",
            "entryNumber": 1,
            "employeeId": "{employeeId}",
            "employeeNumber": "D0001",
            "employeeFullName": "Jonas Jonaitis",
            "employeeFirstName": "Jonas",
            "employeeMiddleName": "",
            "employeeSurname": "Jonaitis",
            "registrationMonth": "2026-01-01",
            "active": true,
            "fileName": "D0001_2026-01.pdf",
            "passwordType": "No_x0020_Password",
            "status": "Creation_x0020_Completed",
            "errorMessage": "",
            "fileContent": "",
            "paramIncludeFileContent": false,
            "createdDateTime": "2026-02-02T08:15:42.120Z",
            "lastModifiedDateTime": "2026-02-02T08:15:44.870Z"
        }
    ]
}

List the three most recently modified payslip files

GET /api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles?$orderby=lastModifiedDateTime desc&$top=3

List payslip files modified after a date

GET /api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles?$orderby=lastModifiedDateTime asc&$filter=lastModifiedDateTime gt 2026-01-31T23:59:59.000Z

Daily polling: list payslip files modified after a date, including file content (recommended)

GET /api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles?$orderby=lastModifiedDateTime asc&$filter=lastModifiedDateTime gt 2026-01-31T23:59:59.000Z and paramIncludeFileContent eq 'true'

List payslip files for an employee, including file content

GET /api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles?$orderby=lastModifiedDateTime asc&$filter=employeeNumber eq '{employeeNumber}' and paramIncludeFileContent eq 'true'&$top=3

Response 200 OK:

{
    "value": [
        {
            "@odata.etag": "W/\"...\"",
            "id": "{id}",
            "entryNumber": 1,
            "employeeId": "{employeeId}",
            "employeeNumber": "D0001",
            "employeeFullName": "Jonas Jonaitis",
            "employeeFirstName": "Jonas",
            "employeeMiddleName": "",
            "employeeSurname": "Jonaitis",
            "registrationMonth": "2026-01-01",
            "active": true,
            "fileName": "D0001_2026-01.pdf",
            "passwordType": "No_x0020_Password",
            "status": "Creation_x0020_Completed",
            "errorMessage": "",
            "fileContent": "JVBERi0xLjQKJ...",
            "paramIncludeFileContent": false,
            "createdDateTime": "2026-02-02T08:15:42.120Z",
            "lastModifiedDateTime": "2026-02-02T08:15:44.870Z"
        }
    ]
}

Get a single payslip file

GET /api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles({id})

Response 200 OK:

{
    "@odata.etag": "W/\"...\"",
    "id": "{id}",
    "entryNumber": 2,
    "employeeId": "{employeeId}",
    "employeeNumber": "D0002",
    "employeeFullName": "Ona Onaitė",
    "employeeFirstName": "Ona",
    "employeeMiddleName": "",
    "employeeSurname": "Onaitė",
    "registrationMonth": "2026-01-01",
    "active": false,
    "fileName": "",
    "passwordType": "No_x0020_Password",
    "status": "Creation_x0020_Failed",
    "errorMessage": "No payslip data for registration month 2026-01.",
    "fileContent": "",
    "paramIncludeFileContent": false,
    "createdDateTime": "2026-02-02T08:15:42.120Z",
    "lastModifiedDateTime": "2026-02-02T08:15:45.010Z"
}

Get a single payslip file, including file content

GET /api/softera/softeraPayroll/v1.0/companies({companyId})/sprPayslipFiles?$filter=id eq {id} and paramIncludeFileContent eq 'true'

Response 200 OK — returns a collection with one payslip file, with fileContent populated.