Charge Schedule API

The Charge Schedule API allows you to create, retrieve, and delete charge schedules, a type of schedule. To create a new charge schedule, create a new schedule and populate the charge field with this object.

Attribute

Name Type Description
amount integer

Amount for charge schedule in smallest currency unit.

card card

The CARD_ID to be charged. Empty in case the default_card of CUSTOMER_ID is charged.

currency string

Currency for charge schedule as three-letter ISO 4217 code.

customer object_id

The CUSTOMER_ID to be charged.

description string

Description of the charge schedule.

Example

  • Json Response

List all charge schedules

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

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

Request Parameter

Name Type Description
offset integer

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

limit integer

(optional, default: 20, maximum: 100) Number of records to return.

from datetime

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

to datetime

(optional, default: current UTC datetime) Latest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

order string

(optional, default: chronological) Order in which to return records. One of chronological (earliest to latest) or reverse_chronological (latest to earliest).

Example

  • List all charge schedules

List all charge schedules for a given customer

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

Returns a list of schedule objects. Returns all charge schedules that belong to a given customer.

Request Parameter

Name Type Description
offset integer

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

limit integer

(optional, default: 20, maximum: 100) Number of records to return.

from datetime

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

to datetime

(optional, default: current UTC datetime) Latest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

order string

(optional, default: chronological) Order in which to return records. One of chronological (earliest to latest) or reverse_chronological (latest to earliest).

Example

  • List all charge schedules for a customer.

Retrieve a charge schedule

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

See schedules documentation for more information.

Create a charge schedule

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

Creates and returns a new charge schedule object.

Request Parameter

Name Type Description
every integer

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

period string

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

on On

The on object has the following structure based on the value of period:

  • If period is day, omit on object entirely.
  • If period is week, on object has following structure: { weekdays: [''Monday'', ''Wednesday''] }.
  • If period is month, on object has one of two structures:
    • { days_of_month: [1, 15, 20] } (1 through 28 only)
    • { weekday_of_month: "second_monday" }.
start_date Date

When the schedule should start, in ISO 8601 format (YYYY-MM-DD). Defaults to today.

end_date Date

When the schedule should end, in ISO 8601 format (YYYY-MM-DD).

charge Charge Schedule
  • amount: The amount to be charged
  • currency: The currency to be used for said charge.
  • description: The description that is applied to all charges created by this schedule.
  • customer: The customer ID to be charged.
  • card: The card uid to be charged. Empty in case the default card is charged.

Example

  • Charge to a specific customer every 2 days

  • Charge every Monday and Friday

  • Charge on the 1st, 10th and 15th every 3 months

  • Charge on the second Monday every month

Destroy a charge schedule

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

See schedules documentation for more information.