Nhảy tới nội dung

Integration Process

1. Convention

1.1. HTTP Status Code

Status CodeDescription
200Requests are received and processed successfully by the server. There might be a business-related issue which is clarified by status field in the response body.
400Any issue related to input format and validation. Details is provided in the response body.
Other HTTP StatusSee standard HTTP Status Code specification

1.2. HTTP Request Header

PropertyTypeRequiredDescription
AuthenticationStringY (*)The access token obtained in the login request. See Create access token API
Content-TypeStringYApplication/JSON
X-Request-IdStringYUnique for each request (UUID)

(*) This header is required for all requests except the login request.

1.3. HTTP Response Body

Following fields are always included in the response body of a request

PropertyTypeDescription
statusStringSpecify any business related issue. See section 1.4 for more details
messageStringThe description of the above status code

Example of a Successful Request

{
"status": "SUCCESS",
"message": "Thành công"
}

1.4. Common status codes

Status codeDescription
SUCCESSRequest was processed successfully.
FAILRequest was processed failed

1.5. Date time format

#FormatExample
1UNIX timestamp in millisecond1649993539000

2. Authentication

Partner needs to be granted access to its merchants' data.

Overall

Partner uses provided clientId and clientSecret to get an access token (using the Create Access Token API) and pass the token as Bearer in the Authorization header of all subsequent requests. MoMo will throw errors for expired or invalid access tokens.

Create access token API

API to get an access token for subsequent API requests.

HTTP Request

POST <{Environment Domain}/authentication/login>

Request body

FieldTypeDescription
clientIdStringThe identifier provided by MoMo
clientSecretStringThe secret provided by MoMo

Example

{
"clientId": "clientId",
"clientSecret": "clientSecret"
}

HTTP Response

FieldTypeDescription
statusStringSee convention for common status code
messageStringThe description of the above errorCode
dataObjectDescribed below
Describe data Model
PropertyTypeDescription
accessTokenStringThe access token
expiresInLongExpiration time in milliseconds. The default value is 86400000 (24 hours)

Example of a Successful Request

{
"status": "SUCCESS",
"message": "Thành công",
"data": {
"accessToken": "eYa...",
"expiresIn": 86400000
}
}

3. Environments and credentials

MoMo will provide the Partner with the following credentials. For each environment, the credentials will be different.

  • Partner Id: Partner’s Id at MoMo side
  • Client Id and Client Secret: used for authentication

MoMo provides two environments to integrate with the MoMo API:

  1. UAT: used during the integration and testing process
  • Domain: https://uat-business.momo.vn/api
  1. Production: used to deploy to end-users
  • Domain: https://business.momo.vn/api

The PartnerId, ClientId, and ClientSecret will be sent in a private channel.