Nhảy tới nội dung

Promotion Info

One-Time Payments

API Configuration

HTTP Information

Initiate payment method

On the merchant's payment page, after customers choose to pay with MoMo e-wallet, merchant server needs to call MoMo's API captureWallet to get payment methods and then apply suitable ones to their platforms.

requestType: Identify the type of the request

HTTP Request

POST /v2/gateway/api/create

AttributeTypeRequiredDescription
partnerCodeStringIntegration information
subPartnerCodeStringSub partner Id
storeNameStringStore name
storeIdStringStore ID
requestIdString(50)Request ID, unique for each request,
MoMo's partner uses the requestId field for idempotency control
amountLongAmount needs to be paid
Min: 1.000 VND
Max: 50.000.000 VND
Currency: VND
Data type: Long
orderIdStringPartner Transaction ID
Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$
orderInfoStringOrder's information
orderGroupIdLongThe orderGroupId will be provided by MoMo to classify groups of orders for further operational activities. Please contact MoMo to use this field.
redirectUrlStringDefault value is empty ""
A partner's URL. This URL is used to redirect from MoMo page to partner's page after customer's payment.
Support: AppLink and WebLink
ipnUrlStringPartner API. Used by MoMo to submit payment results by IPN method (server-to-server) method
requestTypeStringcaptureWallet
extraDataStringDefault value is empty ""
Encode base64 follow Jsonformat: {"key":"value"}
Example with data: {"username":"momo","skus":"value1,value2"}
=> data of extraData: eyJ1c2VybmFtZSI6Im1vbW8iLCJza3VzIjoidmFsdWUxLHZhbHVlMiJ9
itemsListList of products displayed on the payment page. Maximum: 50 items
deliveryInfoObjectDelivery info of this order
userInfoObjectInfo of the customer
autoCaptureBooleanIf set to false, the payment will not be automatically captured.
langStringLanguage of returned message (vi or en)
signatureStringSignature to confirm information. Secure transaction in Hmac_SHA256 with format: a String sort all key name of data field from a-z:
accessKey=$accessKey&amount=$amount&extraData=$extraData
&ipnUrl=$ipnUrl&orderId=$orderId&orderInfo=$orderInfo
&partnerCode=$partnerCode&redirectUrl=$redirectUrl
&requestId=$requestId&requestType=$requestType
Details of an item

It is not required to add items. Howvever, each item added must have these fixed keys:

AttributeTypeRequiredDescription
idStringSKU number
nameStringName of the product
descriptionStringDescription of the product
categoryStringProduct classification/Product category
imageUrlStringLink image of product
manufacturerStringName of manufacturer
priceLongUnit price
currencyStringVND
quantityIntegerQuantity number of the product. It must be greater than 0
unitStringThe units of measurement used for products
totalPriceLongTotal price = price x quantity
taxAmountLongTotal amount of tax
Details of deliveryInfo
AttributeTypeRequiredDescription
deliveryAddressStringDelivery address
deliveryFeeStringDelivery fee
quantityStringQuantity of product
Details of userInfo content

If this is provided, customer as MoMo user will be receive a notification or email (by choices).

AttributeTypeRequiredDescription
nameStringName of the customer as registered on merchant site
phoneNumberStringPhone number of the customer as registered on merchant site
emailStringEmail address of the customer as registered on merchant site

Redirecting information (redirectUrl)

WebLink: Links to open website.

AppLink: Link to open mobile application.

Learn more about AppLink

