Retrieve a schedule
Retrieve details of a specific schedule including status, frequency, next execution dates, and occurrence history. Use this endpoint to check subscription status, view payment history, and monitor upcoming charges.
API Credentials
Request Parametersโ
Required - 1 fieldPath Parameters
`id`STRING(required)
The schedule ID to retrieve. Schedule IDs start with schd_ followed by test_ for test mode.
Responsesโ
200
Successful retrievalReturns the schedule object with complete details including configuration, status, and occurrence history.
Schedule object includes:
id- Schedule identifier (schd_*)status- active, expired, suspended, deleted, or pausedevery- Frequency multiplier (1, 2, 3, etc.)period- Time unit (day, week, month)on- Specific timing configuration (days_of_month, weekday_of_month)next_occurrences_on- Array of upcoming execution dateschargeortransfer- Operation parametersstart_dateandend_date- Schedule duration
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
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/schedules/schd_test_5xuy4w91xqz7d1w9u0t \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
schedule = Omise::Schedule.retrieve('schd_test_5xuy4w91xqz7d1w9u0t')
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
schedule = omise.Schedule.retrieve('schd_test_5xuy4w91xqz7d1w9u0t')
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const schedule = await omise.schedules.retrieve('schd_test_5xuy4w91xqz7d1w9u0t');
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$schedule = OmiseSchedule::retrieve('schd_test_5xuy4w91xqz7d1w9u0t');
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Schedule schedule = client.schedules().get("schd_test_5xuy4w91xqz7d1w9u0t");
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var schedule = await client.Schedules.Get("schd_test_5xuy4w91xqz7d1w9u0t");
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
schedule, _ := client.GetSchedule("schd_test_5xuy4w91xqz7d1w9u0t")
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) |
Schedule Status Valuesโ
| Status | Description |
|---|---|
active | Schedule is running normally |
expired | Schedule has passed end date |
suspended | Schedule is paused (failures, card expiry) |
deleted | Schedule has been cancelled |
paused | Schedule manually paused |
Try it outโ
Required - 1 fields