Skip to content
English
  • There are no suggestions because the search field is empty.

Import Timesheet Hours to brioHR Payroll via API Integration

This article explains how to set up the Timesheet Import API, which lets your own system push approved timesheet hours directly into brioHR Payroll (Malaysia and Singapore).

Audience & Scope

Audience: HR Admin / Payroll Officer / IT Admin

Module: Payroll

Country: Malaysia (MY) and Singapore (SG)

Pre-requisites: HR Module permission for the Payroll Module.

 Note: For a comprehensive overview of the BrioHR API integration flow, please refer to the article here, and click here for how timesheets are sent to payroll from the Time Attendance module.

IMPORTANT:

To enable this integration, you will need to contact our support team via email or live chat so we can provide the necessary access. Please contact us via:

Note: If you are still in the implementation stage, please reach out to your implementation manager for support.

Prerequisites & Setup

Before issuing API requests, ensure the following prerequisites are completed:

  1. IP Whitelisting: The client system's outbound IP address must be whitelisted by brioHR (unless the integration has no IP restriction).
  2. API Credentials: Request username, password and company ID from brioHR. These are provided during the UAT phase.
  3. Integration Enabled: brioHR has enabled Timesheets import for your company. This also connects the timesheet-to-payroll integration on your MY and SG Payroll Centers.

 

Overview & Operational Behavior

The Timesheet Import API enables external systems (for example, an ERP such as SAP) to push pre-approved timesheet hours directly into brioHR Payroll's Validate Payroll Items > Timesheet > To process queue. Each record is one employee for one period, with one entry per worked day in hours. Once accepted, it behaves exactly like a timesheet sent from brioHR Time Attendance.

  • Bypasses Approval Workflow: Timesheets must already be approved in the source system. brioHR does not trigger an in-app approval; timesheets land directly in the Payroll queue.
  • Cycle Independence: No payroll cycle needs to be open when you push. The timesheet is parked until a Payroll Officer processes it.
  • Payroll Center Routing: The Payroll Center is taken from the employee's profile. You do not send it in the request.
  • One Row per Push: Each accepted timesheet creates its own row, labelled Sent via API under the employee's name.
  • Pay Calculation: Overtime is priced on the payslip using the Payroll Center's existing overtime settings. Regular hours drive pay for hourly-rate and daily-rate employees, and are for information only for salaried employees.

API-pushed timesheets appear when you run payroll in Validate Payroll Items > Timesheet > To process with a Sent via API label:

Timesheets to Payroll To process tab showing rows labelled Sent via API

Click See history on a row to view the source (API), the time it was received and your externalTimesheetId:

Timesheet History showing Source API, Received at and External timesheet ID

 

API Specification & Request Headers

  • Endpoint URL: https://static.api.briohr.com/v2/api/external/payroll-timesheets/import
  • HTTP Method: POST
  • Content-Type: application/json
Header Type Value/Description
Authorization String Basic <base64_encode(username:password)>
x-api-context-company String <company id> (Target brioHR Company ID)
x-resource-type String Must strictly equal timesheet-import
Content-Type String application/json

Security Guardrail: The x-resource-type header is route-pinned. Passing any other resource module (e.g. claim-import or timelogs), even if it is assigned to the API key, returns 403 Forbidden.

 

Request Payload Schema

Each request should contain a timesheets array with 1 to 100 timesheet objects per batch. Unknown extra fields are automatically stripped and ignored (HTTP 201).

Schema Tree

timesheets [] (Array, Required, 1–100 elements)
├── externalTimesheetId (String, Required) - Unique timesheet ID / Idempotency key
├── employeeEmail (String, Required) - Employee's email in brioHR
├── startDate (String, Required) - YYYY-MM-DD
├── endDate (String, Required) - YYYY-MM-DD, max 31 days from startDate
└── workHoursSummary [] (Array, Required, 1–31 elements)
    ├── date (String, Required) - YYYY-MM-DD, within the period
    ├── regularHours (Number, Required) - min 0, max 2 decimals
    ├── overtimeHours (Number, Required) - min 0, max 2 decimals
    ├── overtimeType (String, Optional) - NORMAL | REST | OFF | PH | PH_REST | PH_OFF
    └── overtimePeriodType (String, Optional) - daily | monthly

