Skip to main content
The CRDB Direct Debit API lets you request mandate approvals for recurring collections from customers’ CRDB bank accounts, receive mandate status callbacks, and get payment events through webhooks.

Prerequisites

  1. Activate CRDB Direct Debit for your merchant account in the Merchant Dashboard.
  2. API keysCreate an Application with the Collection API feature enabled.
  3. 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.
The response includes mandateRequestId, initial mandateStatus (REQUESTED), total amount, and number of installments.

Step 2 – Receive Mandate Status Callbacks

ClickPesa sends an HTTP POST 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 successfully
  • PAYMENT FAILED — installment failed (for example insufficient funds, or mandate issues)
Payment payloads use "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 the mandateCallbackUrl you provided when requesting mandate approval. ACTIVE
REJECTED
CANCELLED

Important Rules

  • One active mandate per CRDB debit account at a time
  • phoneNumber must be a SimBanking-registered number for the debit account (12 digits, country code, no +)
  • Dates: DD-MM-YYYY or YYYY-MM-DD
  • Frequency types: DAILY, WEEKLY, MONTHLY, YEARLY (optional frequency multiplier, default 1)
  • Cancel is only allowed when mandate status is ACTIVE

API Reference

Also See