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

# List paid pay stubs

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

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

Lists paid and marked-paid pay stubs, mainly so an accounting sync can post them to the books. Results are not deduplicated: if a payroll was processed more than once, every paid record for it is returned, so key your sync on `payroll_id` and skip ids you have already posted.

**What happens:**

- A stub appears here once it is paid through your payroll provider or marked as paid by an admin. A stub whose payment is in flight or has failed is left out until it settles.
- One-time payments, such as an approved bonus paid right away, are not listed here. Read them from GET /v1/one-time-payments. The exception is a one-time payment that paid a whole open payroll, which is listed here with `is_onetime_payment: 1`.
- For some payroll providers a stub is listed as soon as payment is sent, before the provider confirms it.
- `is_mark_paid` tells you how the stub was settled: `1` means an admin marked it paid outside Sequifi (for example by check) and no money moved through your payroll provider. Filter on `is_mark_paid` rather than inferring it from other fields.

**Filtering and paging:**

- `quickbooks_synced=false` returns stubs with no QuickBooks journal entry id and net pay above zero, oldest first. `quickbooks_synced=true` returns stubs that have one.
- `is_mark_paid=true` or `false` splits marked-paid stubs from the rest. The two values together cover every stub.
- `worker_type` is an exact match (`1099` or `w2`).
- There is no date, user or pay frequency filter.
- `page` defaults to 1. `per_page` defaults to 10; values above 200 are treated as 200.
- Sorted by `payroll_id`, newest first, except `quickbooks_synced=false`, which sorts oldest first. `last_page` is at least `1`.
- Saving journal ids while you page through `quickbooks_synced=false` shifts the pages. Start again from page 1 after each PATCH /v1/payroll-history.

**Idempotency and retries:**

- Use `payroll_id` (not `id`) as the key for each stub. Before creating a journal entry, check that `quickbooks_journal_entry_id` is null and that you have not already posted that `payroll_id`.

**Formats:**

- `id` is the paid record's own id. `payroll_id` is the stub id used everywhere else.
- `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.
- `reimbursement_amount` repeats `reimbursement`, and `manual_paid_amount` repeats `custom_payment`.

**Errors:**

- `400 Invalid query parameter(s)` for an unknown query key.
- `400 quickbooks_synced must be 'true' or 'false'` and `400 is_mark_paid must be 'true' or 'false'`.
- A non-numeric `page` or `per_page` returns `500`, not `400`.

**Related:**

- PATCH /v1/payroll-history saves journal entry ids.
- GET /v1/payroll-history/{id} and its line items read one stub by `payroll_id`.
- GET /v1/payroll lists stubs that are not paid yet.
- GET /v1/one-time-payments lists paid one-time payments, which are not listed here.

## Query parameters

- `quickbooks_synced` (string): `false` returns stubs with no QuickBooks journal entry id and net pay above zero, oldest first. `true` returns stubs that have one. Omit for all. One of: `false`, `true`. Example: `false`.
- `is_mark_paid` (string): `true` returns stubs an admin marked as paid outside Sequifi; `false` returns stubs paid through your payroll provider. Omit for both. One of: `false`, `true`. Example: `false`.
- `worker_type` (string): Exact match on worker type: `1099` or `w2`. Other values return no rows. Example: `w2`.
- `page` (integer): Page number. Default: `1`. Minimum: 1. Example: `1`.
- `per_page` (integer): Rows per page. Values above 200 are treated as 200. Default: `10`. Minimum: 1. Maximum: 200. Example: `10`.

## Example request

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

## Responses

### 200: A page of paid pay stubs

- `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): Page returned.
  - `per_page` (integer): Rows per page after the 200 cap.
  - `total` (integer): Rows across all pages.
  - `last_page` (integer): Last page number. At least `1`.
  - `filters` (object, nullable): The filters you sent, as strings, or null when none.
  - `payrolls` (array of object): Paid pay stubs. 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 as your sync key, with GET /v1/payroll-history/{id}, and in 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, so no money moved through your payroll provider. `0` otherwise.
    - `is_onetime_payment` (integer): `1` for a one-time payment stub.
    - `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).

Example (unsynced): quickbooks_synced=false: paid, not yet in QuickBooks (oldest first)

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requestedBy": "acme",
    "current_page": 1,
    "per_page": 10,
    "total": 1,
    "last_page": 1,
    "filters": {
      "quickbooks_synced": "false"
    },
    "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": null,
        "custom_field": [
          {
            "Sales Bonus": "100",
            "Fuel": "20"
          }
        ]
      }
    ]
  }
}
```

Example (marked_paid): is_mark_paid=true: settled outside Sequifi

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requestedBy": "acme",
    "current_page": 1,
    "per_page": 10,
    "total": 1,
    "last_page": 1,
    "filters": {
      "is_mark_paid": "true"
    },
    "payrolls": [
      {
        "id": 9022,
        "payroll_id": 5560,
        "user_id": 4835,
        "first_name": "Jordan",
        "last_name": "Lee",
        "pay_frequency": 2,
        "worker_type": "1099",
        "pay_period_from": "2026-03-15T00:00:00.000Z",
        "pay_period_to": "2026-03-21T00:00:00.000Z",
        "pay_date": null,
        "status": 3,
        "is_mark_paid": 1,
        "is_onetime_payment": 0,
        "commission": 950,
        "override": 0,
        "adjustment": 0,
        "reimbursement": 0,
        "reimbursement_amount": 0,
        "deduction": 0,
        "clawback": 0,
        "reconciliation": 0,
        "hourly_salary": 0,
        "overtime": 0,
        "custom_payment": 0,
        "manual_paid_amount": 0,
        "gross_pay": 950,
        "net_pay": 950,
        "employee_tax": null,
        "employer_tax": null,
        "total_earning": null,
        "state_income_tax": 0,
        "federal_income_tax": 0,
        "quickbooks_journal_entry_id": null
      }
    ]
  }
}
```

### 400: Unknown query parameter or bad filter value

Example (invalid_params): Unknown query parameter

```json
{
  "status": 400,
  "message": "Invalid query parameter(s)",
  "data": {
    "invalid_params": [
      "pay_period_from"
    ],
    "allowed_params": [
      "quickbooks_synced",
      "is_mark_paid",
      "worker_type",
      "page",
      "per_page"
    ]
  }
}
```

### 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"
}
```

### 500: Internal server error, including a non-numeric page or per_page

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