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

# List a one-time payment's line items

`GET https://marketplace-api.sequifi.com/v1/one-time-payments/{id}/line-items`

Module: Payroll · operationId: `listOneTimePaymentLineItems` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/list-one-time-payment-line-items

Returns the rows a paid one-time payment was built from (which deal, which milestone, how much), in the same shape as GET /v1/payroll-history/{id}/line-items. Sum only rows with `counts_toward_pay: true` to match the payment.

**What happens:**

- Reads the copy of each row that Sequifi saved when the payment was made, so figures do not change when live commissions are later recalculated.
- Each row has a `category` matching a section of the stub: `commission`, `override`, `adjustment`, `reimbursement`, `additional_value` (custom payroll fields) or `deduction`.
- A standalone payment, such as an approved bonus, is itself one row with `source: "one_time_payments"`, in `adjustment`, or in `reimbursement` for a reimbursement.
- A row with `counts_toward_pay: false` was marked paid outside this payment. `excluded_reason` is `paid_externally`, `do_not_pay` or `marked_paid`, and the row is summed into `totals.excluded_total`.
- Wages, overtime, reconciliation and taxes are not itemized. They are totals on GET /v1/one-time-payments.

**Filtering and paging:**

- `category` returns one section. `totals` respect `category` but always cover the whole payment, never only the current page.
- `page` defaults to 1. `per_page` defaults to 50, maximum 500.

**Formats:**

- `(source, id)` identifies a row. `id` alone can repeat across sections.
- `pay_date` and each row's `date` are dates (`YYYY-MM-DD`).

**Errors:**

- `400 Invalid one-time payment id`, `400 Invalid category`, or a bad `page` or `per_page`.
- `404 One-time payment not found`: unknown, not paid yet, failed, or paid a whole payroll (use GET /v1/payroll-history/{id}/line-items for that one).

**Related:**

- GET /v1/one-time-payments/{id} returns the payment's totals.

## Path parameters

- `id` (integer, **required**): The payment's `one_time_payment_id`. Minimum: 1. Example: `14`.

## Query parameters

- `category` (string): Return one section of the stub. One of: `commission`, `override`, `adjustment`, `reimbursement`, `additional_value`, `deduction`.
- `page` (integer): Page number. Default: `1`. Minimum: 1.
- `per_page` (integer): Rows per page, maximum 500. Default: `50`. Minimum: 1. Maximum: 500.

## Example request

```bash
curl -X GET "https://marketplace-api.sequifi.com/v1/one-time-payments/14/line-items" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: The payment's line items

- `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): The endpoint's payload. `{}` on most errors.

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requestedBy": "acme",
    "one_time_payment_id": 14,
    "user": {
      "id": 501,
      "employee_id": "AC-0042",
      "first_name": "Jordan",
      "last_name": "Lee",
      "position_id": 3,
      "position_name": "Sales Rep",
      "worker_type": "w2"
    },
    "pay_period_from": "2026-10-26",
    "pay_period_to": "2026-11-01",
    "pay_frequency": 1,
    "pay_date": "2026-10-30",
    "is_history": true,
    "totals": {
      "commission": 0,
      "override": 0,
      "adjustment": 1000,
      "reimbursement": 0,
      "additional_value": 0,
      "deduction": 0,
      "line_items_total": 1000,
      "excluded_total": 0
    },
    "filters": null,
    "current_page": 1,
    "per_page": 50,
    "total": 1,
    "last_page": 1,
    "line_items": [
      {
        "id": 14,
        "source": "one_time_payments",
        "category": "adjustment",
        "type": "Bonus",
        "pid": null,
        "customer_name": "Jordan Lee",
        "amount": 1000,
        "date": "2026-10-30",
        "description": "Signing bonus",
        "counts_toward_pay": true,
        "excluded_reason": null
      }
    ]
  }
}
```

### 400: Invalid id, category, page or per_page

```json
{
  "status": 400,
  "message": "Invalid one-time payment 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 one-time payment with this id

```json
{
  "status": 404,
  "message": "One-time payment not found",
  "data": {}
}
```

### 500: Internal server error

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