Field Rules & Data Types

Field Data Type Constraint/Validation Rule
timesheets Array Must contain between 1 and 100 elements.
externalTimesheetId String Required, non-empty. Must be unique per company. Serves as the idempotency key.
employeeEmail String Required. Matching ignores letter case and surrounding spaces. Former employees also match; if a former and an active employee share the email, the active one is used.
startDate String Required ISO 8601 date (YYYY-MM-DD) that exists on the calendar (e.g. 2026-02-30 is rejected). Normally the payroll cycle's start date.
endDate String Required ISO 8601 date. Not before startDate, and the period must be at most 31 days, counting both ends.
workHoursSummary Array One entry per worked day. Must contain between 1 and 31 elements.
workHoursSummary[].date String Required ISO 8601 date. Must fall between startDate and endDate and appear only once per timesheet.
workHoursSummary[].regularHours Number Required. Minimum 0, up to 2 decimal places (e.g. 7.5 = 7 hours 30 minutes).
workHoursSummary[].overtimeHours Number Required. Minimum 0, up to 2 decimal places (e.g. 1.25 = 1 hour 15 minutes).
workHoursSummary[].overtimeType String Optional. One of NORMAL, REST, OFF, PH, PH_REST, PH_OFF. Defaults to NORMAL.
workHoursSummary[].overtimePeriodType String Optional. daily or monthly. weekly is rejected.

 

Payload Example:

JSON
{
  "timesheets": [
    {
      "externalTimesheetId": "SAP-TS-2026-07-000123",
      "employeeEmail": "employee@company.com",
      "startDate": "2026-06-21",
      "endDate": "2026-07-20",
      "workHoursSummary": [
        {
          "date": "2026-06-22",
          "regularHours": 8,
          "overtimeHours": 0
        },
        {
          "date": "2026-06-23",
          "regularHours": 8,
          "overtimeHours": 1.25,
          "overtimeType": "NORMAL",
          "overtimePeriodType": "daily"
        },
        {
          "date": "2026-06-28",
          "regularHours": 0,
          "overtimeHours": 2,
          "overtimeType": "REST",
          "overtimePeriodType": "daily"
        }
      ]
    }
  ]
}

 

Overtime Type Mapping Rules

Daily overtime is grouped by overtimeType and priced by the employee's Payroll Center overtime settings, the same way as a Time Attendance timesheet.

overtimeType Paid as
NORMAL Overtime on a normal work day - paid out as Overtime (Normal Day)
REST Overtime on a rest day - paid out as Overtime (Rest-Day)
OFF Overtime on an off day - paid out as Overtime (Off Day)
PH Overtime on a public holiday that falls on a work day - paid out as Overtime (Public Holiday)
PH_REST Overtime on a public holiday that falls on a rest day - paid out as Overtime (Rest-Day)
PH_OFF Overtime on a public holiday that falls on an off day - paid out as Overtime (Public Holiday)
  1. Default Type: When overtimeType is not sent, NORMAL is used.
  2. Monthly Overtime: When overtimePeriodType is monthly, the hours count toward the month's overtime total and overtimeType is not used.
  3. Decimal Hours: Hours are shown as sent, e.g. 1.25 appears as 1.25 hour(s).

 

The API only sends the hours and the day type. The amount paid is calculated by brioHR Payroll using the employee's Payroll Center settings.

The Payroll Officer can expand Items on a row to check the total work hours and each overtime line before adding it to payroll:

Items breakdown showing total work hours, Overtime (Normal Day) and Overtime (Rest-Day)

Once added to payroll, each overtime type appears as its own line in the employee's payroll run:

Run Payroll showing an Overtime (Normal Day) line with hours and amount

