Skip to main content

Quick Pay - POS Scanner

Process Flow

Flow diagram

Quickpay_flow

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 or cancel) depending on the result of the processing.
  • Step 6: MoMo’s Server processes the confirm request and returns result to POS server.

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
subPartnerCodeStringSub partner Id
Apply to Master Merchant, 3PSP: third party services provider groups only
storeIdStringStore ID
storeNameStringPartner store 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
requestTimeLongTime partner send request to MoMo. Format: timestamp
Example: 1692783998394
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 null
Details of promotionInfo
AttributeTypeRequiredDescription
amountLongDiscount amount of payment
amountSponsorLongDiscount amount sponsor of merchant
voucherIdStringID of the voucher/ campaign
voucherTypeStringPercent
voucherNameStringName of the voucher/ campaign
merchantRateStringMerchant 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.

AttributeTypeRequiredDescription
partnerCodeStringIntegration Information
orderIdStringPartner Transaction ID
requestIdStringPartner's requestId
amountLongPayment amount
orderInfoStringOrder's information
orderTypeStringmomo_wallet
partnerUserIdStringMoMo's unique identifier for each MoMo eWallet account.
transIdLongMoMo's transaction ID
resultCodeIntegerTransaction status of the order Result Code
messageStringError description, languague is based on lang
payTypeStringPayment type: pos
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
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 null
Details of promotionInfo
AttributeTypeRequiredDescription
amountLongDiscount amount of payment
amountSponsorLongDiscount amount sponsor of merchant
voucherIdStringID of the voucher/ campaign
voucherTypeStringPercent
voucherNameStringName of the voucher/ campaign
merchantRateStringMerchant 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 codeDescriptionFinal StatusRecommended actionsType
0Successful.Yes
44Transaction rejected due to invalid paymentCode.NoThe 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
4005Transantion rejected due to consumer's QR Code has expired or invalid.YesPlease ask the consumer to refresh their personal QR Code.User error

See also