# Searchable Fields Reference

Each GET search endpoint defines its own set of searchable fields. This page lists the available fields, their types, and example queries for each endpoint. For full query syntax, operators, and boolean logic, see the [Search Query Language](https://github.com/PartsSourceInc/gitbook-documentation/blob/main/documentation/core-concepts/search-query-language/README.md).

Querying an unregistered field returns a `400 Bad Request` error listing the valid fields for that endpoint.

***

## GET /manufacturers/search

| Field            | Type    | Description                          | Example                                           |
| ---------------- | ------- | ------------------------------------ | ------------------------------------------------- |
| `name`           | String  | Manufacturer name (case-insensitive) | `name~"philips"` or `name:"Siemens Healthineers"` |
| `manufacturerId` | Numeric | Manufacturer ID                      | `manufacturerId:26799`                            |

**Examples:**

```
GET /manufacturers/search?q=name~"philips"
GET /manufacturers/search?q=manufacturerId:26799
GET /manufacturers/search?q=name~"philips" AND manufacturerId:26799
```

***

## GET /orders/search

> **Note:** Delegates to the external Order API. The `q` parameter is passed through.

| Field                 | Type     | Supports IN | Description                                                                                                  | Example                                                   |
| --------------------- | -------- | ----------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| `orderId`             | Token    | Yes         | Order ID (bypass field)                                                                                      | `orderId:10001` or `orderId IN [10001, 10002]`            |
| `companyId`           | Token    | Yes         | Company ID                                                                                                   | `companyId:12345`                                         |
| `rootCompanyId`       | Token    | Yes         | Root company ID (alternative to companyId)                                                                   | `rootCompanyId:100`                                       |
| `requesterId`         | Token    | Yes         | Requester ID                                                                                                 | `requesterId:500`                                         |
| `status`              | Token    | Yes         | Order status                                                                                                 | `status:"Pending"` or `status IN ["Pending", "Research"]` |
| `createdDate`         | DateTime | No          | Order creation date (ISO 8601)                                                                               | `createdDate>="2026-01-01"`                               |
| `poNumber`            | String   | No          | Purchase order number (case-insensitive, bypass field)                                                       | `poNumber~"PO-456"` or `poNumber:"PO-456"`                |
| `lineId`              | Token    | No          | Line item ID (bypass field)                                                                                  | `lineId:789012`                                           |
| `partNumber`          | String   | No          | Part number — searches both replacement and requested part number (case-insensitive, always substring match) | `partNumber~"MOT"`                                        |
| `lineItemDescription` | String   | No          | Line item description (case-insensitive)                                                                     | `lineItemDescription~"pump"`                              |

**Status values:** `Pending`, `Research`, `EOrdered`, `Completed`

**Validation rules:**

* Either `orderId`, `poNumber`, or `lineId` must be specified, **or** both `companyId` (or `rootCompanyId`) and a bounded `createdDate` range are required.
* Date ranges cannot exceed **90 days** and require both upper and lower bounds.
* Negation (`-`) is **not supported** for `companyId` or `status`.
* Only `AND` logic is supported — `OR` queries are rejected.

**Related data:** Use `include=lineItems`, `include=shippingInfo`, or `include=lineItems,shippingInfo` to fetch related data inline. See [Including Related Data](https://github.com/PartsSourceInc/gitbook-documentation/blob/main/documentation/core-concepts/including-related-data.md).

**Response fields:** Each order includes `poNumber` and `requesterName`. Line items (when included) include `requestedPartNumber`, `replacementPartNumber`, and `statusName`. Shipping info (when included) returns address, carrier, and service level.

**Examples:**

```
GET /orders/search?q=companyId:12345 AND status:"Pending" AND createdDate>="2026-01-01" AND createdDate<"2026-02-01"
GET /orders/search?q=companyId:12345 AND createdDate>="2026-01-01" AND createdDate<"2026-02-01"
GET /orders/search?q=status:"Pending" AND companyId:500 AND createdDate>="2026-01-01" AND createdDate<"2026-04-01"
GET /orders/search?q=poNumber~"PO-456"
GET /orders/search?q=lineId:789012
GET /orders/search?q=orderId IN [10001, 10002, 10003]
GET /orders/search?q=companyId:12345 AND partNumber~"motor" AND createdDate>="2026-01-01" AND createdDate<"2026-02-01"
GET /orders/search?q=companyId:12345 AND createdDate>="2026-01-01" AND createdDate<"2026-02-01"&include=lineItems,shippingInfo
```

***

## GET /users/search

{% hint style="info" %}
The searchable fields for this endpoint will be documented here once finalized. In the meantime, querying with an invalid field name will return a `400` response listing the valid fields.
{% endhint %}
