Prerequisites
- Activate CRDB Direct Debit for your merchant account in the Merchant Dashboard.
- API keys — Create an Application with the Collection API feature enabled.
- Authorization token — Use your API keys to Generate an Authorization Token.
How It Works
Step 1 – Request Mandate Approval
Request Mandate Approval
Request mandate approval and create the linked payment schedule. Provide customer details, CRDB debit account, SimBanking phone number, dates, frequency, installment amount, and a mandate callback URL.
mandateRequestId, initial mandateStatus (REQUESTED), total amount, and number of installments.
Step 2 – Receive Mandate Status Callbacks
ClickPesa sends an HTTPPOST to your mandateCallbackUrl when the mandate status changes to ACTIVE, REJECTED, or CANCELLED.
Use mandateReference from the ACTIVE / REJECTED callback to correlate later installment payments (orderReference on payment webhooks matches this reference).
See Mandate status callbacks below and the Request Mandate Approval reference.
Step 3 – Query Mandate Details (optional)
Get Mandate
Retrieve mandate status, CRDB account details, and payment plan summary using
mandateRequestId.Step 4 – Receive Payment Events
Configure Application webhooks (or merchant webhooks) for:PAYMENT RECEIVED— installment collected successfullyPAYMENT FAILED— installment failed (for example insufficient funds, or mandate issues)
"channel": "CRDB DIRECT DEBIT MANDATE". The orderReference field is the mandate reference from CRDB.
Step 5 – Cancel Mandate (optional)
Cancel Mandate
Cancel an ACTIVE mandate. The linked payment plan and unpaid cycles are cancelled when the plan is still active.
Mandate Status Callbacks
Callbacks are sent to themandateCallbackUrl you provided when requesting mandate approval.
ACTIVE
Important Rules
- One active mandate per CRDB debit account at a time
phoneNumbermust be a SimBanking-registered number for the debit account (12 digits, country code, no+)- Dates:
DD-MM-YYYYorYYYY-MM-DD - Frequency types:
DAILY,WEEKLY,MONTHLY,YEARLY(optionalfrequencymultiplier, default1) - Cancel is only allowed when mandate status is ACTIVE

