List all charges
Retrieve a paginated list of all charges. Returns charges sorted by creation date with filtering capabilities.
API Credentials
Request Parametersโ
Recommended - 3 fieldsRecommended Parameters
`limit`INTEGER(optional)
Number of charges to return per page.
`offset`INTEGER(optional)
Number of charges to skip for pagination. Use with limit to navigate through pages.
`order`STRING(optional)
Sort order by creation date.
Additional - 3 fieldsAdditional Parameters
Responsesโ
200
Successful list retrievalReturns a list object containing charge data array and pagination metadata.
Response includes:
data- Array of charge objectstotal- Total number of charges matching filterslimit- Number of items per pageoffset- Current pagination offsetorder- Sort order appliedfrom/to- Date range applied
400
Bad requestInvalid parameters provided.
Common causes:
- Invalid date format (must be ISO 8601)
- Limit out of range (must be 1-100)
- Invalid customer ID format
401
UnauthorizedAuthentication failed. Invalid or missing API key.
Common causes:
- Missing Authorization header
- Invalid secret key
- Using public key instead of secret key
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl "https://api.omise.co/charges?limit=20&offset=0" \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
charges = Omise::Charge.list(limit: 20, offset: 0)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
charges = omise.Charge.list(limit=20, offset=0)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const charges = await omise.charges.list({
limit: 20,
offset: 0
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$charges = OmiseCharge::retrieve(array(
'limit' => 20,
'offset' => 0
));
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
ScopedList<Charge> charges = client.charges().list()
.limit(20)
.offset(0)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var charges = await client.Charges.GetList(new ListOptions {
Limit = 20,
Offset = 0
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
charges, _ := client.ListCharges(&operations.ListCharges{
List: operations.List{
Limit: 20,
Offset: 0,
},
})
Error and result codesโ
Common Usage Patternsโ
| Pattern | Description | Example |
|---|---|---|
| Basic pagination | Fetch pages sequentially | limit=20&offset=0, then offset=20, etc. |
| Date range filter | Filter by creation date | from=2025-01-01T00:00:00Z&to=2025-01-31T23:59:59Z |
| Customer history | Get all charges for a customer | customer=cust_test_5xuy4w91xqz7d1w9u0t |
| Recent first | Newest charges first | order=reverse_chronological |
Pagination Calculationโ
| Field | Calculation | Use |
|---|---|---|
| Next page | offset + limit | Get next set of results |
| Previous page | offset - limit (min 0) | Go back to previous page |
| Has more | offset + limit < total | Check if more pages exist |
| Page number | (offset / limit) + 1 | Current page number |
Try it outโ
Recommended - 3 fields
Additional - 3 fields