Learn more: How to Calculate Overtime Pay and Payroll Malaysia: Complete Guide to Setting Up Company Payroll Information (Section 4: Calculation). For Singapore, overtime is calculated using the SG Payroll Center's own overtime settings.

 

Idempotency & Batch Atomicity Rules

Idempotency Matrix

Condition HTTP Status Response Status / Code System Behavior
New timesheet ID 201 Created status: parked Timesheet is parked in Validate Payroll Items > Timesheet > To process queue.
Same ID, same payload 201 Created status: already-parked Safe retry. Nothing is re-sent to Payroll. Key order and formatting in the JSON do not matter.
Same ID, different payload 400 Bad Request TIMESHEET_IMPORT_API.CONFLICT Rejected. Use a new ID for a corrected timesheet.
Duplicate ID in the same request 400 Bad Request TIMESHEET_IMPORT_API.DUPLICATE_TIMESHEET_ID_IN_BATCH Whole request is rejected before anything is imported.

 

Batch Atomicity & Upstream Error Handling

Scenario HTTP Status Behavior & Recovery Strategy
Batch atomicity (validation / business error) 400 Bad Request All-or-nothing. If any timesheet in the batch fails validation, the whole batch is rejected and nothing is parked. Fix the reported timesheets and resend the batch. IDs already imported come back as already-parked.
Rejected by Payroll (e.g. overlapping period) in a batch covering several Payroll Centers 400 Bad Request Payroll checks each Payroll Center's timesheets as one group, in turn. Groups handed over before the rejected one stay parked. Fix the rejected timesheet and resend the same batch: parked ones return already-parked and only the rest are retried.
Upstream / server failure (timeout, service unavailable) 5xx The request was fine. Resend the batch unchanged later; it is always safe. A 5xx is never returned for a payload problem, and a 400 is never returned for a server problem.

 

Critical Operational Behaviors & Potential Blockers

Blocker 1: Excluded Timesheets Cannot Be Re-Pushed Under the Same ID

When a Payroll Officer clicks Exclude on an API-sent timesheet, it is permanently removed from payroll processing. Hovering over the Excluded status shows that it cannot be sent back to payroll.

Excluded tab with tooltip: this timesheet was sent via API and cannot be sent back to payroll once excluded

  • Behavior: Subsequent API pushes using the same externalTimesheetId will return already-parked and will not recreate the timesheet.
  • Workaround: To resubmit an excluded timesheet, the third-party system must assign a new externalTimesheetId.

Blocker 2: Queue Visibility Requirements

Timesheets parked via the API only appear under Validate Payroll Items > Timesheet if an active payroll cycle exists that includes the employee. If the API returns parked but the timesheet is not visible, click Edit cycle and check that the employee is selected in the cycle.

Run Payroll Validate payroll items with the Timesheets tab and Edit cycle highlighted

Blocker 3: Skip vs. Exclude UI Actions

  • Skip: Defers the timesheet and moves it to the Skipped tab (with an Undo option), so it can be included in a future cycle.

Skipped timesheet with the undo icon

  • Exclude: Permanently excludes the timesheet and displays: "This timesheet was sent via API and cannot be sent back to payroll once excluded. Ask the sender to send the corrected timesheet with a new ID."

Blocker 4: Correcting a Timesheet That Is Already Parked

A timesheet cannot share any day with another timesheet of the same employee that is already in Payroll (unless that one was excluded). Sending a corrected version for the same period is rejected with TRANSFER_TIMESHEET.OVERLAPPING_TIMESHEETS.

  • Workaround: Ask the Payroll Officer to Exclude the old row first, then send the corrected timesheet with a new externalTimesheetId. After the exclusion, the corrected timesheet parks as a new row.

Blocker 5: Regular Hours for Salaried Employees

Regular hours are accepted for every employee, but they only drive pay for hourly-rate and daily-rate employees. For salaried employees, base pay is unchanged by total work hours; only the overtime lines affect the payslip.

 

Error Code & Troubleshooting Reference

