Skip to main content
Version: 2019-05-29 (Current)

Search sub-merchants

Search and filter sub-merchants to find merchants by name, email, business details, metadata, and more. The Search API provides powerful full-text search capabilities across all sub-merchants in your platform.


Request Parametersโ€‹

Recommended - 2 fieldsRecommended Parameters
โ–ผ
`query`STRING(optional)
Search query string. Searches across sub-merchant name, email, business name, description, and metadata. Supports multiple words (AND logic) and partial matches.
Example:"acme electronics"
`filters`OBJECT(optional)
Filter criteria to narrow search results. Common filters include status, type, business_category, and created date ranges.
Example:{"status":"active","type":"business"}
Pagination - 3 fieldsPagination Parameters

Responsesโ€‹

200

Successful search

Search completed successfully. Returns a search result object with matching sub-merchants in the data array.

Response includes:
  • object - Always "search"
  • data - Array of sub-merchant objects matching the search criteria
  • total - Total number of results matching the search
  • total_pages - Number of pages available
  • page - Current page number
  • per_page - Number of results per page
  • order - Sort order applied (chronological or reverse_chronological)

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Invalid page number (below 1)
  • Invalid per_page value (above 100 or below 1)
  • Malformed filters object
  • Invalid filter field name

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

404

Not found

Platform account not found or sub-merchant feature not enabled.

Common causes:
  • Account is not a platform account
  • Sub-merchant feature not enabled
  • Contact support to enable platform features

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

curl https://api.omise.co/sub_merchants/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "query=acme electronics" \
-d "filters[status]=active" \
-d "filters[type]=business"

Search examplesโ€‹

Search by name or emailโ€‹

curl https://api.omise.co/sub_merchants/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "query=john@example.com"

Search with status filterโ€‹

curl https://api.omise.co/sub_merchants/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "filters[status]=pending"

Search by business categoryโ€‹

curl https://api.omise.co/sub_merchants/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "filters[business_category]=electronics_retail"

Search by date rangeโ€‹

curl https://api.omise.co/sub_merchants/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "filters[created][gte]=2025-01-01" \
-d "filters[created][lte]=2025-03-31"

Combined search with multiple filtersโ€‹

curl https://api.omise.co/sub_merchants/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "query=premium" \
-d "filters[status]=active" \
-d "filters[type]=business" \
-d "filters[business_category]=electronics_retail" \
-d "per_page=50"

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
bad_requestMissing or invalid parametersCheck that parameters are valid
authentication_failureInvalid API keyVerify your secret key is correct
platform_not_enabledPlatform features not enabledContact support to enable platform account

Search Filter Optionsโ€‹

FilterTypeDescription
statusstringSub-merchant status (pending, active, suspended, deactivated, rejected)
typestringSub-merchant type (individual, business)
business_categorystringBusiness category code
createdobjectDate range filter (e.g., {gte: '2025-01-01', lte: '2025-01-31'})

Searchable Fieldsโ€‹

The search query matches against the following fields:

  • name - Sub-merchant display name
  • email - Contact email
  • business_name - Registered business name
  • description - Internal description
  • metadata - Custom metadata values

๐Ÿ”‘API Credentials

Try it outโ€‹

Recommended - 2 fields
Additional - 3 fields
Your IP: ...Loading...