Example Request
{
"partnerCode": "MOMOSJNT20200819",
"storeName": "MoMo 8 Hoàng Văn Thái",
"storeId": "12345",
"requestType": "captureWallet",
"ipnUrl": "https://momo.vn/",
"redirectUrl": "https://momo.vn/",
"orderId": "OD1684902769001",
"amount": "120000",
"orderInfo": "MoMo_test",
"requestId": "RQ1684902769001",
"extraData": "eyJ1c2VybmFtZSI6Im1vbW8iLCJza3VzIjoidmFsdWUxLHZhbHVlMiJ9",
"signature": "9ec3b6afdb6101cf707982d765705a379be7230a460a9e7fac49df8e4b065441",
"lang": "vi",
"autoCapture": "true",
"orderGroupId": "",
"deliveryInfo": {
"deliveryAddress": "8 Hoàng Văn Thái, Tân Phú, Quận 7",
"deliveryFee": "20000",
"quantity": "5"
},
"userInfo": {
"name": "MoMo",
"phoneNumber": "0987123456",
"email": "email@gmail.com"
},
"items": [
{
"id": "204727",
"name": "YOMOST Bac Ha&Viet Quat 170ml",
"description": "YOMOST Sua Chua Uong Bac Ha&Viet Quat 170ml/1 Hop",
"category": "beverage",
"imageUrl": "https://momo.vn/uploads/product1.jpg",
"manufacturer": "Vinamilk",
"price": 20000,
"currency": "VND",
"quantity": 2,
"unit": "hộp",
"totalPrice": 40000,
"taxAmount": "200"
},
{
"id": "204782",
"name": "YOMOST Dau Tay 170ml",
"description": "YOMOST Sua Chua Uong Dau Tay 170ml/1 Hop",
"category": "beverage",
"imageUrl": "https://momo.vn/uploads/product2.jpg",
"manufacturer": "Vinamilk",
"price": 20000,
"quantity": 3,
"unit": "hộp",
"totalPrice": 60000,
"taxAmount": "200"
}
]
}

Try yourself

HTTP Response
AttributeTypeRequiredDescription
partnerCodeStringIntegration information
requestIdStringSame as the original request
orderIdStringPartner Transaction ID
amountLongSame as the original payment amount
responseTimeLongTime to respond payment results to partner
Format: timestamp
messageStringError description, error language is based on lang
resultCodeintResult Code
payUrlStringURL for switching from the partner's page to the MoMo payment page
deeplinkStringURL to open MoMo application directly (Customers must install MoMo app first) and payment confirmation screen.
If you have problem opening deeplink in android 11, please see the tutorial
qrCodeUrlStringData to generate QR code if you want customers to scan the QR code directly on your purchase page or to print it on the invoice.
Note: This URL is NOT containing the image of the QR code, you need to use an external library to generate the QR code.
deeplinkMiniAppStringURL to open the MoMo app's payment confirmation screen. Apply when partner's website is embedded into MoMo app.
signatureStringSignature to confirm information. Secure transaction in Hmac_SHA256 with format:
accessKey=$accessKey&amount=$amount&message=$message&orderId=$orderId
&partnerCode=$partnerCode&payUrl=&payUrl&requestId=
$requestId&responseTime=$responseTime&resultCode=$resultCode

On the production environment: You need to request permission to use qrCodeUrl, deeplink,deeplinkMiniApp fields.

Example response
{
"partnerCode": "MOMOSJNT20200819",
"orderId": "OD1684902769001",
"requestId": "RQ1684902769001",
"amount": 120000,
"responseTime": 1684902770151,
"message": "Thành công.",
"resultCode": 0,
"payUrl": "https://test-payment.momo.vn/v2/gateway/pay?t=TU9NT1NKTlQyMDIwMDgxOXxPRDE2ODQ5MDI3NjkwMDE",
"deeplink": "momo://app?action=payWithApp&isScanQR=false&serviceType=app&sid=TU9NT1NKTlQyMDIwMDgxOXxPRDE2ODQ5MDI3NjkwMDE&v=3.0",
"qrCodeUrl": "momo://app?action=payWithApp&isScanQR=true&serviceType=qr&sid=TU9NT1NKTlQyMDIwMDgxOXxPRDE2ODQ5MDI3NjkwMDE&v=3.0",
"deeplinkMiniApp": "momo://app?action=payWithApp&isScanQR=false&serviceType=miniapp&sid=TU9NT1NKTlQyMDIwMDgxOXxPRDE2ODQ5MDI3NjkwMDE&v=3.0"
}

Quick Pay - POS Scanner

API Configuration

HTTP Information

Payment Processing

Describe data the POS server sends through the MoMo server to authorization.