All business rule failures return HTTP 400 Bad Request with per-timesheet details in metadata.errors. resourceId echoes your externalTimesheetId.

Error Code HTTP Status Cause Resolution
TIMESHEET_IMPORT_API.EMPLOYEE_NOT_FOUND 400 No employee in this company has that email. This includes employees who belong to another company, because data is always scoped to the authenticated company. Verify the email matches the employee's email in brioHR.
TIMESHEET_IMPORT_API.EMPLOYEE_AMBIGUOUS 400 More than one employee shares that email and brioHR cannot pick exactly one active employee. Make sure only one active employee uses that email.
TIMESHEET_IMPORT_API.NO_PAYROLL_CENTER 400 The employee is not assigned to any Payroll Center. Assign the employee to a Payroll Center.
TIMESHEET_IMPORT_API.UNSUPPORTED_COUNTRY 400 The employee's Payroll Center is not MY or SG. Only MY and SG Payroll Centers are supported.
TIMESHEET_IMPORT_API.INTEGRATION_NOT_CONNECTED 400 The timesheet-to-payroll integration is not enabled for that Payroll Center. Contact brioHR support.
TIMESHEET_IMPORT_API.INVALID_DATE_RANGE 400 endDate is before startDate, or the period is longer than 31 days. Correct the period dates.
TIMESHEET_IMPORT_API.DAY_OUTSIDE_PERIOD 400 A work day falls before startDate or after endDate. Keep every work day inside the period.
TIMESHEET_IMPORT_API.DUPLICATE_DAY 400 The same date appears twice in one timesheet. Check each date is recorded correctly. A date can only appear once per timesheet.
TIMESHEET_IMPORT_API.CONFLICT 400 That externalTimesheetId was already imported with a different payload. Use a new ID for a corrected timesheet.
TIMESHEET_IMPORT_API.DUPLICATE_TIMESHEET_ID_IN_BATCH 400 The same externalTimesheetId appears twice in one request. Remove the duplicate and resend.
TRANSFER_TIMESHEET.OVERLAPPING_TIMESHEETS 400 The employee already has a timesheet in Payroll that shares at least one day with this one, or two timesheets in the batch overlap. See Blocker 4: exclude the old row, then resend with a new ID.

 

Authentication Errors

Issue HTTP Status Message
Missing or invalid credentials 403 Forbidden
Missing x-api-context-company header 400 x-api-context-company header required
Missing x-resource-type header 400 x-resource-type header required
x-resource-type is not timesheet-import 403 x-resource-type must be "timesheet-import" for this endpoint
Timesheets import not granted to the API key 403 Forbidden
API key does not belong to the company in x-api-context-company 403 Forbidden
Employee email belongs to a different company than the API key 400 TIMESHEET_IMPORT_API.EMPLOYEE_NOT_FOUND (data is always scoped to the authenticated company)

 

 

Code Examples & Response Payloads

Sample cURL Request

Bash
curl --location 'https://static.api.briohr.com/v2/api/external/payroll-timesheets/import' \
--header 'Authorization: Basic <base64 of username:password>' \
--header 'x-api-context-company: <company id>' \
--header 'x-resource-type: timesheet-import' \
--header 'Content-Type: application/json' \
--data '{
  "timesheets": [
    {
      "externalTimesheetId": "SAP-TS-2026-07-000123",
      "employeeEmail": "employee@company.com",
      "startDate": "2026-06-21",
      "endDate": "2026-07-20",
      "workHoursSummary": [
        {
          "date": "2026-06-22",
          "regularHours": 8,
          "overtimeHours": 0
        },
        {
          "date": "2026-06-23",
          "regularHours": 8,
          "overtimeHours": 1.25,
          "overtimeType": "NORMAL",
          "overtimePeriodType": "daily"
        },
        {
          "date": "2026-06-28",
          "regularHours": 0,
          "overtimeHours": 2,
          "overtimeType": "REST",
          "overtimePeriodType": "daily"
        }
      ]
    }
  ]
}'

Success (HTTP 201)

