Collect Recurring Payments
Use mandates when a customer authorizes you to debit their bank account for recurring or scheduled collections.
This flow works for subscriptions, repayment schedules, dues, instalments, and other collections where bank-account authorization is required before each debit.
1. Resolve the bank account
Fetch mandate banks with GET /mandates/misc/account/banks, then call GET /mandates/misc/account/resolve with accountNumber and bankId.
Only continue when the resolved account name matches the customer you expect.
2. Create a manual mandate
Call POST /mandates/manual with the customer and bank-account details. The response gives you the mandate id to store against your subscription, repayment plan, or billing agreement.
curl https://api.aellaapp.com/mandates/manual \
-X POST \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"customer":{"firstName":"John","lastName":"Doe","email":"john.doe@example.com","phone":"+2348012345678"},"bankAccount":{"accountNumber":"0123456789","bankId":"bank-uuid"}}'
3. Wait for mandate confirmation
Listen for mandate.created and mandate.confirmed. You can also fetch the current mandate state with GET /mandates/{id}.
Do not debit until the mandate is confirmed.
4. Debit the mandate
Call POST /mandates/manual/{id}/debit when a scheduled charge is due. Store the returned transaction id or reference for reconciliation.
5. Reconcile the debit
Prefer webhooks: mandate.debit.initiated, mandate.debit.successful, and mandate.debit.failed.
If you need to poll, call GET /mandates/transaction/{id}/status-query with the mandate debit transaction id.