RemittanceService

sealed interface RemittanceService : CommonService

Retrofit service interface for the MTN MOMO Remittance product API.

Extends CommonService with remittance-specific operations: cash transfer V2. The V1 transfer endpoint is inherited from CommonService via Constants.EndPoints.TRANSFER.

Functions

Link copied to clipboard
@POST(value = "/remittance/{apiVersion}/cashtransfer")
abstract suspend fun cashTransfer(@Body cashTransfer: CashTransfer, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String, @Header(value = "X-Target-Environment") environment: String, @Header(value = "X-Reference-Id") uuid: String): Response<Unit>

Initiates a remittance cash transfer using the V2 endpoint, which supports extended KYC fields for cross-border compliance where the sender is not an MTN mobile money subscriber.

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, @Header(value = "X-Target-Environment") environment: String): Response<AccountBalance>

Makes a request to get the Account Balance. This only works with the ProductType.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, @Header(value = "X-Target-Environment") environment: String): Response<AccountBalance>

Makes a request to get the Account Balance in a specific currency. This only works with the ProductType.COLLECTION. It seems to break with the other API product type. User 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, @Header(value = "X-Target-Environment") environment: String): Response<BasicUserInfo>

Makes a request to get the Basic ApiUser Info.

Link copied to clipboard
@GET(value = "/remittance/{apiVersion}/cashtransfer/{referenceId}")
abstract suspend fun getCashTransferStatus(@Path(value = "referenceId") referenceId: String, @Path(value = "apiVersion") apiVersion: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String, @Header(value = "X-Target-Environment") environment: String): Response<ERROR CLASS: Symbol not found for ResponseBody>

Retrieves the status of a previously initiated cash transfer.

Link copied to clipboard
@GET(value = "/{productType}/{apiVersion}/transfer/{referenceId}")
abstract suspend fun getTransferStatus(@Path(value = "productType") productType: String, @Path(value = "apiVersion") apiVersion: String, @Path(value = "referenceId") referenceId: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String, @Header(value = "X-Target-Environment") environment: String): Response<ERROR CLASS: Symbol not found for ResponseBody>

Makes a request to get the transfer status.

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, @Header(value = "X-Target-Environment") environment: String): Response<UserInfoWithConsent>

Makes a request to get the ApiUser Info with Consent.

Link copied to clipboard
@POST(value = "/{productType}/{apiVersion}/requesttopay/{referenceId}/deliverynotification")
abstract suspend fun requestToPayDeliveryNotification(@Path(value = "productType") productType: String, @Path(value = "apiVersion") apiVersion: String, @Path(value = "referenceId") referenceId: String, @Body momoNotification: MomoNotification, @Header(value = "notificationMessage") notificationMessage: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String, @Header(value = "X-Target-Environment") environment: String): Response<ERROR CLASS: Symbol not found for ResponseBody>

Makes a request to send a delivery notification.

Link copied to clipboard
@POST(value = "/{productType}/{apiVersion}/transfer")
abstract suspend fun transfer(@Path(value = "productType") productType: String, @Path(value = "apiVersion") apiVersion: String, @Body momoTransaction: MomoTransaction, @Header(value = "X-Reference-Id") uuid: String, @Header(value = "Ocp-Apim-Subscription-Key") productSubscriptionKey: String, @Header(value = "X-Target-Environment") environment: String): Response<Unit>

Makes a request to transfer funds.

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, @Header(value = "X-Target-Environment") environment: String): Response<ERROR CLASS: Symbol not found for ResponseBody>

Makes a request to check the account holder status.