MoMo Payment API Documentation
MoMo Payment API Documentation
Version 2.1.5
Changes history
Version Date Section Name Changes
2.1.5 10.10.2018 Update error Code
2.1.5 04.08.2018 Update public key
2.1.5 12.07.2018 Update document
2.1.5 09.04.2018 Update new document
POS payment, Online all-in-
All MoMo payment
2.1.4 14.12.2017 one payment, app-to-app
methods
payment
Update refund, query Update refund, query
2.1.3 23.11.2017
status API status API
Optional:
o QR code URL will return to vendor using this to generate QR code outside MoMo
page, you can place this QR code on Smart TV, tablet, print to bill for user scan
this QR code.
o Deeplink URL can be returned, vendor can handle open MoMo app, with callback
send to MoMo by returnURL
URL: [Link]
IV. DEFINATIONS
Vendor shopping
Any online shopping platforms, cashier systems or POS systems and business
mobile app platform.
Partner Code
Unique identify for each Vendor. Can find in MoMo Business Platform
URL: [Link]
Access key
Unique identify for each Vendor. Can find in MoMo Business Platform
Signature
The Vendor’s backend and the MoMo payment system create the same
signature based on the same secret key and algorithm and use it to verify each
other's identity. The signature algorithm is created and provided by MoMo.
Commonly used signature modes are MD5, SHA1, SHA256, and HMAC.
RSA encryption
RSA Encryption is one of the first public-key cryptosystems and is widely used
for secure data transmission. In such a cryptosystem, the encryption key is
public and it is different from the decryption key which is kept secret (private).
Vendor using public key that MoMo provided to encrypt for secure data
transfer.
Hash
Body data Vendor system using RSA encrypt data.
Example:
Before hash:
{
"partnerCode": " MOMOIQA420180417",
"partnerRefId": "Merchant123556666",
"requestId": "8374736463"
}
After using RSA encrypt this data:
jClksw/4LI+lMdBHpfX++fYDKpUg4a8W/heOY3PQbxI7NJI3GFlRQGsi70CSTZuW0KKgBXSuvpIF
d5zpzzxOi7MJg4qqNWRIEn2/PAiHjB2J6R4w+wdnz9yIAGkN8E9P4l4VAKFfR01quOWjIczjFxT7
V8ibOa92dYWtAEtms86Z7QYu4ZIw8m8b1IBgeifxm9T8k5Np3cati0QLUCEFkW+oKEWeV3f3EGpx
c7qFed4kPvxZAcBUzzQZHWUBxUVcH7d3tw7n6eGLI6lk+KvFjQRIMr94wvaPpVFXF049wexoUgPr
i8hUYJyPhEcchZDmeNJUZTWrB/1O1sJLKbSJgQ==
Username: mm_bu_test
Password: MOMO2018
Login: [Link]
Sandbox: [Link]
Production: [Link]
1) POS payment:
Partner code : MOMOIQA420180417
Public key :
Java key format:
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkpa+qMXS6O11x7jBGo9W3yxeHEsAdyDE
40UoXhoQf9K6attSIclTZMEGfq6gmJm2BogVJtPkjvri5/j9mBntA8qKMzzanSQaBEbr8FyByHnf226dsL
t1RbJSMLjCd3UC1n0Yq8KKvfHhvmvVbGcWfpgfo7iQTVmL0r1eQxzgnSq31EL1yYNMuaZjpHmQuT2
4Hmxl9W9enRtJyVTUhwKhtjOSOsR03sMnsckpFT9pn1/V9BE2Kf3rFGqc6JukXkqK6ZW9mtmGLSq3
K+JRRq2w8PVmcbcvTr/adW4EL2yc1qk9Ec4HtiDhtSYd6/ov8xLVkKAQjLVt7Ex3/agRPfPrNwIDAQAB
C# key format:
<RSAKeyValue><Modulus>kpa+qMXS6O11x7jBGo9W3yxeHEsAdyDE40UoXhoQf9K6attSIclTZMEGf
q6gmJm2BogVJtPkjvri5/j9mBntA8qKMzzanSQaBEbr8FyByHnf226dsLt1RbJSMLjCd3UC1n0Yq8KKvf
HhvmvVbGcWfpgfo7iQTVmL0r1eQxzgnSq31EL1yYNMuaZjpHmQuT24Hmxl9W9enRtJyVTUhwKhtj
OSOsR03sMnsckpFT9pn1/V9BE2Kf3rFGqc6JukXkqK6ZW9mtmGLSq3K+JRRq2w8PVmcbcvTr/adW4
EL2yc1qk9Ec4HtiDhtSYd6/ov8xLVkKAQjLVt7Ex3/agRPfPrNw==</Modulus><Exponent>AQAB</Exp
onent></RSAKeyValue>
Endpoint: [Link]
Security method: SSL/TLS encryption protocols and RSA encrypt body data
with public key
3) App-to-app payment:
Partner code : MOMOIQA420180417
Public key :
Java key format:
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkpa+qMXS6O11x7jBGo9W3yxeHEsAdyDE
40UoXhoQf9K6attSIclTZMEGfq6gmJm2BogVJtPkjvri5/j9mBntA8qKMzzanSQaBEbr8FyByHnf226dsL
t1RbJSMLjCd3UC1n0Yq8KKvfHhvmvVbGcWfpgfo7iQTVmL0r1eQxzgnSq31EL1yYNMuaZjpHmQuT2
4Hmxl9W9enRtJyVTUhwKhtjOSOsR03sMnsckpFT9pn1/V9BE2Kf3rFGqc6JukXkqK6ZW9mtmGLSq3
K+JRRq2w8PVmcbcvTr/adW4EL2yc1qk9Ec4HtiDhtSYd6/ov8xLVkKAQjLVt7Ex3/agRPfPrNwIDAQAB
C# key format:
Step 2: Cashier scan bar code or QR Code Figure 1.2 shown in the end-user MoMo
app that in step 1 and the transaction order is submitted to the Vendor POS
server.
Step 3: Vendor POS server send the transaction include order amount, vendor
transaction id and MoMo POS payment code to MoMo POS server. If the payment
verified successful, the end-user will see a successful message in MoMo app and
error will display when failed in Figure 1.3.
Figure 1.1 MoMo home screen Figure 1.2 MoMo payment QR code Figure 1.3 transaction result
2) Participating Vendors
o Users can experience this method for themselves at stores and super
market accepted MoMo POS payment.
o Super market: [Link] mart, Lotte mart
o Coffee: The Coffee House, Gongcha
o Foods and beverages: Gogi, Kichi, Hoàng Yến Buffet
o Cinemas: CGV, Lotte Cinema
Note: The MoMo barcodes are constructed with 20 numbers, with the start value of MM.
4) Exception Handling
Follow the instructions below to troubleshoot any payment exceptions:
If the Payer cannot find their order in their transaction history when they're
prompted of a payment error on MoMo, they will require the Vendor to
initiate the order again. if the order is successfully paid for, the Vendor’s
backend calls the Query Transaction Status API to query the actual payment
status again.
5) Submit MoMo POS payment server
After the Cashier scans a bar code or QR code on the MoMo app page shown by
the Payer, the payment parameters are transferred to the Vendor POS Server. The
Vendor POS server calls the Submit MoMo POS payment server to initiate a payment.
URL: [Link]
Method: HTTP POST
Request header: application/json
Response header: application/json
Example:
{
"partnerCode": "MOMOIQA420180417",
"partnerRefId": "ref1122334422",
"description": "thanh toan MoMo",
"hash": "
VwnYQbw5eg2XGVO6uGgyOETG9dBQXjdOw8OyBptZ5zvsUTPiNxMc4hi1sd7TTRkifG0kaOJ
VgplrLlyogFxcegyZzQ7LtjDr/4FtN8MfFKWozhxSWW2JYQyJ/klegGVpOTSkXkfUoueGdTSI2IJF
S1pe5rxkmBdMWRilbyfOqbTdrWt50gjY2mQbhke7+9puGLgg8mh+NfYCbEZtHDKyDODA0M
VNMNh3ATd31KwfNLm0zx6QQ6KXBq5M04cpTA6rIZ9uz3fxEwTvPycuxJtLvtFDpLapNAmUw
qA2Rej3mTgOTN1+Jq9isqEueA0Ix3ip++d8GbJXJYkvYfr0XgT3zA==",
"version": 2.0
}
Detail hash parameter
Parameter Data type Requirement Description
partnerCode String √ MoMo provide for Mechant
when enter into the contract or
find in
[Link]
partnerRefId String √ Transaction ID of Merchant
system
Example:
{
"partnerCode": "MOMOIQA420180417",
"partnerRefId": "Merchant123556666",
"amount": 30000,
"paymentCode": "MM627755248085056826",
"storeId": "1",
"storeName": "Cua hang doi tac MoMo"
}
Encrypted Hash string
VwnYQbw5eg2XGVO6uGgyOETG9dBQXjdOw8OyBptZ5zvsUTPiNxMc4hi1sd7TTRkifG0ka
OJVgplrLlyogFxcegyZzQ7LtjDr/4FtN8MfFKWozhxSWW2JYQyJ/klegGVpOTSkXkfUoueGdTSI2IJF
S1pe5rxkmBdMWRilbyfOqbTdrWt50gjY2mQbhke7+9puGLgg8mh+NfYCbEZtHDKyDODA0MV
NMNh3ATd31KwfNLm0zx6QQ6KXBq5M04cpTA6rIZ9uz3fxEwTvPycuxJtLvtFDpLapNAmUwqA
2Rej3mTgOTN1+Jq9isqEueA0Ix3ip++d8GbJXJYkvYfr0XgT3zA==
Example:
{
"status": 0,
"message": {
"transid": 12436514111,
"description": "Thành công",
"amount": 30000
}
}
"partnerCode":"[partnerCode]",
"partnerRefId":"[partnerRefId]",
"requestId": "[requestId]"
}
)
version Numeric √ Current version is 2.0 (double
value)
Example:
{
"partnerCode": "MOMOIQA420180417",
"partnerRefId": "Merchant123556666",
"description": "thanh toan MoMo",
"hash": "
jClksw/4LI+lMdBHpfX++fYDKpUg4a8W/heOY3PQbxI7NJI3GFlRQGsi70CSTZuW0KKgBXSuvpI
Fd5zpzzxOi7MJg4qqNWRIEn2/PAiHjB2J6R4w+wdnz9yIAGkN8E9P4l4VAKFfR01quOWjIczjFx
T7V8ibOa92dYWtAEtms86Z7QYu4ZIw8m8b1IBgeifxm9T8k5Np3cati0QLUCEFkW+oKEWeV3
f3EGpxc7qFed4kPvxZAcBUzzQZHWUBxUVcH7d3tw7n6eGLI6lk+KvFjQRIMr94wvaPpVFXF04
9wexoUgPri8hUYJyPhEcchZDmeNJUZTWrB/1O1sJLKbSJgQ==",
Example:
{
"partnerCode": "MOMOIQA420180417",
"partnerRefId": "Merchant123556666",
"requestId": "8374736463"
}
Example:
{
"status": 0,
"messages": "Thành công",
"data": {
"status": 1014,
"message": "Mật khẩu bạn nhập không chính xác.",
"partnerCode": "MOMOIQA420180417",
7) Refund transaction
URL: [Link]
Example:
{
"partnerCode": "MOMOIQA420180417",
Example:
{
"partnerCode": "MOMOIQA420180417",
"partnerRefId": "Merchant123556666",
"momoTransId": " 147938695 ",
"amount": 30000
}
J0PyqdM8Mn8ZJAy8GSe1F/CwI9V4pYE66edb/lxKqRNboWh5eIy203M1xOpfisOmVTRuD5sFDcVXjz
WncQHi++75620shnFoh/ZPBqo2kQK8PhMcLjE5+aj+LkQo7ClqYh1o/ZFNDKDSvp2K+YMgMFSpFW
3sW7fdamxqMxjQpA0yxUykQg4w0uEzU8ARCak5rcYfWqO9k75zJdKAYZhSrM3l9a2DMZW5G8/PK
Ka1G+wonLInKiuzCZpf4P2gHNldob2aalBMdqptzlh/nsZ0ALRuXH3GzvWfEFUNZCb/BLqQWBy4840r
cjQDFJCa4UP4iXVvzkcV647481Si47TrXQ==
Example:
{
"status": 0,
"message":"Thành công"
"transid": 12436514111,
"amount": 30000,
"partnerRefId": "Merchant123556666"
}
8) Error code
Preference in section 9
Step 3: Vendor submit request (redirect request) payUrl that returned in step
2.
Step 4: M2 payment show payUrl and user interact with M2 payment in figure
2.1 (Mobile web) or figure 3.2 (PC web). After paied successful, M2 payment
return result to Vendor server and end-user.
Figure 2.1 M2 payment mobile web Figure 2.2 opening MoMo app Figure 2.3 Login MoMo account
Figure 2.4 confirm payment screen Figure 2.4 choose another money source Figure 2.5 MoMo transaction result
2) Participating Vendors
Shopping: Robins Online, Akulaku
Online ticket: CGV, Ticket box, VnTrip
Entertainment: Bigo Live, Online Games, …
Other: VTV Cab, Utilities,…
4) Exception Handling
Follow the instructions below to troubleshoot any payment exceptions:
If the Payer cannot find their order in their transaction history when they're
prompted of a payment error on MoMo, they will require the Vendor to
initiate the order again. if the order is successfully paid for, the Vendor’s
backend calls the Query Transaction Status API to query the actual payment
status again.
URL: [Link]
(partnerCode=$partnerCode&accessKey=$accessKey&
requestId=$requestId&amount=$amount&orderId=$o
derId&orderInfo=$orderInfo&returnUrl=$returnUrl&n
otifyUrl=$notifyUrl&extraData=$extraData,
$secretKey)
Example:
{
"partnerCode": "MOMOIQA420180417",
"accessKey": "F8BBA842ECF85",
"requestId": "112233445566",
"amount": "10000",
"orderId": "1505359852755",
"orderInfo": "order info",
"returnUrl": "[Link]
"notifyUrl": "[Link]
"requestType": "captureMoMoWallet",
"signature":"b11f56378efd8810186e9...71be292d891ca4b6089"
}
Return parameter detail:
Parameter Description
requestId Request ID is unique for each request
payUrl URL that Merchant server submit request (redirect)
errorCode Error code
orderId Merchant transaction is stored on M2 payment system
message Error message in English
localMessage Error message In Vietnamese
requestType Request type is captureMoMoWallet
signature Signature for security. Signature is a string was hashed by
HMAC_SHA256 algorithm
(requestId=$requestId&orderId=$orderId&message=$message&l
ocalMessage=$localMessage&payUrl=$payUrl&errorCode=$error
Code&requestType=$requestType, $secretKey)
Example:
{
"requestId": "112233445566",
"orderId": "1505359852755",
ReturnUrl:
Parameter Description
partnerCode MoMo provide for Mechant when enter into the contract or find
in [Link]
accessKey MoMo provide for merchant when integration
requestId Request ID for each request
amount Amount in VND that user purchased
orderId Transaction ID of Merchant
orderInfo Order information
orderType Transaction type is momo_wallet
transId Momo transaction
(partnerCode=$partnerCode&accessKey=$accessKey&requestId
=$requestId&amount=$amount&orderId=$oderId&orderInfo=$
orderInfo&orderType=$orderType&transId=$transId&message=
$message&localMessage=$localMessage&responseTime=$respo
nseTime&errorCode=$errorCode&payType=$payType&extraDat
a=$extraData, $secretKey)
Example:
{
"partnerCode": "MOMOIQA420180417",
"accessKey": "F8BBA842ECF85",
"requestId": "112233445566",
"orderId": "1505359852755",
"requestType" : "transactionStatus",
"signature": "b11f56378efd8810186e98d6ace…f71be292d891ca4b6089"
}
Parameter response detail:
Parameter Description
partnerCode MoMo provide for Merchant when enter into the contract or find
in [Link]
accessKey MoMo provide for Merchant when enter into the contract or find
in [Link]
requestId Request ID is unique for each request
orderId Merchant transacition ID
errorCode Error code
amount Payment amount
transId MoMo transaction ID
message Error message in English
localMessage Error message In Vietnamese
extraData Extra data
requestType Request type
payType Type payment: web or qr
signature Secure transaction in SHA256 verify with signature by
HMAC_SHA256 algorithm with format
(partnerCode=$partnerCode&accessKey=$accessKey&requestId
=$requestId&orderId=$orderId&errorCode=$errorCode&transId
=$transId&amount=$amount&message=$message&localMessag
e=$localMessage&requestType=$requestType&payType=$payT
ype&extraData=$extraData, $secretKey)
Example:
URL: [Link]
Example:
{
"partnerCode": "MOMOIQA420180417",
Parameter Description
partnerCode MoMo provide for Merchant when enter into the contract or find
in [Link]
accessKey MoMo provide for Merchant when enter into the contract or find
in [Link]
requestId Request ID is unique for each request
orderId Merchant transacition ID
errorCode Error code
transId MoMo refund transaction ID
message Error message in English
localMessage Error message In Vietnamese
requestType Request type
signature Signature for security. Signature is a string was hashed by
HMAC_SHA256 algorithm
(partnerCode=$partnerCode&accessKey=$accessKey&requestId
=$requestId&orderId=$orderId&errorCode=$errorCode&transId
=$transId&message=$message&localMessage=$localMessage&r
equestType=$requestType, $secretKey)
Example:
{
"partnerCode": "MOMOIQA420180417",
"accessKey": "SvDmj2cOTYZmQQ3H",
"requestId": "1533362283",
"orderId": "1533362283",
"amount": "10000",
"errorCode": "0",
"transId": "149164337",
"message": "Success",
"localMessage": "Thành công",
"requestType": "Request Type",
URL: [Link]
(partnerCode=$partnerCode&accessKey=$accessKey
&requestId=$requestId&orderId=$orderId&requestT
ype=$requestType, $secretKey)
Example:
{
"partnerCode": "MOMOIQA420180417",
"accessKey": "F8BBA842ECF85",
"requestId": "112233445566",
"orderId": "1505359852755",
"requestType" : "refundStatus",
"signature": "b11f56378efd8810186e98d6ace…f71be292d891ca4b6089"
}
Parameter response detail:
Parameter Description
partnerCode MoMo provide for Merchant when enter into the contract
accessKey MoMo provide for merchant when integration
(partnerCode=$partnerCode&accessKey=$accessKey&request
Id=$requestId&orderId=$orderId&errorCode=$errorCode&tra
nsId=$transId&amount=$amount&message=$message&local
Message=$localMessage&requestType=$requestType,
$secretKey)
Example:
Step 2: The end-user confirm payment on MoMo app and MoMo app response
token
Step 3: Merchant Mobile app receive data package from MoMo app and send this
package to Vendor server.
Step 4: Merchant server update payment data and send to MoMo Payment
server.
4) Exception Handling
Follow the instructions below to troubleshoot any payment exceptions:
o If the Payer cannot find their order in their transaction history when
they're prompted of a payment error on MoMo, they will require the
Vendor to initiate the order again. if the order is successfully paid for, the
Vendor’s backend calls the Query Transaction Status API to query the
actual payment status again.
Parameter Description
status Status (0: success)
message Message
data Data returned from MoMo app, will be send to MoMo server (call
as Token)
phonenumber Customer phone number
5) Status defination
Status Description
0 SUCCESS. Continue to step 3 with
[data,phonenumber] to Merchant Server
1 Please input MoMo Password
6) Example:
Android: [Link]
IOS: [Link]
URL: [Link]
Example:
{
"customerNumber": "0966787273",
"partnerCode": "MOMOIQA420180417",
"partnerRefId": "Merchant123556666",
"appData":
"v2/qml0PbOlrBYjFlZvXwRWjoMpmFmvqStTJt4DCXfE0cgMtyH5Akv+FxL2Nu8lDmxt0P3Mu
+YeCGB+UFfwXICo7D07jR6f2VhauglozphNgkK7724sO3qVKC9ZI8KCdr0k4AHuuUNF4AT6Iy2
rOmaCVF1WeyS/y/n2E4DArwaHG2J+8StiawfZPiKoUGvywNHV",
"hash":
"
A7WFmmnpn6TRX42Akh/iC5DdU5hhBT9LR5QSG6rJAl70hfEkkGUx2pTCai8s+M9KMVUcJ7m
52iv74yhmeEjjN10TtEJoqITBIYBG2bqcTprhDijyhV4ePU7ytDNuLxzzIvGfTYyvbsEJ2jZTSf556y
od12vhYqOJSFL/U2hVuxjUahf5Rnu5R/OLalg8QmlU6nQooEuNdzEXPMd6j9EaxOCiB2oM5/9
QiTN0tCNSTIVvPtnlHu5mIbBHChcwfToIL4IAiD1nbrlDuBX//CZcrZj6hFqjvU31yb/DuG02c3aq
WxbZKZ8csOwF9bL30m/yGr/0BQUWgunpDPrmCosf9A==",
"description": "Thanh toan cho don hang Merchant123556666 qua MoMo",
"version": 2.0
}
Example:
{
"partnerCode": "MOMOIQA420180417",
"partnerRefId": "Merchant123556666",
"partnerTransId": "8374736463",
"amount": 40000,
"description": "Thanh toan momo"
}
(status=$status&message=$message&amount=$amount&transid=
$transid, $secretKey)
Example:
{
"status":0,
"message": "Thành công",
Header Format:
The header consists of one line, which has the following values
The string 'H' (for Header) is fixed – all header lines should start with this string.
The
following table details the meaning, format and possible values of the following values:
Fields description:
Fields description:
Refunds:
Commission amounts can be refunded to the merchant, but it is also possible not to refund
the commission to the merchant. In the latter case, the Transaction Types SETTLED
REFUNDED CHARGED_BACK
Transaction Types:
SETTLED The transaction settlement is included in this batch.
REFUNDED A partial or full refund of a transaction
CHARGED_BACK A reversal of a transaction
Method of Transmission
Please use one of the following means for communication the EPA files to us:









