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.
`filters`OBJECT(optional)
Filter criteria to narrow search results. Common filters include status, type, business_category, and created date ranges.
Pagination - 3 fieldsPagination Parameters
Responsesโ
200
Successful searchSearch 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 criteriatotal- Total number of results matching the searchtotal_pages- Number of pages availablepage- Current page numberper_page- Number of results per pageorder- Sort order applied (chronological or reverse_chronological)
400
Bad requestRequest 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
UnauthorizedAuthentication 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 foundPlatform 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 errorServer-side error occurred. These are rare but should be handled gracefully.
How to handle:
- Retry the request with exponential backoff
- Check status.omise.co for service incidents
- See Error Handling for detailed guidance
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/sub_merchants/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "query=acme electronics" \
-d "filters[status]=active" \
-d "filters[type]=business"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
results = Omise::SubMerchant.search({
query: 'acme electronics',
filters: {
status: 'active',
type: 'business'
}
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
results = omise.SubMerchant.search(
query='acme electronics',
filters={
'status': 'active',
'type': 'business'
}
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const results = await omise.subMerchants.search({
query: 'acme electronics',
filters: {
status: 'active',
type: 'business'
}
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$results = OmiseSubMerchant::search([
'query' => 'acme electronics',
'filters' => [
'status' => 'active',
'type' => 'business'
]
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Map<String, Object> filters = new HashMap<>();
filters.put("status", "active");
filters.put("type", "business");
SearchResult<SubMerchant> results = client.subMerchants()
.search()
.query("acme electronics")
.filters(filters)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var results = await client.SubMerchants.Search(new SearchRequest
{
Query = "acme electronics",
Filters = new Dictionary<string, object>
{
{ "status", "active" },
{ "type", "business" }
}
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
results, _ := client.SubMerchants().Search(&operations.SearchSubMerchants{
Query: "acme electronics",
Filters: map[string]interface{}{
"status": "active",
"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โ
| Code | Description | Resolution |
|---|---|---|
bad_request | Missing or invalid parameters | Check that parameters are valid |
authentication_failure | Invalid API key | Verify your secret key is correct |
platform_not_enabled | Platform features not enabled | Contact support to enable platform account |
Search Filter Optionsโ
| Filter | Type | Description |
|---|---|---|
status | string | Sub-merchant status (pending, active, suspended, deactivated, rejected) |
type | string | Sub-merchant type (individual, business) |
business_category | string | Business category code |
created | object | Date 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 nameemail- Contact emailbusiness_name- Registered business namedescription- Internal descriptionmetadata- Custom metadata values
API Credentials
Try it outโ
Recommended - 2 fields
Additional - 3 fields
Your IP:
...Loading...