Quick Pay - POS Scanner
Process Flow
Flow diagram
Explanation
- Step 1: User logs in MoMo app, selects MÃ THANH TOÁN (Payment Code) to create a payment code (
paymentCode
). - Step 2: Cashier scans Bar code (or QR code) on the user’s screen to get
paymentCode
, and the information will be sent to partner’s POS server. - Step 3: POS Server packs and sends received transaction information to MoMo’s server for authorization.
- Step 4: MoMo’s Server processes the request and returns the authorization result to POS server. If failed (cannot make authorization), transaction ends here. If succeed, MoMo’s server will call
ipnUrl
if have config (API provided by partner in MoMo’s format, view detail to notify order payment status. - Step 5: (Not necessary if
autoCapture=true
in step 3) POS Server receives result returned from MoMo’s Server, processes and send corresponding request to MoMo’s server to confirm the transaction (capture
orcancel
) depending on the result of the processing. - Step 6: MoMo’s Server processes the
confirm
request and returns result to POS server.
API Configuration
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.
POST /v2/gateway/api/pos
Parameter | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration information | |
subPartnerCode | String | Sub partner Id Apply to Master Merchant, 3PSP: third party services provider groups only | |
storeId | String | Store ID | |
storeName | String | Partner store name | |
orderId | String | Partner Transaction ID Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$ | |
amount | Long | Payment amount Min: 1.000 VND Max: 5.000.000 VND Currency: VND . | |
requestId | String(50) | Request ID, unique for each request, MoMo's partner uses the requestId field for idempotency control | |
paymentCode | String | Encrypt a String Payment code created from MoMo app that is scanned by cashier by RSA using public Key RSA Encryption | |
orderInfo | String | Short information | |
orderGroupId | Long | The orderGroupId will be provided by MoMo to classify groups of orders for further operational activities. Please contact MoMo to use this field. | |
autoCapture | Boolean | If set to false, the payment will not be automatically captured. | |
ipnUrl | String | Merchant’s API Endpoint. Used by MoMo to send payment results via IPN method (server-to-server) | |
extraData | String | Default value is empty "" Encode base64 follow Jsonformat: {"key":"value"} Example with data: {"username":"momo","skus":"value1,value2"} => data of extraData : eyJ1c2VybmFtZSI6Im1vbW8iLCJza3VzIjoidmFsdWUxLHZhbHVlMiJ9 | |
items | List | List of products displayed on the payment page. Maximum: 50 items | |
userInfo | Object | Info of the customer | |
requestTime | Long | Time partner send request to MoMo. Format: timestamp Example: 1692783998394 | |
lang | String | Language of returned message (vi or en ) | |
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 &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:
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 | 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 |
Details of userInfo
content
If this is provided, customer as MoMo user will be receive a notification or email (by choices).
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 |
HTTP Response
Attribute | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration information | |
orderId | String | Partner Transaction ID Regex: ^[0-9a-zA-Z]([-_.]*[0-9a-zA-Z]+)*$ entification | |
requestId | String | Each Request’s Identification | |
amount | Long | Payment amount Min: 1.000 VND Max: 5.000.000 VND Currency: VND . | |
transId | Long | MoMo's transaction ID | |
responseTime | Long | Time to respond payment results to partner. Format: timestamp | |
resultCode | Integer | Order status | |
message | String | Result description, language is based on lang | |
promotionInfo | List | The 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 null |
Details of promotionInfo
Attribute | Type | Required | Description |
---|---|---|---|
amount | Long | Discount amount of payment | |
amountSponsor | Long | Discount amount sponsor of merchant | |
voucherId | String | ID of the voucher/ campaign | |
voucherType | String | Percent | |
voucherName | String | Name of the voucher/ campaign | |
merchantRate | String | Merchant 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 body content of ipnUrl
.
Attribute | Type | Required | Description |
---|---|---|---|
partnerCode | String | Integration Information | |
orderId | String | Partner Transaction ID | |
requestId | String | Partner's requestId | |
amount | Long | Payment amount | |
orderInfo | String | Order's information | |
orderType | String | momo_wallet | |
partnerUserId | String | MoMo's unique identifier for each MoMo eWallet account. | |
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: pos | |
responseTime | Long | Time to respond payment results to partner Format: timestamp | |
extraData | String | Extra Data. 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 | |
promotionInfo | List | The 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 null |
Details of promotionInfo
Attribute | Type | Required | Description |
---|---|---|---|
amount | Long | Discount amount of payment | |
amountSponsor | Long | Discount amount sponsor of merchant | |
voucherId | String | ID of the voucher/ campaign | |
voucherType | String | Percent | |
voucherName | String | Name of the voucher/ campaign | |
merchantRate | String | Merchant rate of the voucher/ campaign |
Result Codes & Messages
These result codes and messages are exclusively assigned for Quick Pay - POS Scanner. Additionally, kindly locate other result codes and messages in the comprehensive list of result codes provided here.
Result code | Description | Final Status | Recommended actions | Type |
---|---|---|---|---|
0 | Successful. | Yes | ||
44 | Transaction rejected due to invalid paymentCode. | No | The payment code format is incorrect. Please check if user does not use MoMo Payment QR, or strange characters has been added accidentally during scanning due to POS problem. A valid payment code should follow 1 of these formats: "MM"" + "18 digit" => example: MM561918531775222861 "mm"" + "18 digit" => example: mm561918531775222861 "18 digit" => example: 561918531775222861 | User error |
4005 | Transantion rejected due to consumer's QR Code has expired or invalid. | Yes | Please ask the consumer to refresh their personal QR Code. | User error |