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.
`scope`STRING(optional)
Limit search to specific fields within receipts.
`filters`OBJECT(optional)
Additional filters to narrow search results. Can include amount ranges, currency, and other receipt attributes.
Date Range - 2 fieldsDate Range Parameters
Pagination - 3 fieldsPagination Parameters
Responsesโ
200
Successful searchSearch completed successfully. Returns a paginated list of matching receipts.
Response structure:
object- Always returns "search"data- Array of receipt objects matching the search criterialimit- Records per pageoffset- Number of records skippedtotal- Total number of receipts matching the searchquery- The search query that was executed
400
Bad requestRequest 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
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 foundThe search endpoint or requested resource was not found.
Common causes:
- Invalid endpoint URL
- Incorrect API version
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/receipts/receipts/search \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-G \
-d "query=order_12345" \
-d "from=2025-01-01T00:00:00Z" \
-d "limit=20"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
receipts = Omise::Receipt.search(
query: 'order_12345',
from: '2025-01-01T00:00:00Z',
limit: 20
)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
receipts = omise.Receipt.search(
query='order_12345',
from_date='2025-01-01T00:00:00Z',
limit=20
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const receipts = await omise.receipts.search({
query: 'order_12345',
from: '2025-01-01T00:00:00Z',
limit: 20
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$receipts = OmiseReceipt::search([
'query' => 'order_12345',
'from' => '2025-01-01T00:00:00Z',
'limit' => 20
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
SearchResult<Receipt> receipts = client.receipts().search()
.query("order_12345")
.from("2025-01-01T00:00:00Z")
.limit(20)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var receipts = await client.Receipts.Search(new SearchOptions
{
Query = "order_12345",
From = DateTime.Parse("2025-01-01T00:00:00Z"),
Limit = 20
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
receipts, _ := client.Receipts().Search(&omise.SearchParams{
Query: "order_12345",
From: "2025-01-01T00:00:00Z",
Limit: 20,
})
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
bad_request | Missing or invalid parameters | Check parameter values and formats |
authentication_failure | Invalid API key | Verify your secret key is correct |
invalid_date_format | Date format validation failed | Use ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) |
invalid_query | Search query format is invalid | Check query string syntax |
Receipt Object Fieldsโ
| Field | Type | Description |
|---|---|---|
object | string | Always returns "receipt" |
id | string | Receipt identifier (rcpt_*) |
livemode | boolean | Production vs test environment indicator |
location | string | API path to the receipt object |
adjustment_transaction | string | Associated adjustment transaction ID |
charge_fee | integer | Omise charge fee in smallest currency unit |
company_address | string | Omise company address |
company_name | string | Omise company name |
company_tax_id | string | Omise company tax ID |
credit_note | boolean | Whether this is a credit note |
currency | string | Three-letter ISO 4217 code |
customer_address | string | Merchant address |
customer_email | string | Merchant email |
customer_name | string | Merchant name |
customer_statement_name | string | Merchant statement name |
customer_tax_id | string | Merchant tax ID |
issued_on | string | Date the receipt was issued |
number | string | Receipt number |
subtotal | integer | Subtotal before tax |
total | integer | Calculated as subtotal + vat - wht |
transaction_fee | integer | Transaction fee in smallest currency unit |
transfer_fee | integer | Transfer fee in smallest currency unit |
vat | integer | VAT amount |
voided_fee | integer | Voided fee amount |
wht | integer | Withholding tax amount |
created_at | string | UTC datetime in ISO 8601 format |
API Credentials
Try it outโ
Additional - 5 fields
Your IP:
...Loading...