# Get Employee Payroll

> **HRIS API** · `GET /hris/payrolls/employees/{employee_id}/payrolls/{payroll_id}`
> Canonical URL: https://developers.apideck.com/apis/hris/reference#tag/Employee-Payrolls/operation/employeePayrollsOne
> MCP tool: `hris-employee-payrolls-one`

## Authentication

- Send `Authorization: Bearer $API_KEY` using your Apideck secret API key. Keep the key server-side; never put it in a URL or client-side code.

Use the application, consumer and connector headers listed in Parameters below for this operation.

Get payroll for employee

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `payroll_id` | path | `string` | Yes | ID of the payroll you are acting upon. |
| `employee_id` | path | `string` | Yes | ID of the employee you are acting upon. |
| `raw` | query | `boolean` | No | Include raw response. Mostly used for debugging purposes |
| `x-apideck-consumer-id` | header | `string` | Yes | ID of the consumer which you want to get or push data from |
| `x-apideck-app-id` | header | `string` | Yes | The ID of your Unify application |
| `x-apideck-service-id` | header | `string` | No | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. |
| `fields` | query | `string` | No | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |

### Responses

#### 200 — Payrolls

- `status_code` `integer` **required** — HTTP Response Status Code — example: `200`
- `status` `string` **required** — HTTP Response Status — example: `OK`
- `service` `string` **required** — Apideck ID of service provider — example: `undefined`
- `resource` `string` **required** — Unified API resource name — example: `Companies`
- `operation` `string` **required** — Operation performed — example: `one`
- `data` `object` **required**
  - `id` `string` **required** — A unique identifier for an object. — example: `12345`
  - `employee_id` `string` — ID of the employee — example: `12345`
  - `company_id` `string` — The unique identifier of the company. — example: `23456`
  - `processed` `boolean` **required** — Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. — example: `false`
  - `processed_date` `string` — The date the payroll was processed. — example: `2022-04-08`
  - `check_date` `string` **required** — The date on which employees will be paid for the payroll. — example: `2022-04-08`
  - `start_date` `string` **required** — The start date, inclusive, of the pay period. — example: `2022-04-08`
  - `end_date` `string` **required** — The end date, inclusive, of the pay period. — example: `2022-04-21`
  - `totals` `object` — The overview of the payroll totals.
    - `company_debit` `number` — The total company debit for the payroll. — example: `27992.49`
    - `tax_debit` `number` — The total tax debit for the payroll. — example: `8655.32`
    - `check_amount` `number` — The total check amount for the payroll. — example: `27966.23`
    - `net_pay` `number` — The net pay amount for the payroll. — example: `19337.17`
    - `gross_pay` `number` — The gross pay amount for the payroll. — example: `27966.23`
    - `employer_taxes` `number` — The total amount of employer paid taxes for the payroll. — example: `2038.93`
    - `employee_taxes` `number` — The total amount of employee paid taxes for the payroll. — example: `6616.39`
    - `employer_benefit_contributions` `number` — The total amount of company contributed benefits for the payroll. — example: `0`
    - `employee_benefit_deductions` `number` — The total amount of employee deducted benefits for the payroll. — example: `0`
  - `compensations` `array of object` — An array of compensations for the payroll.
    - `employee_id` `string` **required** — A unique identifier for an object. — example: `12345`
    - `net_pay` `number` — The employee's net pay. Only available when payroll has been processed — example: `2199.93`
    - `gross_pay` `number` — The employee's gross pay. Only available when payroll has been processed — example: `3000`
    - `taxes` `array of object` — An array of employer and employee taxes for the pay period.
      - `name` `string` — The name of the tax. — example: `CA State Income Tax`
      - `employer` `boolean` — Paid by employer. — example: `false`
      - `amount` `number` — The amount of the tax. — example: `1.97`
    - `deductions` `array of object` — An array of employee deductions for the pay period.
      - `name` `string` — The name of the deduction. — example: `Company Car`
      - `amount` `number` — The amount deducted. — example: `10.97`
    - `benefits` `array of object` — An array of employee benefits for the pay period.
      - `name` `string` — The name of the benefit. — example: `Health Insurance`
      - `employee_deduction` `number` — The amount deducted for benefit. — example: `142.94`
      - `employer_contribution` `number` — The amount of employer contribution. — example: `141.14`
