Skip to content

Search orders, customers and products

GET
/stores/{storeRef}/search/admin
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/stores/example/search/admin?q=nguyen&limit=5' \
--header 'x-api-key: <x-api-key>'

Searches the store’s customers, orders and products at once and returns up to limit matches per type, grouped by type. Results are filtered by the key’s scopes: a key without a type’s read scope gets no group for that type, instead of an error. Use types to narrow the search.

Required scopes: none. Any secret key for this store works.

storeRef
required
string

The store’s ref, as returned by GET /stores.

q
required
string
>= 2 characters <= 100 characters

Example

nguyen

Search term

limit
number
default: 5 >= 1 <= 20

Max results per type

Media typeapplication/json
object
groups
required

One group per object type the key may read, in the order customers, orders, products. A type that failed to search is left out.

Array<object>
object
type
required

The object type: customers, orders or products.

string
Allowed values: customers orders products
items
required

The best matches, up to limit.

Array<object>
object
image_url

Image URL, for products.

string
nullable
amount

A money amount in the store’s currency, such as an order total.

number
nullable
id
required

The record’s ID, as a string.

string
title
required

The main text to show: a customer or product name, or an order code.

string
subtitle

A second line of text, such as an email address.

string
badge

A short status label, such as an order status.

string
total
required

Number of records of this type that match.

number
query
required

The search term that was used.

string

Example

{
"groups": [
{
"type": "customers"
}
]
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}