Skip to main content
Version: Next

Library Usage — Disbursements

Disbursements APIs let you send money to Mobile Money accounts (transfers), credit accounts directly (deposits), and reverse transactions (refunds), plus query the status of each.

Authentication is handled automatically by the SDK's interceptors — you never pass an access token. Every DefaultRepository method returns a Flow<NetworkResult<T>>; collect it inside a coroutine scope. Cross-border cash transfers live under Remittance.

Environment and cross-cutting headers are automatic. You set the target environment once during SDK setup — ApiConfig.environment, which is sourced from MOMO_ENVIRONMENT in local.properties. On every request the SDK's EnvironmentInterceptor adds the required X-Target-Environment header, so environment is never a per-call parameter. Authentication headers (Authorization) are attached the same way, and transaction-initiation endpoints additionally receive an optional X-Callback-Url header. See Callbacks for details.


Transfer

Sends money from your account to a recipient's Mobile Money account.

defaultRepository.transfer(
productType = ProductTypes.DISBURSEMENTS.productType,
apiVersion = "v1_0",
transfer = Transfer(
amount = "250",
currency = "EUR",
externalId = UUID.randomUUID().toString(),
payee = Party(partyIdType = PartyTypes.MSISDN, partyId = "256770000000"),
payerMessage = "Salary payment",
payeeNote = "March salary"
),
uuid = UUID.randomUUID().toString(),
productSubscriptionKey = disbursementsPrimaryKey
).collect { result ->
when (result) {
is NetworkResult.Success -> { /* transfer initiated */ }
is NetworkResult.Error -> { /* failed */ }
is NetworkResult.Loading -> { /* in progress */ }
}
}
ParameterTypeDescription
productTypeStringProduct type string, e.g. ProductTypes.DISBURSEMENTS.productType
apiVersionStringAPI version, e.g. "v1_0"
transferTransferTransfer details (amount, currency, payee, messages)
uuidStringUnique reference ID — save this to poll for status
productSubscriptionKeyStringDisbursements primary subscription key

Get Transfer Status

Retrieves the status of a previously initiated transfer.

defaultRepository.getTransferStatus(
productType = ProductTypes.DISBURSEMENTS.productType,
apiVersion = "v1_0",
referenceId = transferUuid,
productSubscriptionKey = disbursementsPrimaryKey
).collect { result ->
when (result) {
is NetworkResult.Success -> { /* parse result.response */ }
is NetworkResult.Error -> { /* failed */ }
is NetworkResult.Loading -> { /* in progress */ }
}
}
ParameterTypeDescription
productTypeStringProduct type string
apiVersionStringAPI version
referenceIdStringUUID used when calling transfer
productSubscriptionKeyStringDisbursements primary subscription key

Returns Flow<NetworkResult<TransferStatus>>TransferStatus carries amount, currency, financialTransactionId, externalId, a payee (Party), payerMessage, payeeNote, a status of type StatusTypes (PENDING, SUCCESSFUL, FAILED), and a reason (ErrorResponsecode + message).


Deposit

Credits a Mobile Money account directly (agent-initiated flow).

val transactionUuid = UUID.randomUUID().toString()

defaultRepository.deposit(
deposit = Deposit(
amount = "100",
currency = "EUR",
externalId = UUID.randomUUID().toString(),
payee = Party(partyIdType = PartyTypes.MSISDN, partyId = "256770000000"),
payerMessage = "Cash deposit",
payeeNote = "Deposit"
),
apiVersion = "v1_0",
productSubscriptionKey = disbursementsPrimaryKey,
uuid = transactionUuid
).collect { result ->
when (result) {
is NetworkResult.Success -> { /* accepted (HTTP 202) — poll for status with transactionUuid */ }
is NetworkResult.Error -> { /* handle result.message */ }
is NetworkResult.Loading -> { /* show progress */ }
}
}
ParameterTypeDescription
depositDepositDeposit details
apiVersionStringAPI version, e.g. "v1_0"
productSubscriptionKeyStringDisbursements primary subscription key
uuidStringUnique reference ID

Get Deposit Status

Retrieves the status of a deposit.

defaultRepository.getDepositStatus(
referenceId = transactionUuid,
apiVersion = "v1_0",
productSubscriptionKey = disbursementsPrimaryKey
).collect { result ->
when (result) {
is NetworkResult.Success -> { /* parse the status from result.response */ }
is NetworkResult.Error -> { /* handle result.message */ }
is NetworkResult.Loading -> { /* show progress */ }
}
}
ParameterTypeDescription
referenceIdStringUUID used when calling deposit
apiVersionStringAPI version
productSubscriptionKeyStringDisbursements primary subscription key

Returns Flow<NetworkResult<DepositStatus>>DepositStatus carries amount, currency, financialTransactionId, externalId, a payee (Party), payerMessage, payeeNote, a status of type StatusTypes (PENDING, SUCCESSFUL, FAILED), and a reason (ErrorResponsecode + message).


Refund

Reverses a previously completed disbursements transaction.

val refundUuid = UUID.randomUUID().toString()

defaultRepository.refund(
refund = Refund(
amount = "100",
currency = "EUR",
externalId = UUID.randomUUID().toString(),
payerMessage = "Refund for order #42",
payeeNote = "Refund",
referenceIdToRefund = originalTransactionUuid
),
apiVersion = "v2_0",
productSubscriptionKey = disbursementsPrimaryKey,
uuid = refundUuid
).collect { result ->
when (result) {
is NetworkResult.Success -> { /* accepted (HTTP 202) — poll for status with refundUuid */ }
is NetworkResult.Error -> { /* handle result.message */ }
is NetworkResult.Loading -> { /* show progress */ }
}
}
ParameterTypeDescription
refundRefundRefund details; set referenceIdToRefund to the original transaction UUID
apiVersionStringAPI version, e.g. "v2_0"
productSubscriptionKeyStringDisbursements primary subscription key
uuidStringUnique reference ID for this refund

Get Refund Status

Retrieves the status of a refund.

defaultRepository.getRefundStatus(
referenceId = refundUuid,
apiVersion = "v2_0",
productSubscriptionKey = disbursementsPrimaryKey
).collect { result ->
when (result) {
is NetworkResult.Success -> { /* parse the status from result.response */ }
is NetworkResult.Error -> { /* handle result.message */ }
is NetworkResult.Loading -> { /* show progress */ }
}
}
ParameterTypeDescription
referenceIdStringUUID used when calling refund
apiVersionStringAPI version
productSubscriptionKeyStringDisbursements primary subscription key

Returns Flow<NetworkResult<RefundStatus>>RefundStatus carries amount, currency, financialTransactionId, externalId, a payee (Party), payerMessage, payeeNote, a status of type StatusTypes (PENDING, SUCCESSFUL, FAILED), and a reason (ErrorResponsecode + message).

Cash transfers — the V2 cross-border cashTransfer / getCashTransferStatus operations are documented under Remittance.