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

Search Receipts

Search receipts by various criteria. This endpoint allows you to find specific receipts using filters such as date ranges, amounts, and other receipt attributes.

Request Parametersโ€‹

Search - 3 fieldsSearch Parameters
โ–ผ
`query`STRING(optional)
Search query string. Searches across receipt fields including description, metadata, and reference numbers.
Example:"order_12345"
`scope`STRING(optional)
Limit search to specific fields within receipts.
Example:"metadata"
`filters`OBJECT(optional)
Additional filters to narrow search results. Can include amount ranges, currency, and other receipt attributes.
Example:{"currency":"thb"}
Date Range - 2 fieldsDate Range Parameters
Pagination - 3 fieldsPagination Parameters

Responsesโ€‹

200

Successful search

Search completed successfully. Returns a paginated list of matching receipts.

Response structure:
  • object - Always returns "search"
  • data - Array of receipt objects matching the search criteria
  • limit - Records per page
  • offset - Number of records skipped
  • total - Total number of receipts matching the search
  • query - The search query that was executed

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Invalid date format in from/to parameters
  • Invalid filter syntax
  • Invalid query string format
  • Limit exceeds maximum allowed value

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

The search endpoint or requested resource was not found.

Common causes:
  • Invalid endpoint URL
  • Incorrect API version

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/receipts/receipts/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-G \
-d "query=order_12345" \
-d "from=2025-01-01T00:00:00Z" \
-d "limit=20"

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
bad_requestMissing or invalid parametersCheck parameter values and formats
authentication_failureInvalid API keyVerify your secret key is correct
invalid_date_formatDate format validation failedUse ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)
invalid_querySearch query format is invalidCheck query string syntax

Receipt Object Fieldsโ€‹

FieldTypeDescription
objectstringAlways returns "receipt"
idstringReceipt identifier (rcpt_*)
livemodebooleanProduction vs test environment indicator
locationstringAPI path to the receipt object
adjustment_transactionstringAssociated adjustment transaction ID
charge_feeintegerOmise charge fee in smallest currency unit
company_addressstringOmise company address
company_namestringOmise company name
company_tax_idstringOmise company tax ID
credit_notebooleanWhether this is a credit note
currencystringThree-letter ISO 4217 code
customer_addressstringMerchant address
customer_emailstringMerchant email
customer_namestringMerchant name
customer_statement_namestringMerchant statement name
customer_tax_idstringMerchant tax ID
issued_onstringDate the receipt was issued
numberstringReceipt number
subtotalintegerSubtotal before tax
totalintegerCalculated as subtotal + vat - wht
transaction_feeintegerTransaction fee in smallest currency unit
transfer_feeintegerTransfer fee in smallest currency unit
vatintegerVAT amount
voided_feeintegerVoided fee amount
whtintegerWithholding tax amount
created_atstringUTC datetime in ISO 8601 format

๐Ÿ”‘API Credentials

Try it outโ€‹

Additional - 5 fields
Your IP: ...Loading...