Filtering
Payonify supports filtering of list endpoints to help you find specific resources. You can filter charges, refunds, checkout sessions, and payouts by various attributes to narrow down your results.
Supported Filters
The API supports the following filter parameters for the list endpoints:
| Filter | Description | Format | Example |
|---|---|---|---|
status | Filter by the current status of the resource | String | status=succeeded |
start_date | Filter resources created on or after this date | YYYY-MM-DD | start_date=2025-01-15 |
end_date | Filter resources created on or before this date | YYYY-MM-DD | end_date=2025-04-30 |
currency | Filter by currency | Three-letter ISO code | currency=usd |
Using Filters
You can combine filters to narrow down your search by adding them as query parameters to the list endpoints:
Code
This example retrieves all successful charges made in January 2025 in USD currency.
Date Filters
Date filters (start_date and end_date) allow you to search for resources within a specific time range:
- Format: ISO 8601 date format (YYYY-MM-DD)
- Time zone: All dates are interpreted in UTC+2
- Range: Both
start_dateandend_dateare inclusive
If you provide an incorrect date format, the parameter will be ignored without returning an error.
Examples:
-
Filter charges created on or after January 1, 2025:
Code -
Filter refunds created between March 15, 2025 and April 15, 2025:
Code
Status Filters
Each resource type has different possible status values:
Charge Statuses:
requires_payment_method- The charge has been created but no payment method has been providedrequires_authorization- The charge requires customer authorizationpending- The charge is being processedsucceeded- The charge completed successfullyfailed- The charge failed to processcancelled- The charge was cancelled
Refund Statuses:
pending- The refund has been created but not yet processedprocessing- The refund is in progresssucceeded- The refund completed successfullyfailed- The refund failed to processcancelled- The refund was cancelled
Checkout Session Statuses:
open- The checkout session is active and can be usedcomplete- The checkout was completed successfullyexpired- The checkout session has expired
Payout Statuses:
pending- The payout has been created and is being processedpaid- The payout completed successfully and funds have been deliveredfailed- The payout failed to process
Currency Filters
Use the currency parameter to filter by transaction currency:
- Supported values:
usd,zwg - Format: Three-letter ISO currency code (case-insensitive)
Examples:
-
Filter checkout sessions in ZWG currency:
Code -
Filter payouts by status and date range:
Code
Combining Filters with Pagination
Filters can be combined with pagination parameters to create powerful queries:
Code
This example retrieves up to 5 successful USD charges created on or after January 1, 2025, starting after the specified cursor.
Error Handling
- If an invalid status value is provided, the API will return a
400 Bad Requesterror with an appropriate error message - If an invalid currency is provided, the API will return a
400 Bad Requesterror - Invalid date formats are silently ignored without causing an error
Performance Considerations
Using appropriate filters can significantly improve the performance of your API requests by reducing the amount of data that needs to be processed. When working with large datasets, combining filters with pagination is recommended to ensure optimal performance.