MTN MoMo Api dictionary for developers
MTN MoMo API is a system that allows developers to integrate MTN mobile money services into their own applications. MTN Mobile Money is a digital wallet service that enables users to send and receive money, pay bills, buy airtime and data, and make other transactions using their mobile phones. By integrating the MTN MoMo API into your own applications, developers can offer these mobile money services to their users without the need for the users to leave the application or use a separate mobile money app.
Table of Contents
The MTN MoMo API is available to developers across several markets and is designed to be easy to use, with clear documentation and resources available to get started. The API is accessible through a RESTful web service, and developers can make requests using HTTP methods such as GET, POST, PUT, or DELETE to interact with the API.
Common Error Codes
|HTTP Code||Error Response Code||Description||Action|
|409||RESOURCE_ALREADY_EXIST||Duplicated Reference ID. Every request must have a unique reference ID; using an ID of the previous request will result in this error response.||Check X-Reference ID used is unique and is in UUID V4 format|
|401||ACCESS DENIED DUE TO INVALID SUBSCRIPTION KEY||Authentication failed.Credentials invalid.Header Ocp-APIM-Subscription-Key value is incorrect.||Check the User Profile Section to verify the related product subscription key is used. Collection, Disbursement and Remittance have different subscription keys. If the primary key doesn’t work, try the secondary key. Contact MTN support if both provided keys aren’t working. Sandbox subscription key are located in https://momodeveloper.mtn.com/developer Production subscription key are located in https://momoapi.mtn.com/developer|
|404||RESOURCE NOT FOUND||Reference ID not found. Requested resource does not exist. Predominantly occurs with Get Status API and implies that the requested reference ID does not exist. This results in the Request to Debit or Transfer transaction being unsuccessful.||Check if the original request to pay or the transfer (disbursement) operation was successful with response code 202.|
|400||REQUEST REJECTED/ BAD REQUEST||Bad request. Request does not follow the specification.||This relates to any of the below scenarios:|
– Incorrect/wrong values in the headers, and/or the X-ref ID does not meet UUID Version 4.
– Inputting a Body in an API that is not supported e.g. /Token API
– Having unsupported special characters in the Body request for example an apostrophe (‘).
– Invalid currency – needs to match the target environment currency.
– More than 160 characters in the note and message; explore utilizing the notification API for increased number of characters.
– The URL posted to needs to reviewed e.g. incorrect number of forward slashes (///).
|403||FORBIDDEN IP||Authorization failed. IP not authorized to utilize Disbursement API.||Share your originating Public IP from which the APIs are called with your MTN Account Manager.|
|500||NOT_ALLOWED||Authorization failed. User does not have permission.The account authenticated with the Request via Token is restricted.||Contact your MTN Account Manager.|
|500||NOT_ALLOWED_TARGET_ENVIRONMENT||Value passed in header X-Target-Environment is incorrect||Use the correct X-targetenvironment corresponding to below country:|
– MTN Uganda= mtnuganda
– MTN Ghana= mtnghana
– MTN Ivory Coast= mtnivorycoast
– MTN Zambia= mtnzambia
– MTN Cameroon= mtncameroon
– MTN Benin= mtnbenin
– MTN Congo= mtncongo
– MTN Swaziland= mtnswaziland
– MTN GuineaConakry= mtnguineaconakry
– MTN SouthAfrica= mtnsouthafrica
– MTN Liberia= mtnliberia
For Test Environment = sandbox
|500||INVALID_CALLBACK_URL_HOST||Callback URL with different host name to configured for API User.|
Check the Host of the Call Back URL in the request header; this needs to match what was configured on the partner portal when creating the API user and Key.
|Host needs to be configured using Hostname and not IP address.|
|500||INVALID_CURRENCY||Currency not supported on the requested account||Use Currency Code specific to the Country.|
|503||SERVICE_UNAVAILABLE||Service temporary unavailable, try again later||Enquire with MTN Support.|
Common Error Responses with Action
|INTERNAL_PROCESSING_ERROR||Default or Generic error code used when there is no specific error mapping. This predominantly occurs due to insufficient customer funds to complete the transaction.|
Also related to service denied or Wallet Platform is not reachable.
|Advice customer to ensure they have sufficient funds to complete the transaction. Also request the customer to retry the transaction. If the problem still occurs with sufficient customer funds, please contact your MTN Account Manager for further investigation.|
|PAYEE_NOT_FOUND||The MSISDN being paid to is invalid.||MSISDN format must include country code. MSISDN is not registered for Mobile Money Service.|
|PAYER_NOT_FOUND||MSISDN of the number from whom the money was requested in invalid.||MSISDN format must include country code.MSISDN is not registered for Mobile Money Service.|
|COULD_NOT_PERFORM_TRANSACTION||This can be attributed to transaction timeout. This predominantly occurs with a delay to approve a transaction within the given time frame (5 minutes).||Advise customer to try again and approve transaction within 5 minutes.|
Other Error Responses
|NOT_ALLOWED||Authorization failed. Insufficient permissions|
|NOT_ALLOWED_TARGET_ENVIRONMENT||Access to target environment is forbidden|
|INVALID_CALLBACK_URL_HOST||Callback URL does not match the configured value|
|INVALID_CURRENCY||Currency not supported|
|SERVICE_UNAVAILABLE||Service temporarily unavailable, try again later|
|NOT_ENOUGH_FUNDS||The payer does not have enough funds|
|PAYER_LIMIT_REACHED||The payer’s limit has been breached|
|PAYEE_NOT_ALLOWED_TO_RECEIVE||The payee is unable to receive funds|
|PAYMENT_NOT_APPROVED||Payment was not approved|
|RESOURCE_NOT_FOUND||Requested resource was not found|
|APPROVAL_REJECTED||The approval was rejected|
|EXPIRED||The requested resource has expired|
|TRANSACTION_CANCELED||The transaction was canceled by the initiator|
|RESOURCE_ALREADY_EXIST||Duplicated reference id. Creation of resource failed|
|TRANSACTION_NOT_COMPLETED||Transaction is pending and not completed|
|TRANSACTION_NOT_FOUND||The transaction could not be found|
|INFORMATIONAL_SCOPE_INSTRUCTION||Informational scopes shall not have scope instructions|
|MISSING_SCOPE_INSTRUCTION||Missing scope instruction|
|MORE_THAN_ONE_FINANCIAL_SCOPE_NOT_SUPPORTED||More than one financial scope is not supported|
|UNSUPPORTED_SCOPE_COMBINATION||The combination of scope types are not supported|
|CONSENT_MISMATCH||A value in request mismatch with a value in consent|
|UNSUPPORTED_SCOPE||The scope is not supported|
|NOT_FOUND||Requested resource was not found|
MTN MoMo API supports several products, including:
- Collections: Enables merchants to accept mobile money payments from their customers.
- Disbursements: Enables companies to send payments to their employees or customers directly to their mobile money wallets.
- Remittances: Enables individuals to send money directly to other individuals or companies across borders through mobile money.
To use the MTN MoMo API, developers need to obtain authentication details, consisting of an API key and API secret, which they will use to authorize requests to the API. Additionally, developers need to specify the product-specific variables and parameters that will enable them to interact with the API.
Overall, the MTN MoMo API provides developers with a convenient and secure way to integrate mobile money services from MTN into their own applications, helping to increase the reach and adoption of these services in their markets.
Integrating with MTN Momo API
More Information ℹ
- MoMo API Documentation
- MoMo API Sandbox
- MoMo Dev Support
- MTN Developer Platform
- MTN MoMo API Tutorial