Minimum timeout when call this API must be 30s to ensure receive response from MoMo.

HTTP Request

POST /v2/gateway/api/pos

ParameterTypeRequiredDescription
partnerCodeStringIntegration information
storeIdStringStore ID
storeNameStringStore name
orderIdStringPartner Transaction ID
Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$
amountLongPayment amount
Min: 1.000 VND
Max: 5.000.000 VND
Currency: VND.
requestIdString(50)Request ID, unique for each request, MoMo's partner uses the requestId field for idempotency control
paymentCodeStringEncrypt a String Payment code created from MoMo app that is scanned by cashier by RSA using public Key RSA Encryption
orderInfoStringShort information
orderGroupIdLongThe orderGroupId will be provided by MoMo to classify groups of orders for further operational activities. Please contact MoMo to use this field.
autoCaptureBooleanIf set to false, the payment will not be automatically captured.
ipnUrlStringMerchant’s API Endpoint. Used by MoMo to send payment results via IPN method (server-to-server)
extraDataStringDefault value is empty ""
Encode base64 follow Jsonformat: {"key":"value"}
Example with data: {"username":"momo","skus":"value1,value2"}
=> data of extraData: eyJ1c2VybmFtZSI6Im1vbW8iLCJza3VzIjoidmFsdWUxLHZhbHVlMiJ9
itemsListList of products displayed on the payment page. Maximum: 50 items
userInfoObjectInfo of the customer`
langStringLanguage of returned message (vi or en)
signatureStringSignature to confirm information. Secure transaction in Hmac_SHA256  algorithm with format, a String sort all key name of data field from a-z:
accessKey=$accessKey&amount=$amount&extraData=$extraData
&orderId=$orderId&orderInfo=$orderInfo&partnerCode=$partnerCode
&paymentCode=$paymentCode&requestId=$requestId
Details of an items

It is not required to add items. Howvever, each item added must have these fixed keys:

AttributeTypeRequiredDescription
idStringSKU number
nameStringName of the product
descriptionStringDescription of the product
categoryStringProduct classification/Product category
imageUrlStringLink image of product
manufacturerStringName of manufacturer
priceLongUnit price
currencyStringVND
quantityIntegerQuantity number of the product. It must be greater than 0
unitStringThe units of measurement used for products
totalPriceLongTotal price = price x quantity
taxAmountLongTotal amount of tax
Details of userInfo content

If this is provided, customer as MoMo user will be receive a notification or email (by choices).

AttributeTypeRequiredDescription
nameStringName of the customer as registered on merchant site
phoneNumberStringPhone number of the customer as registered on merchant site
emailStringEmail address of the customer as registered on merchant site

HTTP Response

AttributeTypeRequiredDescription
partnerCodeStringIntegration information
orderIdStringPartner Transaction ID
Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$entification
requestIdStringEach Request’s Identification
amountLongPayment amount
Min: 1.000 VND
Max: 5.000.000 VND
Currency: VND.
transIdLongMoMo's transaction ID
responseTimeLongTime to respond payment results to partner Format: timestamp
resultCodeIntegerOrder status
messageStringResult description, language is based on lang
promotionInfoListThe data to identify the promotion campaign in which the voucher(s) was applied in the payment transaction, with fixed keys for each voucher
Default value is empty ""
Details of promotionInfo
AttributeTypeRequiredDescription
amountLongDiscount amount of payment
amountSponsorLongDiscount amount sponsor of merchant
voucherIdStringID of the voucher/ campaign
voucherTypeStringPercent
voucherNameStringName of the voucher/ campaign
merchantRateLongMerchant rate of the voucher/ campaign

Processing payment result

For more information, see Payment Notification.

Parameter description

Description for parameters which are used by MoMo in the URL redirectUrl and the body content of ipnUrl.

AttributeTypeRequiredDescription
partnerCodeStringIntegration Information
orderIdStringPartner Transaction ID
requestIdStringPartner's requestId
amountLongPayment amount
partnerUserIdStringMoMo's unique identifier for each MoMo eWallet account.
orderInfoStringOrder's information
orderTypeStringmomo_wallet
transIdLongMoMo's transaction ID
resultCodeIntegerTransaction status of the order Result Code
messageStringError description, languague is based on lang
payTypeStringPayment type: webApp, app,qror miniapp
responseTimeLongTime to respond payment results to partner
Format: timestamp
extraDataStringExtra Data. Default: ""
signatureStringSignature to confirm information. Secure transaction in Hmac_SHA256  algorithm with format: a String sort all key name of data field from a-z:
accessKey=$accessKey&amount=$amount&extraData=$extraData
&message=$message&orderId=$orderId&orderInfo=$orderInfo
&orderType=$orderType&partnerCode=$partnerCode&payType=
$payType&requestId=$requestId&responseTime=
$responseTime&resultCode=$resultCode&transId=$transId
promotionInfoJsonArrayThe data to identify the promotion campaign in which the voucher(s) was applied in the payment transaction, with fixed keys for each voucher
Default value is empty ""
Details of promotionInfo
AttributeTypeRequiredDescription
amountLongDiscount amount of payment
amountSponsorLongDiscount amount sponsor of merchant
voucherIdStringID of the voucher/ campaign
voucherTypeStringPercent
voucherNameStringName of the voucher/ campaign
merchantRateLongMerchant rate of the voucher/ campaign

Check Transaction Status

This API gets the transaction status corresponding to requested OrderId for specific merchant.

HTTP Request

POST /v2/gateway/api/query

AttributeTypeRequiredDescription
partnerCodeStringIntegration information
requestIdStringUnique ID of each request
orderIdStringID of order that needs to be checked.
langStringLanguage of returned message (vi or en)
signatureStringSignature to check information. Use Hmac_SHA256 algorithm with data in format: accessKey=$accessKey&orderId=$orderId&partnerCode=$partnerCode
&requestId=$requestId
Example request
{
"partnerCode": "MOMOSJNT20200819",
"requestId": "1684900982569",
"orderId": "235_1684743462594",
"lang": "vi",
"signature": "fe330c5bb1a05042d9633ca317166997bb48cf7e0cc1a950703f353026c0bb08"
}

Try yourself

HTTP Response
AttributeTypeRequiredDescription
partnerCodeStringIntegration information
requestIdStringUnique ID of each request
orderIdStringPartner Transaction ID
Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$
extraDataStringExtra Data. Default: value transmitted by merchant in captureWallet API
amountLongPayment amount
transIdLongMoMo's transaction ID
payTypeStringPayment method. web or qr. Default: "" if it is not a payment
resultCodeintResult Code
refundTransListList of refund transactions
messageStringError description based on lang
responseTimeLongTime to respond payment results to partner
Format: timestamp
promotionInfoListThe data to identify the promotion campaign in which the voucher(s) was applied in the payment transaction, with fixed keys for each voucher
Default value is empty ""
Details of promotionInfo
AttributeTypeRequiredDescription
amountLongDiscount amount of payment
amountSponsorLongDiscount amount sponsor of merchant
voucherIdStringID of the voucher/ campaign
voucherTypeStringPercent
voucherNameStringName of the voucher/ campaign
merchantRateLongMerchant rate of the voucher/ campaign
Example response
{
"partnerCode": "MOMOSJNT20200819",
"orderId": "235_1684743462594",
"requestId": "1684900982569",
"extraData": "eyJza3VzIjoiUUFaMDAxIn0=",
"amount": 60000,
"transId": 3005899645,
"payType": "pos",
"resultCode": 0,
"refundTrans": [],
"message": "Thành công.",
"responseTime": 1684900983668,
"lastUpdated": 1684743466951,
"promotionInfo": [
{
"amount": 10000,
"amountSponsor": 5000,
"voucherId": "kingfood_sku-be9c7aca-a623-4a53-9d5b-c017f5c0b842",
"voucherType": "kingfood_sku",
"voucherName": "Thẻ quà SKU Kingfoodmart -30% max 100k cho bill từ 50k",
"merchantRate": "50"
}
]
}