# Search advance payment categories

Operation ID: `searchAdvancePaymentCategories`

Group: Accounting › Advance Payment Categories

[Open in the interactive reference](https://docs.api.lensing.ai/lensing/v1/endpoints/searchAdvancePaymentCategories)

`POST /accounting/advance-payment-categories/search`

Read-only: A read that takes its filters in the body. Changes nothing, and ignores Idempotency-Key.

Searches advance payment categories. The filters are legal entity, name, and status. Matching categories are returned newest first.

A legal entity has at most one category, so filters.entityId returns at most one item.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |

## Request body

Required, `application/json`: searchAdvancePaymentCategoriesInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filters` | object | no | Search filters, nested as one object. All are optional and are ANDed; omit the whole object to match every category. Example: `{"status":"active"}`. |
| `filters.entityId` | string | no | Restrict to the category belonging to this entity (a UUID). An entity has at most one category, so this matches at most one item. A uuid that matches no entity returns an empty page, not an error. |
| `filters.name` | string | no | Exact match on the category's display name. |
| `filters.status` | string | no | Restrict to categories in this lifecycle status: active or inactive. |
| `page` | object | no | Pagination controls. Omit for the first page. Example: `{"size":50}`. |
| `page.cursor` | string | no | Opaque forward cursor from a previous response's pagination.nextCursor; omit for the first page. |
| `page.size` | number | no | Maximum number of categories to return. Defaults to 50, capped at 200. |

```json
{
  "filters": {
    "status": "active"
  },
  "page": {
    "size": 50
  }
}
```

## Response

`200` Success

Under `data` (searchAdvancePaymentCategoriesOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array<object> | yes | Matching advance payment categories for this page, newest first. |
| `items[].id` | string | yes |  |
| `items[].entityId` | string | yes |  |
| `items[].name` | string | yes |  |
| `items[].allowManualPayment` | boolean | no |  |
| `items[].status` | string | no |  |
| `items[].lastModifiedDate` | date-time | yes |  |
| `pagination` | object | yes | Pagination cursor for this page. |
| `pagination.nextCursor` | string | no | Opaque cursor to pass as page.cursor for the next page; absent on the last page. |
| `pagination.hasMore` | boolean | yes | True when more matches remain beyond this page. |

```json
{
  "data": {
    "items": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "<name>",
        "allowManualPayment": true,
        "status": "<status>",
        "lastModifiedDate": "2026-01-15T09:30:00.000Z"
      }
    ],
    "pagination": {
      "nextCursor": "<nextCursor>",
      "hasMore": true
    }
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Statuses

- `400` — Invalid request or business failure
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
