View as Markdown llms.txt

C2B and diagnostics#

Receiving payments customers start themselves, and the tools for seeing what actually arrived.

c2b_register_urls#

control

Register the validation and confirmation URLs that Daraja calls when a customer pays your PayBill or till directly. Required once per shortcode before C2B notifications work.

ParameterTypeNotes
shortCodestring
responseType"Completed" | "Cancelled"What Daraja should do when your validation endpoint is unreachable. Completed accepts the payment anyway; Cancelled rejects it. Defaults to "Completed".
confirmationUrlstring
validationUrlstring

c2b_simulate#

money

Simulate a customer paying your shortcode. Sandbox and simulator only.

ParameterTypeNotes
phoneNumber requiredstring
amount requirednumber
billRefNumberstringDefaults to "TEST".
commandId"CustomerPayBillOnline" | "CustomerBuyGoodsOnline"Defaults to "CustomerPayBillOnline".
shortCodestring

pull_register#

control

Register a shortcode for the Pull Transactions API, which lets you fetch missed C2B transactions after an outage.

ParameterTypeNotes
shortCodestring
nominatedNumber requiredstringPhone number registered to receive pull notifications.
callbackUrlstring

pull_transactions#

control

Fetch C2B transactions for a time window. Useful for reconciliation when callbacks were missed.

ParameterTypeNotes
shortCodestring
startDate requiredstringStart of the window, "yyyy-mm-dd hh:mm:ss".
endDate requiredstringEnd of the window, "yyyy-mm-dd hh:mm:ss".
offsetValuestringPagination offset. Defaults to "0".

list_callbacks#

control

List callbacks this server has received, newest first.

ParameterTypeNotes
limitnumberDefaults to 20.
kind"stk" | "b2c" | "b2b" | "balance" | "status" | "reversal" | "ratiba" | "c2b-validation" | "c2b-confirmation" | "timeout" | "unknown"Filter to one product family.

get_callback#

control

Fetch the full callback payload for a correlation id.

ParameterTypeNotes
correlationId requiredstringCheckoutRequestID, ConversationID, or the Ratiba correlationId.

server_health#

control

Report the current mode, which credentials are configured, and callback receiver status. Start here when something is not working.

_No parameters._