Skip to main content
Version: 2019-05-29 (Current)

Bulk delete schedules

Permanently delete one or multiple charge schedules in a single request. Deleted schedules will not execute any future occurrences and cannot be restored. Past occurrences and their associated charges are preserved for historical records.

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`schedule_ids`ARRAY(required)
Array of schedule IDs to delete. Each ID must start with schd_. Maximum 100 IDs per request.
Example:"[\"schd_test_5xuy4w91xqz7d1w9u0t\", \"schd_test_5xuy4w91xqz7d1w9u0s\"]"
Constraints:Maximum 100 IDs per request, Deletion is permanent and cannot be undone

Responsesโ€‹

200

Schedules deleted

Returns a summary of the bulk delete operation with details for each schedule.

Response includes:
  • object - Always "bulk_operation"
  • operation - "delete"
  • total_count - Total number of schedule IDs provided
  • successful_count - Number of schedules successfully deleted
  • failed_count - Number of schedules that failed to delete
  • results - Array of result objects for each schedule
Each result object includes:
  • schedule_id - The schedule ID
  • status - "success" or "failed"
  • schedule - Deleted schedule object with deleted=true (if successful)
  • error_code - Error code (if failed)
  • error_message - Error description (if failed)
Important notes:
  • Deletion is permanent and cannot be undone
  • Past charges created by deleted schedules are not affected
  • Any pending occurrences scheduled for today may still execute

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Missing schedule_ids parameter
  • schedule_ids is not an array
  • Empty schedule_ids array
  • More than 100 schedule IDs provided
  • Invalid schedule ID format

401

Unauthorized

Authentication 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 found

Endpoint not found or feature not enabled.

Common causes:
  • Bulk operations feature not enabled for account
  • Incorrect API endpoint URL

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

# Delete multiple schedules
curl https://api.omise.co/schedules/bulk_delete \
-X DELETE \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-H "Content-Type: application/json" \
-d '{
"schedule_ids": [
"schd_test_5xuy4w91xqz7d1w9u0t",
"schd_test_5xuy4w91xqz7d1w9u0s",
"schd_test_5xuy4w91xqz7d1w9u0r"
]
}'

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
authentication_failureInvalid API keyVerify your secret key is correct
invalid_schedule_idsInvalid or missing schedule_idsProvide valid array of schedule IDs
too_many_idsMore than 100 IDs providedSplit into multiple requests

Per-Schedule Error Codesโ€‹

CodeDescriptionResolution
schedule_not_foundSchedule ID does not existVerify schedule ID is correct
schedule_already_deletedSchedule was already deletedNo action needed

Schedule Status After Deletionโ€‹

FieldValue
statusdeleted
deletedtrue
deleted_atTimestamp of deletion

๐Ÿ”‘API Credentials

Try it outโ€‹

Required - 1 fields
โ–ผ
Your IP: ...Loading...