- `meta` `object` — Response metadata
  - `items_on_page` `integer` — Number of items returned in the data property of the response — example: `50`
  - `cursors` `object` — Cursors to navigate to previous or next pages through the API
    - `previous` `string` — Cursor to navigate to the previous page of results through the API — example: `em9oby1jcm06OnBhZ2U6OjE=`
    - `current` `string` — Cursor to navigate to the current page of results through the API — example: `em9oby1jcm06OnBhZ2U6OjI=`
    - `next` `string` — Cursor to navigate to the next page of results through the API — example: `em9oby1jcm06OnBhZ2U6OjM=`
  - `total_count` `integer` — Number of records available in total for this resource — example: `1`
  - `warnings` `array of object` — Non-fatal warnings emitted when optional workflow steps failed. Present only when at least one step degraded; the response status remains 200.
    - `type` `string` — Discriminator for the warning kind. — example: `downstream_request_failed`
    - `status_code` `integer` — HTTP status code returned by the failed downstream request, when available. — example: `429`
    - `error` `string` — Short error description from the downstream provider, when available.
    - `operation` `string` — Identifier of the workflow step that failed. — example: `getManager`
    - `message` `string` — Detailed message from the downstream provider, when available.
- `_raw` `object` — Raw response from the integration when raw=true query param is provided

#### 400 — Bad Request

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 401 — Unauthorized

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 402 — Payment Required

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 404 — The specified resource was not found

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### 422 — Unprocessable

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

#### default — Unexpected error

> Standard error response — see [Error Responses](https://developers.apideck.com/errors)

## SDK examples

Calls this operation with the official Apideck SDKs.

### TypeScript

Setup: [TypeScript SDK](https://developers.apideck.com/sdks/node.md)

```typescript
import { Apideck } from "@apideck/unify";

const apideck = new Apideck({
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
});

async function run() {
  const result = await apideck.hris.employeePayrolls.get({
    payrollId: "<id>",
    employeeId: "<id>",
    serviceId: "bamboohr",
    fields: "id,updated_at",
  });

  console.log(result);
}

run();
```

### Python

Setup: [Python SDK](https://developers.apideck.com/sdks/python.md)

```python
from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.hris.employee_payrolls.get(payroll_id="<id>", employee_id="<id>", raw=False, service_id="bamboohr", fields="id,updated_at")

    assert res.get_employee_payroll_response is not None

    # Handle response
    print(res.get_employee_payroll_response)
```

### PHP

Setup: [PHP SDK](https://developers.apideck.com/sdks/php.md)

```php
declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Operations;

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$request = new Operations\HrisEmployeePayrollsOneRequest(
    payrollId: '<id>',
    employeeId: '<id>',
    serviceId: 'bamboohr',
    fields: 'id,updated_at',
);

$response = $sdk->hris->employeePayrolls->get(
    request: $request
);

if ($response->getEmployeePayrollResponse !== null) {
    // handle response
}
```

### Go

Setup: [Go SDK](https://developers.apideck.com/sdks/go.md)

```go
package main

import(
	"context"
	"os"
	sdkgo "github.com/apideck-libraries/sdk-go"
	"github.com/apideck-libraries/sdk-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := sdkgo.New(
        sdkgo.WithConsumerID("test-consumer"),
        sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
        sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
    )

    res, err := s.Hris.EmployeePayrolls.Get(ctx, operations.HrisEmployeePayrollsOneRequest{
        PayrollID: "<id>",
        EmployeeID: "<id>",
        ServiceID: sdkgo.Pointer("bamboohr"),
        Fields: sdkgo.Pointer("id,updated_at"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.GetEmployeePayrollResponse != nil {
        // handle response
    }
}
```

### Java

Setup: [Java SDK](https://developers.apideck.com/sdks/java.md)

```java
package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.HrisEmployeePayrollsOneRequest;
import com.apideck.unify.models.operations.HrisEmployeePayrollsOneResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
                .apiKey(System.getenv().getOrDefault("API_KEY", ""))
            .build();

        HrisEmployeePayrollsOneRequest req = HrisEmployeePayrollsOneRequest.builder()
                .payrollId("<id>")
                .employeeId("<id>")
                .serviceId("bamboohr")
                .fields("id,updated_at")
                .build();

        HrisEmployeePayrollsOneResponse res = sdk.hris().employeePayrolls().get()
                .request(req)
                .call();

        if (res.getEmployeePayrollResponse().isPresent()) {
            System.out.println(res.getEmployeePayrollResponse().get());
        }
    }
}
```

### C# (.NET)

Setup: [C# (.NET) SDK](https://developers.apideck.com/sdks/dot-net.md)

```csharp
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;

var sdk = new Apideck(
    consumerId: "test-consumer",
    appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);

HrisEmployeePayrollsOneRequest req = new HrisEmployeePayrollsOneRequest() {
    PayrollId = "<id>",
    EmployeeId = "<id>",
    ServiceId = "bamboohr",
    Fields = "id,updated_at",
};

var res = await sdk.Hris.EmployeePayrolls.GetAsync(req);

// handle response
```
