Please read Onboarding first!!

Overview

This document describes the API methods that partner uses to interact with the MoMo.

Flow

Using methods:


1 - Init

The following endpoint sends the MoMo user identifier to the partner and display the partner url on screen.

SERVER CLIENT END POINT METHOD HEADERS
PARTNER MOMO /api/v1/init POST Reference to Headers

Sample Request

{
  "requestId": "UNIQUE_REQUEST_ID_wQbrU3t8Wye67g3yIi9k",
  "reference1": "78bs8sbs9e6aq93458vbw321z",
  "paymentUrl": "momo://"
}

Sample Response

{
  "requestId": "UNIQUE_REQUEST_ID_wQbrU3t8Wye67g3yIi9k",
  "resultCode": 0,
  "message": "Success",
  "accountInfo": {
    "name": "PARTNER_USER_ID_asnfhiwur",
    "name": "Nguyễn Văn A",
    "email": "test@gmail.com",
    "mobile": "0987654321"
  },
  "url": "https://momo.partner.com/login"
}

Payload

Request Parameters

Name Type R L Description
requestId String x L1 Unique String for each request
reference1 String x L1 Unique user identifier on MoMo
paymentUrl String x L1 Vendor calls this URL with payment information to be redirected to MoMo for payment

Response Params

Name Type R L Description
requestId String x L1 Same with request
referenceId String x L1 Unique for each response
resultCode Number x L1 Result Code of request
message String x L1 The result message
accountInfo JsonObject x L1 JsonObject about the wallet information
id String x L2 Client (Buyer) id
name String x L2 Client (Buyer) name
email String x L2 Client email
mobile String x L2 Phone number
url String x L1 Momo will display the partner url on screen

2 - Call payment

The following endpoint allows partner get payment on MoMo.

SERVER CLIENT END POINT METHOD HEADERS
MOMO PARTNER paymentUrl with the payment info GET

Sample Request

momo://?action=payment&client=appinapp&code=MoMo2020&serviceCode=MoMo2020&description=Payment+in+MoMo+app&formData=&partnerId=MoMo202001&partnerName=Dịch vụ&version=v1&requestId=1610439037&callbackUrl=&billId=12343905834&amount=33000&checksum=ca3c203f0c16873e688fada1785f3169e7a447f1d6c9ee116b636ff407d6fe39

Payload

Request Parameters

Name Type R L Description
action String x L1 payment (default value)
client String x L1 webinapp (default value)
initTransBE String x L1 true (default value)
code String x L1 Momo will provide when integrate
serviceCode String x L1 Momo will provide when integrate
partnerName String x L1 Momo will provide when integrate
partnerId String x L1 Momo will provide when integrate
version String x L1 Momo will provide when integrate
description String x L1 Short description for services.
formData String x L1
requestId String x L1 Unique identifier for each request
billId String x L1 Unique merchant payment transaction ID
amount String x L1 Payment amount in VND
callbackUrl String L1 MoMo user will be redirect to this URL
checksum String x L1 checksum for security. checksum is a string was hashed by HMAC SHA256 algorithm

The checksum is:

HMAC_SHA256(partnerId=$partnerId&requestId=$requestId&billId=$billId&amount=$amount, $Secret Key)


3 - Payment Notification

The following endpoint pushes the payment result to partner.

Partner returns the HTTP Status 200 to signal that they received payment info.

SERVER CLIENT END POINT METHOD HEADERS
PARTNER MOMO notifyUrl POST Reference to Headers

Sample Request

{
  "requestId": "REQUEST_ID_1511347353577",
  "referenceId": "TRACE_ID_1511347353577",
  "resultCode": 0,
  "message": "Success",
  "billId": "BILL_ID_1511347353577",
  "momoTransId": "g0ZGZmNjVmOWIjNTk2NTk4ZTYyZGI3",
  "amount": 30000
}

Sample response

{
  "requestId": "REQUEST_ID_1511347353577",
  "paymentRef":"732854576348",
  "resultCode": 0,
  "message": "Success"
}

Payload

Request Params

Name Type R L Description
requestId String x L1 Same with payment request
referenceId String x L1 Unique for each response
resultCode Number x L1 Result code. "0" means SUCCESS
message String x L1 Result message
billId String x L1 Unique merchant payment transaction ID
momoTransId String x L1 MoMo transaction ID
amount String x L1 Payment amount

Response Params

Name Type R L Description
requestId String x L1 Same with request
paymentRef String 50 x Unique number for each payment response
resultCode Number x L1 Result code
message String(100) x L1 Result message