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

Search Query and Filters

The Search API enables you to query records within a specified data type (scope). Use query parameters for text searches across multiple fields, or filters for precise matching on specific attributes.

A basic search requires the scope parameter and returns paginated results (30 per page by default) with newest items first.

curl https://api.omise.co/search?scope=charge \
-u $OMISE_SECRET_KEY:

Query Parameterโ€‹

The query parameter searches across scope-specific text attributes:

# Search for charges with "somchai" in searchable fields
curl https://api.omise.co/search?scope=charge&query=somchai \
-u $OMISE_SECRET_KEY:

The query searches across multiple fields depending on the scope. For charges, it searches id, card_bank, card_name, description, failure_message, and metadata.

Filters Parameterโ€‹

The filters parameter matches objects meeting specific conditions:

# Find charges of exactly 1000 THB
curl "https://api.omise.co/search?scope=charge&filters[amount]=1000&filters[currency]=THB" \
-u $OMISE_SECRET_KEY:

Boolean Valuesโ€‹

Boolean filters accept natural language equivalents:

True ValuesFalse Values
yesno
onoff
truefalse
# Find captured charges
curl "https://api.omise.co/search?scope=charge&filters[captured]=yes" \
-u $OMISE_SECRET_KEY:

Range Syntaxโ€‹

Use .. to specify ranges for numeric and date fields:

Numeric ranges:

# Find charges between 1000 and 5000 (in base currency units)
curl "https://api.omise.co/search?scope=charge&filters[amount]=1000..5000" \
-u $OMISE_SECRET_KEY:

Date ranges:

# Find charges created in January 2025
curl "https://api.omise.co/search?scope=charge&filters[created]=2025/01/01..2025/01/31" \
-u $OMISE_SECRET_KEY:

Relative date ranges:

ValueDescription
todayCurrent day
yesterdayPrevious day
this_weekCurrent week
last_weekPrevious week
this_monthCurrent month
last_monthPrevious month
# Find charges created this month
curl "https://api.omise.co/search?scope=charge&filters[created]=this_month" \
-u $OMISE_SECRET_KEY:
Amount Units

For searching amount fields, use the base unit for a given currency (e.g., 100 for 100 THB), not the smallest unit/subunit (e.g., 10000 satang).

Additional Parametersโ€‹

Expand Objectsโ€‹

Use expand=true to return ID fields as full objects:

curl "https://api.omise.co/search?scope=charge&expand=true" \
-u $OMISE_SECRET_KEY:

Export Resultsโ€‹

Use export=true with filter_type to create exports:

curl "https://api.omise.co/search?scope=charge&export=true&filter_type=monthly_captured" \
-u $OMISE_SECRET_KEY:

Available filter types:

  • monthly_captured - Captured charges for the month
  • monthly_created - Created charges for the month
  • monthly_date - Charges by date for the month

Searchable Scopesโ€‹

chargeโ€‹

Search for charges and payments.

Filterable attributes:

AttributeTypeDescription
amountintegerCharge amount in base currency units
authorizedbooleanWhether the charge is authorized
capturebooleanWhether auto-capture is enabled
capturedbooleanWhether the charge has been captured
captured_atdatetimeWhen the charge was captured
credit_card_brandstringCard brand (visa, mastercard, etc.)
card_last_digitsstringLast 4 digits of the card
createddatetimeWhen the charge was created
currencystringCurrency code
disputedbooleanWhether the charge is disputed
failure_codestringFailure code if failed
fraudbooleanWhether flagged for fraud
is_installmentbooleanWhether it's an installment payment
refundedbooleanWhether the charge has been refunded
refund_amountintegerTotal refunded amount
scheduledbooleanWhether it's a scheduled charge
source_of_fundstringSource of funds
source_typestringPayment source type
statusstringCharge status
voidedbooleanWhether the charge was voided
installment_termsintegerNumber of installment terms

Queryable attributes: id, card_bank, card_name, description, failure_message, metadata

customerโ€‹

Search for customer records.

Filterable attributes:

AttributeTypeDescription
createddatetimeWhen the customer was created

Queryable attributes: id, description, email, metadata

disputeโ€‹

Search for dispute records.

Filterable attributes:

AttributeTypeDescription
amountintegerDisputed amount
card_first_digitsstringFirst 6 digits of the card
card_last_digitsstringLast 4 digits of the card
charge_idstringAssociated charge ID
closed_atdatetimeWhen the dispute was closed
createddatetimeWhen the dispute was created
currencystringCurrency code
fraudbooleanWhether flagged as fraud
statusstringDispute status

Queryable attributes: id, card_brand, card_id, card_name, metadata, message, reason_code, reason_message

Search for payment links.

Filterable attributes:

AttributeTypeDescription
amountintegerLink amount
createddatetimeWhen the link was created
currencystringCurrency code
multiplebooleanWhether multiple payments allowed
usedbooleanWhether the link has been used
used_atdatetimeWhen the link was used

Queryable attributes: id, description, link_reference, title

receiptโ€‹

Search for receipt records.

