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

# Search branches

> Search branches by name or code, and filter by status or other fields.

<ParamField path="app_id" type="string" required>
  Your store ID in Jelou Shop.
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number to return.
</ParamField>

<ParamField query="limit" type="integer" default="15">
  Number of results per page (max. 100).
</ParamField>

<ParamField body="search" type="object">
  Text search object.

  <Expandable title="Search properties">
    <ParamField body="value" type="string" required>
      Text to search in the `name` and `code` fields.
    </ParamField>

    <ParamField body="case_sensitive" type="boolean" default="false">
      Whether the search is case-sensitive.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="filters" type="object[]">
  List of filters to apply.

  <Expandable title="Properties of each filter">
    <ParamField body="field" type="string" required>
      Field to filter by: `status` or `code`.
    </ParamField>

    <ParamField body="operator" type="string" default="=">
      Comparison operator. Supported values: `=`, `!=`, `<`, `<=`, `>`, `>=`, `like`, `not like`, `in`, `not in`.
    </ParamField>

    <ParamField body="value" type="string | boolean" required>
      Filter value.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="sort" type="object[]">
  Result ordering.

  <Expandable title="Properties of each sort">
    <ParamField body="field" type="string" required>
      Field to sort by: `created_at`, `updated_at`, `name` or `code`.
    </ParamField>

    <ParamField body="direction" type="string" default="asc">
      Sort direction: `asc` or `desc`.
    </ParamField>
  </Expandable>
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://gateway.jelou.ai/ecommerce/v2/apps/{app_id}/branches/search?page=1&limit=20" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "search": {
        "value": "downtown",
        "case_sensitive": false
      },
      "filters": [
        { "field": "status", "operator": "=", "value": true }
      ],
      "sort": [
        { "field": "name", "direction": "asc" }
      ]
    }'
  ```
</RequestExample>

<Note>
  Each branch in the response includes `products_count` with the number of **active** products linked to it. If you omit `sort`, results are ordered by `created_at` ascending.
</Note>

<Tip>
  **Searchable fields:** `name`, `code`
  **Filterable fields:** `status`, `code`
  **Sortable fields:** `created_at`, `updated_at`, `name`, `code`
</Tip>
