DisbursementsService

Retrofit service interface for the MTN MOMO Disbursements product API.

Extends CommonService with disbursement-specific operations: deposit and refund.

Functions

Link copied to clipboard
@POST(value = "/disbursement/{apiVersion}/deposit")
abstract suspend fun deposit(@Body deposit: Deposit, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String, @Header(value = "X-Reference-Id") uuid: String): Response<Unit>

Initiates a deposit, pushing funds to the specified payee account.

Link copied to clipboard
@GET(value = "/{productType}/{apiVersion}/account/balance")
abstract suspend fun getAccountBalance(@Path(value = "productType") productType: String, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String): Response<AccountBalance>

Makes a request to get the Account Balance. This only works with the io.rekast.sdk.utils.ProductTypes.COLLECTION. It seems to break with the other API product type.

Link copied to clipboard
@GET(value = "/{productType}/{apiVersion}/account/balance/{currency}")
abstract suspend fun getAccountBalanceInSpecificCurrency(@Path(value = "productType") productType: String, @Path(value = "apiVersion") apiVersion: String, @Path(value = "currency") currency: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String): Response<AccountBalance>

Makes a request to get the Account Balance in a specific currency. This only works with the io.rekast.sdk.utils.ProductTypes.COLLECTION. It seems to break with the other API product type. Use EUR as the currency on sandbox

Link copied to clipboard
@GET(value = "/{productType}/{apiVersion}/accountholder/msisdn/{accountHolderId}/basicuserinfo")
abstract suspend fun getBasicUserInfo(@Path(value = "productType") productType: String, @Path(value = "apiVersion") apiVersion: String, @Path(value = "accountHolderId") accountHolder: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String): Response<BasicUserInfo>

Makes a request to get the Basic ApiUser Info.

Link copied to clipboard
@GET(value = "/disbursement/{apiVersion}/deposit/{referenceId}")
abstract suspend fun getDepositStatus(@Path(value = "referenceId") referenceId: String, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String): Response<DepositStatus>

Retrieves the status of a previously initiated deposit request.

Link copied to clipboard
@GET(value = "/disbursement/{apiVersion}/refund/{referenceId}")
abstract suspend fun getRefundStatus(@Path(value = "referenceId") referenceId: String, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String): Response<RefundStatus>

Retrieves the status of a previously initiated refund request.

Link copied to clipboard
@GET(value = "/{productType}/oauth2/{apiVersion}/userinfo")
abstract suspend fun getUserInfoWithConsent(@Path(value = "productType") productType: String, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String): Response<UserInfoWithConsent>

Makes a request to get the ApiUser Info with Consent.

Link copied to clipboard
@POST(value = "/disbursement/{apiVersion}/refund")
abstract suspend fun refund(@Body refund: Refund, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String, @Header(value = "X-Reference-Id") uuid: String): Response<Unit>

Initiates a refund for a previously completed transaction.

Link copied to clipboard
@GET(value = "/{productType}/{apiVersion}/accountholder/{accountHolderIdType}/{accountHolderId}/active")
abstract suspend fun validateAccountHolderStatus(@Path(value = "productType") productType: String, @Path(value = "apiVersion") apiVersion: String, @Path(value = "accountHolderId") accountHolderId: String, @Path(value = "accountHolderIdType") accountHolderType: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String): Response<AccountHolderStatus>

Makes a request to check the account holder status.