Skip to content

Understanding Payment Plans

What is a payment plan

A payment plan is a schedule of recurring payments for a customer. The portal’s scheduler automatically creates payment intents for each upcoming payment date and processes them using the customer’s saved payment method.

Payment plans are created and managed in the portal. The API handles the individual payment intents that the scheduler creates.

Frequency options

Frequency typeCodeExample
WeeklyWEvery week
MonthlyMEvery month

Set a period to change the interval — period 2 with type W means every 2 weeks; period 3 with type M means every 3 months.

Amount structure

FieldDescription
recurring_amount_centsAmount for each scheduled payment (min 200, max 100,000 cents)
first_amount_centsOptional different amount for the first payment
total_amount_centsOptional fixed total — plan closes automatically when collected amount reaches this
until_further_noticetrue for open-ended plans with no total amount

If neither total_amount_cents nor until_further_notice is set, the plan must be closed manually.

Plan states

StateDescriptionPayments scheduled?
draftCreated but not activatedNo
activeRunning and scheduling paymentsYes
inactivePaused — future unprocessed intents deletedNo
suspendedTemporary hold (e.g. payment method recovery)No
closedPermanently endedNo

Activate a draft plan to begin scheduling. A plan in any state except closed can be closed.

How payments are created

The scheduler creates payment intents up to 366 days in advance. Each intent has a process_at timestamp for its scheduled date. On that date:

  1. The intent is submitted to PaymentIntentDO in worker-pay
  2. worker-pay processes the payment using the customer’s saved payment instrument
  3. A payment_intent.succeeded or payment_intent.failed event is emitted
  4. The outcome syncs back to the payment intent record in the portal

PaymentIntentDO (a Cloudflare Durable Object) is the source of truth for processing state. The portal’s PaymentIntent reflects the outcome after sync.