# Search SKUs (https://docs.pulsarml.com/v1/api-reference/skus/post-skus-filters)

Search the product catalog, or page through it with `{}`.

The filters are separate rather than one combined search: `skus` matches the SKU code and
also accepts `include` / `exclude` by id, while `names`, `description` and `unit` are each
their own fuzzy filter. Archived SKUs are part of the catalog and are not excluded
automatically.

## `POST /v1/skus/filters`

Base URLs:
- `https://draco.prod.pulsarml.com` — Production
- `https://draco.dev.pulsarml.com` — Development (sandbox)

Authentication: send your API key in the `x-api-key` header.

### Request body (`application/json`, required)

Type: object (`GetSkusByFiltersRequestV1`)

- `page` (integer, optional, default `1`, > 0, e.g. `1`) — The page number for pagination
- `limit` (integer, optional, default `10`, > 0, e.g. `10`) — The number of items per page for pagination
- `skus` (object, optional, nullable) — Filter criteria for SKUs
  - `search` (string, optional, nullable) — Search term for Skus
  - `include` (array of string, optional, nullable) — Items to include by id
  - `exclude` (array of string, optional, nullable) — Items to exclude by id
- `names` (object, optional, nullable) — Filter criteria for names
  - `search` (string, optional, nullable) — Search term
- `description` (object, optional, nullable) — Filter criteria for description
  - `search` (string, optional, nullable) — Search term
- `unit` (object, optional, nullable) — Filter criteria for unit
  - `search` (string, optional, nullable) — Search term

### Responses

#### 200 — A page of SKUs, with the total count and page count

Type: object (`GetSkusByFiltersResponseV1`)

- `totalCount` (integer, optional, default `100`) — The total count of items
- `totalPages` (integer, optional, default `10`) — The total number of pages
- `currentPage` (integer, optional, default `1`) — The current page
- `skus` (array of object, required)
  - `id` (string (uuid4), required, e.g. `"36f7b519-d93e-4ec8-8245-7f4b8c123456"`) — The unique identifier for the sku.
  - `company` (object, required) — The company associated with the sku.
    - `id` (integer, required, e.g. `1`) — The unique identifier for the company.
    - `name` (string, required, e.g. `"company 1"`) — The name of the company.
  - `sku` (string, required, e.g. `"sku 1"`) — The sku code of the sku.
  - `name` (string, required, nullable, e.g. `"sku 1"`) — The name of the sku.
  - `description` (string, required, nullable, e.g. `"sku 1"`) — The description of the sku.
  - `unit` (string, required, nullable, e.g. `"pcs"`) — The unit of the sku.
  - `archived` (boolean, required, e.g. `false`) — The archived status of the sku.
  - `createdAt` (string (date-time), required, e.g. `"2024-01-01T00:00:00.000Z"`) — The timestamp when the sku was created.
  - `updatedAt` (string (date-time), required, e.g. `"2024-01-01T00:00:00.000Z"`) — The timestamp when the sku was last updated.
  - `deletedAt` (string (date-time), optional, nullable, e.g. `"2024-01-02T00:00:00.000Z"`) — The timestamp when the sku was deleted, if applicable.

#### 422 — Validation Error

Type: object (`HTTPValidationError`)

- `detail` (array of object, optional)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)

### Example request

```bash
curl -X POST 'https://draco.prod.pulsarml.com/v1/skus/filters' \
  -H 'x-api-key: <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "page": 1,
    "limit": 10,
    "skus": {
      "exclude": [
        "9ce2c6b4-a1f4-4bf2-b5c8-10436d1018cc"
      ],
      "include": [
        "9d02ab43-0100-4af6-a73c-e05abbd72648"
      ],
      "search": "sku 1"
    },
    "names": {
      "search": "sku 1"
    },
    "description": {
      "search": "a simple description"
    },
    "unit": {
      "search": "kgs"
    }
  }'
```