Search orders, customers and products
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/search/admin?q=nguyen&limit=5';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Query Parameters
Section titled “Query Parameters”Example
nguyenSearch term
Max results per type
Responses
Section titled “Responses”object
One group per object type the key may read, in the order customers, orders, products. A type that failed to search is left out.
object
The object type: customers, orders or products.
The best matches, up to limit.
object
Image URL, for products.
A money amount in the store’s currency, such as an order total.
The record’s ID, as a string.
The main text to show: a customer or product name, or an order code.
A second line of text, such as an email address.
A short status label, such as an order status.
Number of records of this type that match.
The search term that was used.
Example
{ "groups": [ { "type": "customers" } ]}The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
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.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}