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

# Get a paid pay stub

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

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

Returns one paid or marked-paid pay stub, looked up by its payroll id. Use the id the stub had while it was open (`payroll_id` in GET /v1/payroll-history, `id` in GET /v1/payroll, or `payroll_id` in GET /v1/users/{id}/earnings/items). The paid record's own `id` returns 404.

**What happens:**

- The stub comes back in `data.payrolls` as a one-item array, with the same fields as GET /v1/payroll-history.
- Only stubs that count as paid are returned: paid through your payroll provider, or marked as paid by an admin. A stub whose payment is still in flight or has failed returns 404.
- If a payroll was processed more than once, Sequifi holds more than one paid record for it. This endpoint returns one of them and does not guarantee which. GET /v1/payroll-history/{id}/line-items always reads the newest one.

**Formats:**

- `pay_period_from`, `pay_period_to` and `pay_date` 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.
- Custom field values are strings.

**Errors:**

- `400 Invalid payroll id`: the id is not a positive number.
- `400 Cannot use query parameters when fetching a single payroll history record by id`: remove the query string.
- `404 Payroll history record not found`: the stub is still open (try GET /v1/payroll/{id}), its payment is in flight or failed, or you passed the paid record's `id` instead of `payroll_id`.

**Related:**

- GET /v1/payroll-history lists paid stubs.
- GET /v1/payroll-history/{id}/line-items itemizes this stub.
- GET /v1/payroll/{id} reads a stub that is not paid yet.

## Path parameters

- `id` (integer, **required**): The pay stub id (`payroll_id` in GET /v1/payroll-history). Not the paid record's `id`. Minimum: 1. Example: `5521`.

## Example request

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

## Responses

### 200: The paid 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 paid pay stub. Rows also carry other stored fields not listed here; ignore them, they can change without notice.
    - `id` (integer): Id of the paid record. Not the stub id; other endpoints do not accept it.
    - `payroll_id` (integer): The pay stub id. Use it with this endpoint, its line items, and PATCH /v1/payroll-history.
    - `user_id` (integer): The user who was paid.
    - `first_name` (string): The user's first name.
    - `last_name` (string): The user's last name.
    - `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.
    - `pay_date` (string, nullable): Pay date when recorded, midnight UTC timestamp.
    - `status` (integer): Always `3` (paid).
    - `is_mark_paid` (integer): `1` when an admin marked the stub as paid outside Sequifi (for example by check), so no money moved through your payroll provider. `0` otherwise.
    - `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.
    - `reimbursement_amount` (number): Same value as `reimbursement`.
    - `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.
    - `manual_paid_amount` (number): Same value as `custom_payment`.
    - `gross_pay` (number): Gross pay.
    - `net_pay` (number): Net pay.
    - `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.
    - `state_income_tax` (number): State income tax withheld (W-2 only). `0` when none.
    - `federal_income_tax` (number): Federal income tax withheld (W-2 only). `0` when none.
    - `quickbooks_journal_entry_id` (string, nullable): QuickBooks journal entry id saved with PATCH /v1/payroll-history, or null.
    - `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": 9014,
        "payroll_id": 5521,
        "user_id": 4821,
        "first_name": "Alex",
        "last_name": "Morgan",
        "pay_frequency": 2,
        "worker_type": "w2",
        "pay_period_from": "2026-03-01T00:00:00.000Z",
        "pay_period_to": "2026-03-07T00:00:00.000Z",
        "pay_date": "2026-03-13T00:00:00.000Z",
        "status": 3,
        "is_mark_paid": 0,
        "is_onetime_payment": 0,
        "commission": 1250,
        "override": 150,
        "adjustment": 0,
        "reimbursement": 40,
        "reimbursement_amount": 40,
        "deduction": 0,
        "clawback": 0,
        "reconciliation": 0,
        "hourly_salary": 560,
        "overtime": 0,
        "custom_payment": 0,
        "manual_paid_amount": 0,
        "gross_pay": 2000,
        "net_pay": 1712.5,
        "employee_tax": "152.40",
        "employer_tax": "152.40",
        "total_earning": null,
        "state_income_tax": 45,
        "federal_income_tax": 90.1,
        "quickbooks_journal_entry_id": "JE-1042",
        "custom_field": [
          {
            "Sales Bonus": "100",
            "Fuel": "20"
          }
        ]
      }
    ]
  }
}
```

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

Example (invalid_id): Id is not a positive number

```json
{
  "status": 400,
  "message": "Invalid payroll 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 paid stub with this payroll id

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

### 500: Internal server error

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