Schedules API
The Schedules API allows you to create and manage recurring payments and automated transfers on a schedule.
Available Endpointsโ
- List Schedules - GET /schedules
- Retrieve Schedule - GET /schedules/:id
Overviewโ
Schedules enable automated recurring operations:
- Recurring charges - Automatically charge customers on a schedule
- Recurring transfers - Automatically transfer funds to recipients
- Flexible frequencies - Daily, weekly, monthly schedules
- Occurrence tracking - Track each execution of a schedule
Common Use Casesโ
- Subscription billing (monthly/annual charges)
- Scheduled payouts to marketplace vendors
- Recurring donations
- Membership fees
- Automated commission payments
How Schedules Workโ
- Create a schedule with frequency (daily, weekly, monthly)
- Schedule executes automatically at specified intervals
- Each execution creates an "occurrence"
- Occurrences link to the actual charge or transfer created
- Monitor schedule status and occurrence results
Authenticationโ
All Schedule API endpoints require authentication using your secret key.
Schedule Frequenciesโ
Schedules support the following frequencies:
| Frequency | Description | Example Use Case |
|---|---|---|
daily | Runs every day at specified time | Daily payouts |
weekly | Runs once per week on specified day | Weekly subscriptions |
monthly | Runs once per month on specified day | Monthly billing |
Schedule Status Lifecycleโ
A schedule progresses through these statuses:
active- Schedule is running and will execute on schedulesuspended- Schedule is paused (can be resumed)deleted- Schedule is permanently disabledcompleted- Schedule reached its end date
Occurrencesโ
Each time a schedule executes, it creates an occurrence. Occurrences have their own statuses:
scheduled- Occurrence is queued to runrunning- Occurrence is currently executingsuccessful- Occurrence completed successfullyfailed- Occurrence failed (payment declined, insufficient balance, etc.)skipped- Occurrence was skipped (e.g., schedule was suspended)
Best Practicesโ
1. Handle Failed Occurrencesโ
Not all scheduled operations will succeed. Implement webhook handlers for:
schedule.occurrence.failed- Handle failed payments/transfersschedule.occurrence.successful- Track successful operations
2. Monitor Schedule Healthโ
Regularly check schedule status and recent occurrences:
- High failure rates may indicate customer payment issues
- Suspended schedules won't execute until reactivated
3. Set End Datesโ
For fixed-term subscriptions, set an end_date:
{
"period": "month",
"end_date": "2027-12-31"
}
4. Use Metadataโ
Store subscription details in metadata for easy lookup:
{
"metadata": {
"plan": "premium",
"customer_id": "cust_123",
"subscription_id": "sub_456"
}
}
Limitationsโ
- Minimum schedule interval: 1 day
- Maximum active schedules per account: Contact support for limits
- Schedules cannot be edited after creation (must delete and recreate)
- Failed occurrences are not automatically retried
Error Handlingโ
Common errors when working with schedules:
| Error Code | Description | Solution |
|---|---|---|
invalid_frequency | Invalid period value | Use daily, weekly, or monthly |
invalid_start_date | Start date in the past | Use future date |
insufficient_balance | Not enough balance for transfer | Add funds before schedule runs |
invalid_recipient | Recipient not found or inactive | Verify recipient exists |
Related Resourcesโ
- Occurrences API - View schedule execution history
- Recurring Payments Guide - Complete subscription implementation
- Webhooks - Handle schedule events