List charge events
Retrieve a paginated list of events for a specific charge. Use this endpoint to monitor charge activity, debug webhooks, and track all events related to a particular charge including creation, completion, refunds, and disputes.
Request Parametersโ
Required - 1 fieldPath Parameters
`id`STRING(required)
The charge ID to retrieve events for. Charge IDs start with chrg_ followed by test_ for test mode.
Optional - 3 fieldsPagination Parameters
`limit`INTEGER(optional)
Number of events to return per page.
`offset`INTEGER(optional)
Number of events to skip for pagination. Use with limit to paginate through large result sets.
`order`STRING(optional)
Sort order of results.
Optional - 2 fieldsFilter Parameters
Responsesโ
200
Successful retrievalReturns a paginated list of event objects for the specified charge. Each event contains complete information about the action that occurred.
Response includes:
data- Array of event objects related to the chargelimit- Number of results per pageoffset- Number of skipped resultstotal- Total number of events for the chargeorder- Sort order applied
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid date format (must be ISO 8601)
- Limit exceeds maximum (100)
- Invalid order parameter
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 foundCharge not found or does not exist.
Common causes:
- Invalid charge ID
- Charge ID from different account
- Mixing test and live mode keys
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/charges/chrg_test_5xuy4w91xqz7d1w9u0t/events \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-G \
-d limit=20 \
-d offset=0
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
charge = Omise::Charge.retrieve('chrg_test_5xuy4w91xqz7d1w9u0t')
events = charge.events({
limit: 20,
offset: 0
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
charge = omise.Charge.retrieve('chrg_test_5xuy4w91xqz7d1w9u0t')
events = charge.events(
limit=20,
offset=0
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const events = await omise.charges.listEvents('chrg_test_5xuy4w91xqz7d1w9u0t', {
limit: 20,
offset: 0
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$charge = OmiseCharge::retrieve('chrg_test_5xuy4w91xqz7d1w9u0t');
$events = $charge->events(array(
'limit' => 20,
'offset' => 0
));
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
ScopedList<Event> events = client.charges()
.listEvents("chrg_test_5xuy4w91xqz7d1w9u0t")
.limit(20)
.offset(0)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var events = await client.Charges.ListEvents("chrg_test_5xuy4w91xqz7d1w9u0t", new ListRequest
{
Limit = 20,
Offset = 0
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
events, _ := client.ListChargeEvents("chrg_test_5xuy4w91xqz7d1w9u0t", &operations.ListEvents{
Limit: 20,
Offset: 0,
})
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
authentication_failure | Invalid API key | Verify your secret key is correct |
bad_request | Invalid parameters | Check date format and parameter values |
invalid_date_format | Date not in ISO 8601 | Use format: YYYY-MM-DDTHH:MM:SSZ |
not_found | Charge not found | Check charge ID and ensure correct mode (test/live) |
Event Types for Chargesโ
| Key | Description |
|---|---|
charge.create | Charge created |
charge.complete | Charge succeeded |
charge.update | Charge updated (e.g., captured, metadata changed) |
charge.reverse | Charge reversed |
charge.expire | Charge expired |
refund.create | Refund processed on the charge |
charge.dispute.create | Dispute filed against the charge |
charge.dispute.update | Dispute status changed |
charge.dispute.close | Dispute resolved |
API Credentials
Try it outโ
Required - 1 fields
Your IP:
...Loading...