> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecobalt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Order Catalog

> Searches the practice's orderable lab, imaging, or procedure catalog.

Catalog searches run asynchronously against the live EMR: a valid request returns immediately with a `202`, and an `order_catalog.searched` webhook is sent with the results when the search completes.

Use the `item_id` values from the results when creating an order via `POST /v1/orders`.

Searching the order catalog is only supported for eClinicalWorks.

### Request Parameters

#### Required Fields

* **type** (string, required): Which catalog to search. One of `lab`, `imaging`, or `procedure`.

#### Optional Fields

* **query** (string, optional): Name filter (prefix or substring). Omit to page the full catalog.
* **page** (integer, optional): Page number (1-based). Defaults to `1`.
* **page\_size** (integer, optional): Results per page. Defaults to `25`.
* **callback\_urls** (string\[], optional): URLs to receive the results webhook, in addition to the account webhook.

### Example Request

```bash theme={null}
curl -X POST https://api.usecobalt.com/v1/orders/catalog/fetch \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
    "type": "lab",
    "query": "glucose",
    "page": 1,
    "page_size": 25
}'
```

### Example Response

```json theme={null}
{
  "success": true,
  "status": "queued",
  "message": "Catalog search started. A order_catalog.searched webhook will be sent when it completes.",
  "job_id": 12345
}
```

### Webhook Notifications

When the search completes, we send an `order_catalog.searched` webhook to your registered endpoint:

```json theme={null}
{
  "id": "evt_1J9X2q2eZvKYlo2CluR9g9gV",
  "access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
  "object": "event",
  "created": "2025-10-09T10:30:00Z",
  "type": "order_catalog.searched",
  "job_id": "12345",
  "data": {
    "type": "lab",
    "page": 1,
    "has_more": true,
    "items": [
      {
        "item_id": "80048",
        "name": "Comprehensive Metabolic Panel",
        "billable": true
      },
      {
        "item_id": "82947",
        "name": "Glucose, Serum",
        "billable": true
      }
    ]
  }
}
```


## OpenAPI

````yaml POST /orders/catalog/fetch
openapi: 3.1.0
info:
  title: Cobalt API
  version: 1.0.1
  description: API for interacting with Cobalt's EHR integration services
servers:
  - url: https://api.usecobalt.com/v1
    description: Production
security:
  - ClientCredentials: []
    ClientSecret: []
    AccessToken: []
paths:
  /orders/catalog/fetch:
    post:
      tags:
        - Orders
      summary: Search the orderable catalog
      description: >-
        Queues a live search of the practice’s orderable lab/imaging/procedure
        catalog; results are delivered by webhook.
      operationId: searchOrderCatalog
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - lab
                    - imaging
                    - procedure
                  x-supported-emrs:
                    - eClinicalWorks
                  description: Which orderable catalog to search.
                  example: lab
                  x-required-for-emrs:
                    - eClinicalWorks
                query:
                  type: string
                  x-supported-emrs:
                    - eClinicalWorks
                  description: >-
                    Name filter (prefix / substring). Omit to page the full
                    catalog.
                  example: glucose
                page:
                  type: integer
                  exclusiveMinimum: 0
                  x-supported-emrs:
                    - eClinicalWorks
                  description: Page number (1-based). Defaults to 1.
                page_size:
                  type: integer
                  exclusiveMinimum: 0
                  x-supported-emrs:
                    - eClinicalWorks
                  description: Results per page. Defaults to 25.
                callback_urls:
                  type: array
                  items:
                    type: string
                  x-supported-emrs:
                    - eClinicalWorks
                  description: >-
                    URLs to receive the results webhook, in addition to the
                    account webhook.
      responses:
        '202':
          description: Queued for processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                  message:
                    type: string
                  job_id:
                    anyOf:
                      - type: string
                      - type: number
                required:
                  - success
                  - status
                  - message
                  - job_id
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    BadRequest:
      description: Bad request — missing or invalid parameters
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
    Unauthorized:
      description: Unauthorized — missing or invalid credentials
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
  securitySchemes:
    ClientCredentials:
      type: apiKey
      in: header
      name: client_id
    ClientSecret:
      type: apiKey
      in: header
      name: client_secret
    AccessToken:
      type: apiKey
      in: header
      name: access_token

````