Skip to main content

One-Time Payments

Process Flow

Flow diagram

Onetime_flow

Explanation

  • Step 1: Customer (user) checks out order and chooses to pay using domestic ATM card.
  • Step 2: Your server creates a payment session and sends payment request to MoMo.
  • Step 3: MoMo provides a URL for merchant.
  • Step 4: Merchant website redirects to MoMo's domestic ATM card payment page, using provided URL in step 3.
  • Step 5,6: User provides ATM card information and makes payment.
  • Step 7: MoMo executes the transaction, notifies the merchant and redirects user back to merchant website.
  • Step 8: Merchant verifies the transaction result & displays transaction result to user.

API Configuration

HTTP Information

Initiate payment method

At merchant website, users choose products or services and make payment using domestic ATM card, then Merchant server will call MoMo API to retrieve the payment URL, and will redirect users to the payment page.

API information to retrieve payment URL

HTTP Request

POST /v2/gateway/api/create

AttributeTypeRequiredDescription
partnerCodeStringIntegration information
partnerNameStringPartner 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: 10.000 VND
Max: 50.000.000 VND
Currency: VND
Data type: Long
orderIdStringOrderId of partner, unique for each request
orderInfoStringOrder's information
redirectUrlStringA 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
requestTypeStringpayWithATM
extraDataStringDefault value is empty ""
Encode base64 follow Jsonformat: {"key": "value"}
Example with data: {"username": "momo"}=> data of extraData: eyJ1c2VybmFtZSI6ICJtb21vIn0=
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

Redirecting information (redirectUrl)

WebLink: Links to open website. Example: http(s)://example.com/

AppLink: Link to open mobile application.

Learn more about AppLink

Example Request

{
"partnerCode": "MOMO",
"partnerName" : "Test",
"storeId" : "MoMoTestStore",
"requestType": "payWithATM",
"ipnUrl": "http://www.example.com",
"redirectUrl": "http://www.example.com",
"orderId": "6d0a1b10-b382-11e9-8fda-91fa25841420",
"amount": 30000,
"lang": "vi",
"orderInfo": "pay with MoMo ATM",
"requestId": "6d0a1b11-b382-11e9-8fda-91fa25841420",
"extraData": "email=abc@gmail.com",
"signature": "5344e1f4244173fe0ba2b4c865881aad79b86beff8154b4f74f3b92634ffa711",
}
HTTP Response
AttributeTypeRequiredDescription
partnerCodeStringIntegration information
requestIdStringSame as the original request
orderIdStringOrderId of partner, unique for each request
amountLongSame as the original payment amount
responseTimeLongTime to respond payment results to partner
Format: timestamp
messageStringError description, error language is based on lang
resultCodeIntegerResult Code
payUrlStringURL for switching from the partner's page to the MoMo payment page

Example Response

{
"partnerCode": "MOMO",
"requestId": "6d0a1b11-b382-11e9-8fda-91fa25841420",
"orderId": "6d0a1b10-b382-11e9-8fda-91fa25841420",
"amount": 30000,
"message": "Success",
"resultCode": 0,
"payUrl": "https://test-payment.momo.vn/v2/gateway/pay?t=TU9NT1NKSTEyMDE5MDgyM3wxNjEyODQwNTMyNDI3OjAxMjM0NTY3Nzg="
}

Payment

You can use ATM Cards Test to process payment.

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
orderIdStringOrderId of partner, unique for each request
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: napas
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

Result Codes & Messages

Kindly locate result codes and messages of One-time Payments of Local ATM Card Payments in the comprehensive list of result codes provided here.

See also