One entry per timesheet submitted, in the order received.

JSON
[
  {
    "externalTimesheetId": "SAP-TS-2026-07-000123",
    "status": "parked"
  },
  {
    "externalTimesheetId": "SAP-TS-2026-07-000124",
    "status": "parked"
  }
]

Schema Validation Error (HTTP 400)

Every invalid field is listed in metadata. Field paths start counting from 0.

JSON
{
  "id": "7cee81c9-4b0b-42c8-a7c8-8d7d0f70cee8",
  "code": null,
  "type": "unhandled",
  "message": "Bad Request Exception",
  "metadata": [
    "timesheets.0.workHoursSummary.0.regularHours must not be less than 0"
  ],
  "isBrioError": true
}

Business Rule Error (HTTP 400)

The whole batch is rejected and nothing is parked.

JSON
{
  "id": "00557735-421f-4279-9fca-316741472bc5",
  "code": "U",
  "type": "user",
  "message": "",
  "metadata": {
    "errors": [
      {
        "resourceId": "SAP-TS-2026-07-000124",
        "resourceType": "timesheet",
        "error": [
          {
            "code": "TIMESHEET_IMPORT_API.EMPLOYEE_NOT_FOUND",
            "variables": {
              "metadata": {
                "value": {
                  "email": "nobody@company.com"
                },
                "type": "object"
              }
            }
          }
        ]
      }
    ],
    "isSilent": true
  },
  "isBrioError": true
}

Rejected by Payroll (HTTP 400)

Most commonly an overlap with a timesheet already in Payroll for the same employee.

JSON
{
  "id": "452fbc16-dc27-4e66-af9b-d79831f21ae8",
  "code": "U",
  "type": "user",
  "message": "",
  "metadata": {
    "errors": [
      {
        "code": "TRANSFER_TIMESHEET.OVERLAPPING_TIMESHEETS",
        "variables": {
          "employeeId": {
            "value": "6298279d7bb1b3000903ff42",
            "type": "string"
          },
          "startDate": {
            "value": "2023-11-21T00:00:00.000Z",
            "type": "date"
          },
          "endDate": {
            "value": "2023-12-20T00:00:00.000Z",
            "type": "date"
          }
        }
      }
    ],
    "isSilent": true
  },
  "isBrioError": true
}

LIMITATION:

  • MY and SG Payroll Centers only.
  • Maximum 100 timesheets per request, and a maximum period of 31 days per timesheet.
  • Weekly overtime (overtimePeriodType: weekly) is not supported.
  • Shift premiums, allowances, deductions and custom overtime payroll items are not yet supported.

 

Common Issues/FAQ

Q1: What should I do if an imported timesheet was excluded by mistake in brioHR Payroll?

A1: Once a Payroll Officer excludes an API-sent timesheet, it cannot be moved back to payroll. Re-pushing the same externalTimesheetId returns already-parked. Resend it with a new externalTimesheetId (see Blocker 1).

Q2: The API returned HTTP 201 status: parked, but the timesheet is not visible in the Validate Payroll Items > Timesheet > To process queue. Why?

A2: Pushed timesheets only appear in the queue for a payroll cycle that covers the employee. Check Edit cycle and make sure the employee is selected (see Blocker 2).

Q3: How do I correct hours for a timesheet that has already been sent?

A3: Ask the Payroll Officer to exclude the old row, then send the corrected timesheet with a new externalTimesheetId. Until the old row is excluded, the correction is rejected with OVERLAPPING_TIMESHEETS (see Blocker 4).

Q4: Is it safe to resend a request if I'm not sure it went through?

A4: Yes. Resending an identical timesheet returns already-parked and no duplicate row is created. After a 5xx error, resend the batch unchanged.

Q5: Why didn't regular hours change a salaried employee's pay?

A5: Regular hours only drive pay for hourly-rate and daily-rate employees. For salaried employees, only overtime lines affect the payslip (see Blocker 5).

 

Related Articles

 

Ownership

By: Aqilah