Collection Link
Process Flow
Explanation
- Step 1: Customers check out the order after shopping in-store/online
- Step 2: Merchant send request to MoMo for Collection Link (attach Merchant credential)
- Step 3: MoMo authenticates through the merchant profile and generates a collection link and returns it to the merchant.
- Step 4: There are 3 use cases:
- Case 1: Merchant is an online sales channel, after receiving the link, the system will automatically navigate to MoMo's payment page
- Case 2: Merchants are offline stores using POS machines, the system sends the link via Email/SMS of the buyer, then the buyer will open the link to go to the payment page of MoMo.
- Case 3: Merchants are SaaS (Software as a Service) partners, they will send a direct link through the buyer's chat channel, then the buyer clicks the link to go to MoMo's payment page.
- Step 5: Depending on the device, MoMo will display the corresponding web or mobile web interface.
- Step 6: Customers check order information, then choose one of the following methods: pay by MoMo E-wallet, pay by ATM card or pay by Visa/Master/JCB card.
- Step 7: Depending on the payment method chosen, proceeds accordingly:
- 7.1.
Redirect to QRC payment page
: Display the interface depending on the device that the customer is using. In case the device is a desktop or tablet, the payment information and QRC image will be displayed. In case the device is mobile, only payment information** will be displayed, if the customer has installed the MoMo app, the system will recognize it and go straight to the next step. - 7.2.
Redirect to ATM payment page
: Display order information and ask user to enters ATM card information before paying. The customer check order information, enter card information and confirm payment. Depending on the customer's device, it can display a desktop or webview interface. - 7.3.
Redirect to Visa/Master/JCB payment page
: Display order information and ask user to enter international card information before paying. The customer check order information, enter card information and confirm payment. Depending on the customer's device, it can display a desktop or webview interface.
- 7.1.
- Step 8: After scanning the QRC on the desktop or opening it directly from Mobile, the customer is directed to a secure payment confirmation screen, then clicks 'Confirm payment'.
- Step 9: MoMo's Payment Gateway processes the payment, then returns the payment transaction result to Merchant
API Configuration
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 payWithMethod
to get payment methods and then apply suitable ones to their platforms.
requestType
: Identify the type of the request
POST /v2/gateway/api/create
Attribute | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration information | |
storeId | String | Store ID | |
requestId | String(50) | Request ID, unique for each request, MoMo's partner uses the requestId field for idempotency control | |
amount | Long | Amount needs to be paid Min: 1.000 VND Max: 50.000.000 VND Currency: VND Data type: Long Note: The payment method for ATM cards and Credit cards is enabled for transactions with a minimum amount of 10,000 VND. | |
orderId | String | Partner Transaction ID Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$ | |
orderInfo | String | Order's information | |
redirectUrl | String | 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 | |
ipnUrl | String | Partner API. Used by MoMo to submit payment results by IPN method (server-to-server) method | |
requestType | String | payWithMethod | |
extraData | String | Encode base64 follow Jsonformat: {"key": "value"} Example with data: {"email": "example@gmail.com"} => data of extraData : eyJlbWFpbCI6ICJleGFtcGxlQGdtYWlsLmNvbSJ9 | |
items | List | List of products displayed on the payment page. Example Data: [{"image": "https://momo.vn/uploads/product1.jpg", "name": "Product 1", "quantity": 1, "amount": 20000}, {"image": "https://momo.vn/uploads/product2.jpg", "name": "Product 2", "quantity": 2, "amount": 30000}] | |
userInfo | Object | User Info Example Data: {"phoneNumber": "0123456789", "email": "momo@momo.vn", "name": "momo" } | |
autoCapture | Boolean | If set to false , the payment will not be automatically captured.Note: autoCapture = 'false' only applies to payment methods via MoMo e-Wallet and Credit card | |
lang | String | Language of returned message (vi or en ) | |
signature | String | Signature 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 items
content
Attribute | Type | Required | Description |
---|---|---|---|
id | String | SKU number | |
name | String | Name of the product | |
description | String | Description of the product | |
category | String | Product classification/Product category | |
imageUrl | String | Link image of product | |
manufacturer | String | Name of manufacturer | |
price | Long | Unit price Currency: VND | |
currency | String | VND | |
quantity | Integer | Quantity number of the product. It must be greater than 0 | |
unit | String | The units of measurement used for products | |
totalPrice | Long | Total price = price x quantity | |
taxAmount | Long | Total amount of tax |
Example Item
{
"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": 11000,
"quantity": 5,
"unit":"hộp",
"totalPrice": 55000,
"taxAmount":"200"
}
Details of userInfo
content
Attribute | Type | Required | Description |
---|---|---|---|
name | String | Name of the customer as registered on merchant site | |
phoneNumber | String | Phone number of the customer as registered on merchant site | |
String | Email address of the customer as registered on merchant site |
Example UserInfo
{
"name": "Nguyen Van A",
"phoneNumber": "0999888999",
"email": "email_add@domain.com"
}
Redirecting information (redirectUrl)
WebLink: Link to open website.
AppLink: Link to open mobile application.
Learn more about AppLink
- Android: https://developer.android.com/training/app-links
- IOS: https://developer.apple.com/documentation/uikit/core_app/..
Example Request
{
"partnerCode": "MOMO",
"partnerName" : "Test",
"storeId" : "MoMoTestStore",
"requestType": "payWithMethod",
"ipnUrl": "https://momo.vn",
"redirectUrl": "https://momo.vn",
"orderId": "MM1540456472575",
"amount": 150000,
"lang": "vi",
"orderInfo": "SDK team.",
"orderExpireTime" : 30,
"requestId": "MM1540456472575",
"extraData": "eyJ1c2VybmFtZSI6ICJtb21vIn0=",
"signature": "fd37abbee777e13eaa0d0690d184e4d7e2fb43977281ab0e20701721f07a0e07"
}
List of payment methods that MoMo provides:
Attribute | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration information | |
requestId | String | Same as the original request | |
orderId | String | Partner Transaction ID Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$ | |
amount | Long | Same as the original payment amount | |
responseTime | Long | Time to respond payment results to partner Format: timestamp | |
message | String | Error description, error language is based on lang | |
resultCode | Integer | Result Code | |
payUrl | String | URL for switching from the partner's page to the MoMo payment page | |
shortLink | String | A short URL represents a payUrl containing parameters in a smaller and simpler format |
Example response
{
"partnerCode": "MOMO",
"requestId": "MM1540456472575",
"orderId": "MM1540456472575",
"amount": 150000,
"responseTime": 145256987,
"message": "Thành công",
"resultCode": 0,
"payUrl": "https://test-payment.momo.vn/v2/gateway/pay?t=TU9NT1NKSTEyMDE5MDgyM3wxNjEzNTMyMDk3OTIyOjAxMjM0NTY3Nzg="
"shortLink": "https://test-payment.momo.vn/shortlink/smTZN2oL2s"
}
Payment
You need to install MoMo Test app and use MoMo TEST Account to process payment.
Payment guideline: Login > Home screen > Scan QR.
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
.
Attribute | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration Information | |
orderId | String | Partner Transaction ID Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$ | |
requestId | String | Partner's requestId | |
amount | Long | Payment amount | |
orderInfo | String | Order's information | |
partnerUserId | String | MoMo's unique identifier for each MoMo eWallet account. | |
orderType | String | momo_wallet | |
transId | Long | MoMo's transaction ID | |
resultCode | Integer | Transaction status of the order Result Code | |
message | String | Error description, languague is based on lang | |
payType | String | Payment type: qr , webApp , credit or napas | |
responseTime | Long | Time to respond payment results to partner Format: timestamp | |
extraData | String | extraData. Default: "" | |
signature | String | Signature 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 |