Intergrating Recurring Payments
Using Lean's Payment scheduler with Account-on-file for recurring payment use cases
Overview
The Payment scheduler APIs let you register, manage and inspect scheduled payments — recurring or explicitly dated — executed automatically against an AUTHORISED Account-on-File consent. Once a schedule is registered, Lean initiates each payment on its due date on your behalf. No per-payment API call and no customer interaction is required.
The Recurring Payments API is an add-on to your existing Account-on-File integration. It does not replace any part of it — schedules are executed through the Account-on-File consent your customer has already authorized.
Schedule types
| Type | What it is | Typical use case |
|---|---|---|
RECURRING | A fixed amount repeating on a fixed cadence (DAY, WEEK, MONTH, YEAR), from an optional start_date until an optional end_date. Open-ended if end_date is omitted. | Auto deposits, subscriptions, memberships, rental payments |
EXPLICIT | An explicit list of dated executions, each with its own date, amount and optional reference. | Installment plans, loan repayment schedules with varying amounts |
Register a schedule - POST/schedules/v1
POST/schedules/v1 - Registers a new schedule against an existing, authorized consent. This is the only write call needed to set up recurring collection — Lean handles payment initiation from here.
-
RECURRINGdefinition —type,recurrence.unit(DAY/WEEK/MONTH/YEAR),amount(value≥ 1,currency), optionalstart_date, optionalend_date(open-ended when omitted).{ "reference": "SUBSCRIPTION-4711", "purpose": "GDS", "consent_id": "123e4567-e89b-12d3-a456-426655440000", "schedule": { "type": "RECURRING", "recurrence": { "unit": "MONTH" }, "amount": { "value": 100.00, "currency": "AED" }, "start_date": "2026-08-01", "end_date": "2027-07-01" } } -
EXPLICITdefinition — type and an executions array; each entry hasexecute_on(date),amount, and an optional per-executionreferencethat overrides the schedule-level default for that payment.{ "consent_id": "123e4567-e89b-12d3-a456-426655440000", "purpose": "LNC", "schedule": { "type": "EXPLICIT", "executions": [ { "execute_on": "2026-08-01", "amount": { "value": 100.00, "currency": "AED" } }, { "execute_on": "2026-09-01", "amount": { "value": 200.00, "currency": "AED" }, "reference": "INSTALLMENT-2" } ] } }
-
- Persist
schedule_idagainst the customer and consent in your database — you need it for every subsequent call. - Only register schedules against consents in the
AUTHORISEDstate. Gate this on theconsent.status.updatedwebhook, not on the redirect outcome alone. amount.valuemust be ≥ 1.
List schedules - GET/schedules/v1
GET/schedules/v1 -
Returns a paginated list of schedules for your application. Filter with
consentId(uuid) and/orstatus, plus standardpage/sizepagination parameters.Each summary includes
schedule_id,consent_id,type,status,created_at, a plan_summary, andnext_payment(the next upcoming execution, when one is scheduled).plan_summaryis shaped bytype:- Recurring —
amount,period_unit,start_date,end_date. - Explicit —
planned_count,first_payment_date,last_payment_date.
Use consentId filtering to render all schedules attached to a consent — e.g. before a customer revokes a consent, show them which active schedules will stop.
- Recurring —
Get schedule details - GET/schedules/v1/{schedule_id}
GET/schedules/v1/{schedule_id}- Returns the full details of a single schedule:
schedule_id,consent_id,application_id,type,status,plan_summary,pending_payment(the currently pending scheduled payment, when one exists),created_atandupdated_at.pending_paymentgives you the id, due date, amount and reference of the payment that will be attempted next — useful for "your next payment" UI.- Call this endpoint (or use
/history) after lifecycle actions to confirm state, in addition to acting on web hooks.
Payment status and Consent status web hooks
- Recurring Payments is built on top of Account-on-File: every scheduled payment is executed against an authorized AoF consent. As a result, there are no schedule-specific web hook events — Recurring Payments emits the same
payment.created/payment.updatedandconsent.status.updatedevents as your existing Account-on-File integration.- See guides on Payment status web hooks and Consent status web hooks for more details