Filterable attributes:

AttributeTypeDescription
createddatetimeWhen the receipt was created

Queryable attributes: id

recipientโ€‹

Search for transfer recipients.

Filterable attributes:

AttributeTypeDescription
activebooleanWhether the recipient is active
activated_atdatetimeWhen the recipient was activated
bank_last_digitsstringLast digits of bank account
createddatetimeWhen the recipient was created
deletedbooleanWhether the recipient is deleted
failure_codestringVerification failure code
typestringRecipient type (individual/corporation)
verifiedbooleanWhether the recipient is verified
verified_atdatetimeWhen the recipient was verified

Queryable attributes: id, bank_name, bank_brand, description, email, metadata, name, tax_id

refundโ€‹

Search for refund records.

Filterable attributes:

AttributeTypeDescription
amountintegerRefund amount
card_first_digitsstringFirst 6 digits of the card
card_last_digitsstringLast 4 digits of the card
charge_idstringAssociated charge ID
createddatetimeWhen the refund was created
statusstringRefund status
voidedbooleanWhether the refund was voided

Queryable attributes: id, card_bank, card_brand, card_id, card_name, charge_description, currency, metadata

transferโ€‹

Search for transfer records.

Filterable attributes:

AttributeTypeDescription
amountintegerTransfer amount
createddatetimeWhen the transfer was created
currencystringCurrency code
feeintegerTransfer fee
paidbooleanWhether the transfer has been paid
paid_atdatetimeWhen the transfer was paid
sentbooleanWhether the transfer has been sent
sent_atdatetimeWhen the transfer was sent

Queryable attributes: id, bank_name, bank_brand, failure_code, failure_message, metadata, recipient_email, recipient_id, recipient_name, transaction_id

transactionโ€‹

Search for transaction records.

Filterable attributes:

AttributeTypeDescription
amountintegerTransaction amount
createddatetimeWhen the transaction was created
currencystringCurrency code
hold_untildatetimeHold expiration date
kindstringTransaction type

Queryable attributes: id, record_id

charge_scheduleโ€‹

Search for charge schedules (recurring payments).

Filterable attributes:

AttributeTypeDescription
statusstringSchedule status
activebooleanWhether the schedule is active
amountintegerScheduled charge amount
createddatetimeWhen the schedule was created
card_last_digitsstringLast 4 digits of the card

Queryable attributes: recurrence_id, currency, description, customer_email, card_brand, card_bank, card_name

transfer_scheduleโ€‹

Search for transfer schedules.

Filterable attributes:

AttributeTypeDescription
statusstringSchedule status
activebooleanWhether the schedule is active
createddatetimeWhen the schedule was created

Queryable attributes: recurrence_id, recipient_name


Examplesโ€‹

Find High-Value Captured Chargesโ€‹

curl "https://api.omise.co/search?scope=charge&filters[amount]=10000..&filters[captured]=true&filters[created]=this_month" \
-u $OMISE_SECRET_KEY:

Find Customers by Email Domainโ€‹

curl "https://api.omise.co/search?scope=customer&query=@company.com" \
-u $OMISE_SECRET_KEY:

Find Pending Disputesโ€‹

curl "https://api.omise.co/search?scope=dispute&filters[status]=pending" \
-u $OMISE_SECRET_KEY:

Find Failed Transfersโ€‹

curl "https://api.omise.co/search?scope=transfer&filters[paid]=false&query=failure" \
-u $OMISE_SECRET_KEY:

FAQโ€‹

Can I combine query and filters in the same request?

Yes, you can use both query and filters parameters together. The query searches text fields while filters match exact attribute values. Results must match both conditions.

What is the difference between query and filters?

The query parameter performs text search across multiple fields (like a search box), while filters match exact values on specific attributes. Use query for fuzzy text matching and filters for precise filtering.

How do I search within metadata?

Use the query parameter to search metadata content. For example, query=order123 will find records where metadata contains "order123". Note that metadata is only queryable, not filterable.

What date formats are supported?

Dates can be specified as YYYY/MM/DD, YYYY-MM-DD, or using relative values like today, this_week, this_month. Ranges use the .. syntax: 2025/01/01..2025/01/31.

Why are my amount searches not returning expected results?

Remember to use base currency units, not subunits. For THB, search for 1000 to find 1000 THB charges, not 100000 (which would be in satang).

How many results are returned per page?

The Search API returns 30 results per page by default. Use pagination parameters to navigate through larger result sets.


Try it Outโ€‹

Test the Search API interactively using the Universal Search page. Enter your API key, select a scope, and experiment with different query and filter combinations.

Quick test examples:

# Search charges with a query
curl "https://api.omise.co/search?scope=charge&query=test" \
-u $OMISE_SECRET_KEY:

# Filter by status and date range
curl "https://api.omise.co/search?scope=charge&filters[status]=successful&filters[created]=this_month" \
-u $OMISE_SECRET_KEY:

# Search customers by email
curl "https://api.omise.co/search?scope=customer&query=@gmail.com" \
-u $OMISE_SECRET_KEY: