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

# Search API

> One query across your orders, customers, products, subscribers and discounts. The same search as ⌘K in the dashboard.

`GET /search` looks for one piece of text everywhere in your store and returns
the matches grouped by type. It is the search behind **⌘K** (Ctrl+K on Windows
and Linux) in the dashboard, so an integration or an AI agent finds a record
the same way you do.

Base URL `https://api.pocketsflow.com`, API key in the `Authorization`
header, like every other endpoint. Available on every plan.

## Search

```bash theme={"system"}
curl "https://api.pocketsflow.com/search?q=ana&limit=5" \
  -H "Authorization: Bearer pk_live_..."
```

```json theme={"system"}
{
  "query": "ana",
  "testMode": false,
  "limit": 5,
  "groups": [
    {
      "type": "orders",
      "hasMore": false,
      "hits": [
        {
          "id": "6711a3d59e3f1a0012cd7788",
          "type": "orders",
          "title": "Ana Lopez",
          "subtitle": "Notion course · ana@example.com · #12CD7788",
          "meta": { "amount": 49, "currency": "USD", "status": "paid", "date": "2026-10-12T09:30:00.000Z" },
          "path": "/orders-one-time/6711a3d59e3f1a0012cd7788",
          "image": null,
          "match": "email"
        }
      ]
    },
    { "type": "customers", "hasMore": false, "hits": [] },
    { "type": "products", "hasMore": false, "hits": [] },
    { "type": "subscriptions", "hasMore": false, "hits": [] },
    {
      "type": "discounts",
      "hasMore": false,
      "hits": [
        {
          "id": "6711a3d59e3f1a0012cd7701",
          "type": "discounts",
          "title": "ANA20",
          "subtitle": "Ana's friends",
          "meta": { "value": 20, "valueType": "percentage", "status": "active", "date": "2026-10-01T10:00:00.000Z" },
          "path": "/discounts/6711a3d59e3f1a0012cd7701",
          "image": null,
          "match": "code"
        }
      ]
    }
  ]
}
```

| Parameter | Required | Notes |
| - | - | - |
| `q` | yes | What to look for. Cut to 100 characters. One character returns empty groups. |
| `types` | no | Comma-separated: `orders`, `customers`, `products`, `subscriptions`, `discounts`. Default: all of them. An unknown type answers `400`. |
| `limit` | no | Hits per type, 1 to 20. Default `5`. |

## What it matches

| Type | Matches |
| - | - |
| `orders` | The start of the buyer's email, the buyer's first or last name, the order id (full, with or without `#`, or its first 6+ characters) and the amount (`49` finds 49.00 to 49.99, `49.99` finds exactly that). Subscription payments are not orders here; find them under `subscriptions`. |
| `customers` | The start of the email, first name or last name (`ana lo` = first name `ana…`, last name `lo…`), and the id. |
| `products` | Any word of a product or subscription-offer name (`course` finds "Notion course"), the start of a product's slug, and the id. `meta.kind` says `product` or `subscription`. |
| `subscriptions` | Subscribers: the start of their email, their name, and the name of the offer they are on. |
| `discounts` | The start of the code, any word of the discount name, and the id. |

Matching ignores case. Text is matched literally: `a.b+c` finds the email
`a.b+c@example.com` and nothing else.

Each group lists up to `limit` hits, an id match first, then newest first.
`hasMore: true` means more records match: use the list endpoints
(`GET /orders`, `GET /customers`, …) with their filters to page through them.

## The hit

| Field | Notes |
| - | - |
| `id` | Pass it to the matching get endpoint (`GET /orders/{id}`, `GET /customers/{id}`, `GET /products/{id}`, `GET /discounts/{id}`). |
| `title` / `subtitle` | What the dashboard shows: the buyer's name or email, the product name, the discount code. |
| `meta` | `amount` and `currency` (major units: `49.99` is \$49.99), `status`, `date`, and per type `interval`, `kind`, `value` / `valueType`, `country`. |
| `path` | Opens the record in the dashboard: `https://app.pocketsflow.com` + `path`. |
| `match` | What matched: `id`, `email`, `name`, `amount`, `code`, `slug`, or `product` (a subscriber of an offer whose name matched). |

## Test mode

A `pk_test_` key searches your test data, a `pk_live_` key your live data.
`testMode` in the answer says which.

## Team members

In the dashboard a team member searches the store they work on, and only
gets the types of the areas their teams have: **Orders, customers and
refunds** gives `orders`, `customers` and `subscriptions`; **Products and
store design** gives `products`; **Discounts, upsells and affiliates** gives
`discounts`. Owners and admins get everything.

## Limits

120 searches per minute per account, on top of the general 600 requests per
minute. Past it the API answers `429` with `code: "RATE_LIMITED"`.

## MCP

AI agents connected through the [MCP server](/api-reference/mcp-server) call
the same search as the `search_store` tool.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.