Skip to content

Scheduled Payments

Overview

ElasticPay supports two ways to schedule a payment for a future date:

  1. Payment Plans — the system automatically generates and processes recurring payment intents on your behalf (weekly, monthly, etc.)
  2. Direct PI scheduling — you create a single payment intent now and set scheduled_payment_date to a future date; the system processes it automatically on that date

This guide covers direct PI scheduling. For a full reference of payment plan lifecycle management, see Payment Plans API.

Requirements

  • A saved payment method (pm_xxx) must be attached to the intent at create time. Transient tokens (from the widget) are not accepted because the customer will not be present at processing time.
  • The date must be today or in the future, and at most 366 days from today.

Step 1 — Save a payment method

If you don’t have a saved pm_xxx yet, create a Setup Intent to collect and save the customer’s card:

Terminal window
curl -X POST https://api.elasticpay.co/api/v1/setup_intents \
-H "Authorization: Bearer sk_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"customer_id": "cus_0abc123def456"}'

Pass the client_secret to the payment widget. After the customer completes the form, the saved method pm_xxx is available on the customer record.

Step 2 — Create a scheduled payment intent

Terminal window
curl -X POST https://api.elasticpay.co/api/v1/payment_intents \
-H "Authorization: Bearer sk_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"amount": 9900,
"currency": "AUD",
"customer_id": "cus_0abc123def456",
"payment_method": "pm_0xyz789abc123def456ghi012jkl",
"scheduled_payment_date": "2026-07-01"
}'

The response will have status: "requires_confirmation" and scheduled_payment_date: "2026-07-01".

Step 3 — Confirm to lock in the schedule

Terminal window
curl -X POST https://api.elasticpay.co/api/v1/payment_intents/pi_0abc123/confirm \
-H "Authorization: Bearer sk_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{}'

Because the date is in the future, the response status will be ready — the payment is queued for automatic processing on scheduled_payment_date. No further action is needed.

ready status

A payment intent in ready status has been confirmed and is waiting for its scheduled date.

StatusMeaning
readyConfirmed, waiting for scheduled date
processingSubmitted to PSP
succeededPayment collected
failedPayment declined or errored

Webhook events

Subscribe to these events to monitor scheduled payment activity:

EventWhen
payment_intent.succeededScheduled payment collected successfully
payment_intent.failedPayment declined or failed
payment_intent.processingSubmitted to PSP, awaiting result

See Webhooks for how to handle these events.