Search
Search finds things across the whole organisation from one box: customers, invoices, subscriptions, products, plans, quotes.
Over the API it is GET /v1/search. The dashboard's command palette
(⌘K) uses the same search.
Two endpoints
| Endpoint | Returns |
|---|---|
GET /v1/search | Matches across entity types |
GET /v1/search/customer-overview | Everything attached to one customer |
customer-overview is the support query. Instead of four requests for a
customer's subscriptions, invoices, payments and wallets, it answers in one,
which is what you want behind a support tool.
Search versus listing
They are different tools and it is worth being deliberate.
Search is for find the thing I am thinking of: fuzzy, ranked, across types. List endpoints are for give me every X matching these filters: exact, paginated, sortable, and the right choice for anything you will page through or export.
If you are building a table, use the list endpoint. If you are building a box a human types into, use search.
Reference
| Topic | When you need it |
|---|---|
| Customers | The customer record customer-overview summarises |
| Pagination | Paging through list endpoints instead |
| Search API | Parameters, ranking and response shape |