List schedule occurrences
List all occurrences for a specific schedule. Occurrences represent individual executions of the schedule, including past charges/transfers and upcoming scheduled events. Use this endpoint to monitor subscription history, track payment success rates, and view scheduled future payments.
Request Parametersโ
Required - 1 fieldPath Parameters
`id`STRING(required)
The schedule ID to list occurrences for. Schedule IDs start with schd_ followed by test_ for test mode.
Optional - 3 fieldsPagination Parameters
`limit`INTEGER(optional)
Number of occurrences to return per page.
`offset`INTEGER(optional)
Number of occurrences 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 occurrence objects for the specified schedule. Each occurrence represents a single execution event.
Response includes:
data- Array of occurrence objectslimit- Number of results per pageoffset- Number of skipped resultstotal- Total number of occurrencesorder- Sort order applied
id- Occurrence identifier (occu_*)schedule- Parent schedule IDscheduled_on- Date the occurrence was/is scheduledprocessed_at- Timestamp when processed (null if pending)status- scheduled, successful, failed, skippedresult- The charge or transfer ID created (if successful)message- Error message (if failed)
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 foundSchedule not found or does not exist.
Common causes:
- Invalid schedule ID
- Schedule ID from different account
- Mixing test and live mode keys
- Schedule has been deleted
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/schedules/schd_test_5xuy4w91xqz7d1w9u0t/occurrences \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-G \
-d limit=20 \
-d offset=0
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
schedule = Omise::Schedule.retrieve('schd_test_5xuy4w91xqz7d1w9u0t')
occurrences = schedule.occurrences({
limit: 20,
offset: 0
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
schedule = omise.Schedule.retrieve('schd_test_5xuy4w91xqz7d1w9u0t')
occurrences = schedule.occurrences(
limit=20,
offset=0
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const occurrences = await omise.schedules.listOccurrences(
'schd_test_5xuy4w91xqz7d1w9u0t',
{
limit: 20,
offset: 0
}
);
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$schedule = OmiseSchedule::retrieve('schd_test_5xuy4w91xqz7d1w9u0t');
$occurrences = $schedule->occurrences(array(
'limit' => 20,
'offset' => 0
));
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
ScopedList<Occurrence> occurrences = client.schedules()
.listOccurrences("schd_test_5xuy4w91xqz7d1w9u0t")
.limit(20)
.offset(0)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var occurrences = await client.Schedules.ListOccurrences(
"schd_test_5xuy4w91xqz7d1w9u0t",
new ListRequest
{
Limit = 20,
Offset = 0
}
);
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
occurrences, _ := client.ListScheduleOccurrences(
"schd_test_5xuy4w91xqz7d1w9u0t",
&operations.ListOccurrences{
List: operations.List{
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 |
not_found | Schedule not found | Check schedule ID and ensure correct mode (test/live) |
invalid_date_format | Date not in ISO 8601 | Use format: YYYY-MM-DDTHH:MM:SSZ |
Occurrence Status Valuesโ
| Status | Description |
|---|---|
scheduled | Occurrence is pending, not yet executed |
successful | Charge/transfer completed successfully |
failed | Charge/transfer failed (see message for details) |
skipped | Occurrence was skipped (schedule paused or deleted) |
Example Responseโ
{
"object": "list",
"data": [
{
"object": "occurrence",
"id": "occu_test_5xuy4w91xqz7d1w9u0t",
"location": "/occurrences/occu_test_5xuy4w91xqz7d1w9u0t",
"schedule": "schd_test_5xuy4w91xqz7d1w9u0t",
"scheduled_on": "2025-01-15",
"processed_at": "2025-01-15T00:00:05Z",
"status": "successful",
"result": "chrg_test_5xuy4w91xqz7d1w9u0t",
"message": null,
"created_at": "2025-01-01T00:00:00Z"
},
{
"object": "occurrence",
"id": "occu_test_5xuy4w91xqz7d1w9u0u",
"location": "/occurrences/occu_test_5xuy4w91xqz7d1w9u0u",
"schedule": "schd_test_5xuy4w91xqz7d1w9u0t",
"scheduled_on": "2025-02-01",
"processed_at": null,
"status": "scheduled",
"result": null,
"message": null,
"created_at": "2025-01-01T00:00:00Z"
}
],
"limit": 20,
"offset": 0,
"total": 2,
"order": "chronological"
}
API Credentials
Try it outโ
Required - 1 fields
Your IP:
...Loading...