Schedule API

The Schedule API allows you to create, retrieve, and delete schedules. Schedules are charges or transfers that occur at regular intervals, for example, a monthly membership fee or a weekly transfer. Actual schedule dates are accessed via the occurrence API.

Attribute

Name Type Description
object string

The string schedule.

id object_id

The SCHEDULE_ID matching /schd(_test)?_[1-9a-z]+/.

livemode boolean

Whether this is a live (true) or test (false) schedule.

location string

API path to retrieve the current schedule object.

charge Charge Schedule

For charge schedules, use charge schedule object.

created datetime

The UTC datetime of the creation of the schedule in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

deleted boolean

Whether the schedule is deleted.

end_date Date

The end date of the schedule in ISO 8601 format.

every integer

How often the schedule runs. E.g.: Every 3 weeks.

in_words string

The schedule, in english. E.g.: Every 2 months on the 15th, Every 3 days, Every week on monday and friday.

next_occurrence_dates Array

An array of up to 30 upcoming occurrence dates in ISO 8601 format. Returns an empty array in case of expired, suspended or deleted schedule.

occurrences list

A list of occurrence objects.

on On

An object specifying the scheduled day. Use the "On" object.

period string

day, week or month. E.g.: Every 3 weeks.

start_date Date

The start date of the schedule in ISO 8601 format.

status string

One of:

  • active: The schedule is running.
  • expiring: The schedule's next occurrence is its last.
  • expired: The schedule has reached its last occurrence and is not running anymore.
  • deleted: The schedule has been deleted and is not running anymore.
  • suspended: The schedule could not be completed and was stopped.
.

transfer Transfer Schedule

For transfer schedules, use transfer schedule object.

List all schedules

- GET https://api.omise.co/schedules/

Returns a list of all schedule objects belonging to your account.

Request Parameter

Name Type Description
offset integer

(optional, default: 0) The offset of the first record returned (i.e. how many records to skip from the beginning).

limit integer

(optional, default: 20, maximum: 100) The number of records returned.

from datetime

(optional, default: 1970-01-01T00:00:00Z) The earliest UTC date and time for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

to datetime

(optional, default: current UTC datetime) The latest UTC date and time for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

order string

(optional, default: chronological) The order of the list returned. Either chronological (earliest to latest) or reverse_chronological (latest to earliest).

Example

  • List all schedules

Create a schedule

- POST https://api.omise.co/schedules/

See the specific documentation page for charge schedules or transfer schedules.

Retrieve a schedule

- GET https://api.omise.co/schedules/SCHEDULE_ID

Returns an existing schedule object

Example

  • Retrieve a schedule

Destroy a schedule

- DELETE https://api.omise.co/schedules/SCHEDULE_ID

Destroys and returns an existing schedule object

Example

  • Destroy a schedule