<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# Get an open pay stub

`GET https://marketplace-api.sequifi.com/v1/payroll/{id}`

Module: Payroll · operationId: `getPayroll` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/get-payroll

Returns one pay stub that has not been paid yet, by its id. When a stub is paid it moves to payroll history and this endpoint returns 404 for it; read it with GET /v1/payroll-history/{id} using the same id.

**What happens:**

- The stub comes back in `data.payrolls` as a one-item array, with the same fields as GET /v1/payroll. There is no `filters` key.
- Figures can still change until the payroll is paid.

**Formats:**

- `pay_period_from` and `pay_period_to` are timestamps at midnight UTC, for example `"2026-03-01T00:00:00.000Z"`. Use the date part.
- Most money fields are JSON numbers. `employee_tax`, `employer_tax` and `total_earning` are decimal strings such as `"152.40"`, or null.

**Errors:**

- `400 Invalid payroll id`: the id is not a positive number. Trailing characters are ignored, so `12abc` is read as `12`; send digits only.
- `400 Cannot use query parameters when fetching a single payroll by id`: remove the query string.
- `404 Payroll not found`: usually the stub was paid. Retry with GET /v1/payroll-history/{id}.

**Related:**

- GET /v1/payroll lists open stubs.
- GET /v1/payroll/{id}/line-items itemizes this stub.
- GET /v1/payroll-history/{id} reads the stub after it is paid.

## Path parameters

- `id` (integer, **required**): The pay stub id (`id` in GET /v1/payroll). Minimum: 1. Example: `5521`.

## Example request

```bash
curl -X GET "https://marketplace-api.sequifi.com/v1/payroll/5521" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: The open pay stub

- `status` (integer): The HTTP status code, repeated. Example: `200`.
- `message` (string): Short text. Wording varies by endpoint; branch on the HTTP status, not on this text. Example: `success`.
- `data` (object)
  - `requestedBy` (string): Label of the API credential that made the call.
  - `current_page` (integer): Always `1`.
  - `per_page` (integer): Always `1`.
  - `total` (integer): Always `1`.
  - `last_page` (integer): Always `1`.
  - `payrolls` (array of object): One open pay stub. Rows also carry other stored fields not listed here; ignore them, they can change without notice.
    - `id` (integer): The pay stub id. It stays the same after the stub is paid.
    - `user_id` (integer): The user being paid.
    - `position_id` (integer, nullable): The user's position for this pay run.
    - `pay_frequency` (integer): Pay frequency id. `2` Weekly, `3` Bi-Weekly, `4` Semi-Monthly, `5` Monthly, `6` Daily.
    - `worker_type` (string): `1099` or `w2`.
    - `pay_period_from` (string): Start of the pay period, midnight UTC timestamp.
    - `pay_period_to` (string): End of the pay period, midnight UTC timestamp.
    - `status` (integer): `1` open (editable), `2` finalized (ready to pay), `3` payment in progress. One of: `1`, `2`, `3`.
    - `is_mark_paid` (integer): `1` when an admin marked the stub as paid outside Sequifi, otherwise `0`.
    - `is_onetime_payment` (integer): `1` for a one-time payment, which is a separate stub from the regular one for the same period.
    - `commission` (number): Commission total.
    - `override` (number): Override total.
    - `adjustment` (number): Adjustment total.
    - `reimbursement` (number): Reimbursement total.
    - `deduction` (number): Deduction total.
    - `clawback` (number): Clawback total.
    - `reconciliation` (number): Reconciliation payout total.
    - `hourly_salary` (number): Hourly and salary wages.
    - `overtime` (number): Overtime wages.
    - `custom_payment` (number): Custom payment amount.
    - `gross_pay` (number): Gross pay.
    - `net_pay` (number): Net pay. Not final until the payroll is finalized.
    - `employee_tax` (string, nullable): Employee taxes as a decimal string.
    - `employer_tax` (string, nullable): Employer taxes as a decimal string.
    - `total_earning` (string, nullable): Total earnings as a decimal string.
    - `created_at` (string): When the stub was created, ISO 8601 UTC.
    - `updated_at` (string): When the stub last changed, ISO 8601 UTC.
    - `custom_field` (array of object): Present only when the stub has custom payroll field values. A one-item array holding an object that maps each field name to its value (a string). A field whose definition was removed is keyed by its numeric id.

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requestedBy": "acme",
    "current_page": 1,
    "per_page": 1,
    "total": 1,
    "last_page": 1,
    "payrolls": [
      {
        "id": 5521,
        "user_id": 4821,
        "position_id": 14,
        "pay_frequency": 2,
        "worker_type": "w2",
        "pay_period_from": "2026-03-01T00:00:00.000Z",
        "pay_period_to": "2026-03-07T00:00:00.000Z",
        "status": 1,
        "is_mark_paid": 0,
        "is_onetime_payment": 0,
        "commission": 1250,
        "override": 150,
        "adjustment": 0,
        "reimbursement": 40,
        "deduction": 0,
        "clawback": 0,
        "reconciliation": 0,
        "hourly_salary": 560,
        "overtime": 0,
        "custom_payment": 0,
        "gross_pay": 2000,
        "net_pay": 1712.5,
        "employee_tax": "152.40",
        "employer_tax": "152.40",
        "total_earning": null,
        "created_at": "2026-03-08T14:02:11.000Z",
        "updated_at": "2026-03-08T14:02:11.000Z",
        "custom_field": [
          {
            "Sales Bonus": "100"
          }
        ]
      }
    ]
  }
}
```

### 400: Invalid id, or query parameters sent with the id

Example (query_params_with_id): Query parameters sent with the id

```json
{
  "status": 400,
  "message": "Cannot use query parameters when fetching a single payroll by id",
  "data": {}
}
```

### 401: Missing, invalid or expired token. The gateway rejects the call before it reaches Sequifi, so the body has only a `message`.

```json
{
  "message": "Unauthorized"
}
```

### 404: No open stub with this id. It may have been paid.

```json
{
  "status": 404,
  "message": "Payroll not found",
  "data": {}
}
```

### 500: Internal server error

```json
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}
```
