REFUND API
Specification Doc
Please read Onboarding first!!
| Version | Date | Author | Description |
|---|---|---|---|
| 1.0 | 10-03-2020 | Phong Le | Initial draft |
Flows

Methods
1. Refund
Allow a Merchant request to refund with Momo
- Method: POST
- URL: api/refund/do-refund
Example :
Request
{
"requestId": "149290648301898",
"password": "123456",
"time": "2017-05-04 10:10:10",
"reference": "16143921642",
"reference1": "16143921ABC",
"amount": 10000,
"transId": "1070375149",
"description": ""
}
Response
{
"requestId": "149290648301898",
"referenceId ": "asdada123213352",
"resultCode": 0,
"message": "Success",
"paymentRef": "1234567"
}
Request
| Method | URL |
|---|---|
| POST | api/refund/callRefund |
| Name | Type | Max Len | Require | Description |
|---|---|---|---|---|
| requestId | String | 50 | x | Unique String for each request |
| time | String | Request time with format:yyyy-MM-dd HH:mm:ss | ||
| password | String | x | MoMo will support (important information) | |
| reference | String | 50 | Reference (billId, accountId, …) need to refund, depend on paymnent request | |
| reference1 | String | 50 | Reference1 (extras for billId, accountId, …) need to refund, depend on paymnent request | |
| amount | Integer | x | Amount need to refund | |
| transId | String | 32 | x | Transaction Id of Momo in payment request |
| description | String | 300 | Short description of this bill/product |
Response
| Name | Type | Len | Description |
|---|---|---|---|
| requestId | String | 50 | The same value with your request |
| resultCode | Integer | Result Code of request | |
| message | String | 300 | Result message |
| referenceId | String | Unique for each response | |
| paymentRef | String | 32 | Transaction Id of Momo in refund request |
2. CheckStatus
Allow partner check the result of previous transaction
- Method: POST
- URL: api/refund/check-status
Example :
Request
{
"requestId": "wqrwpo2343240xsad213",
"checkRequestId": "149290648301898"
}
Response
{
"requestId": "wqrwpo2343240xsad213",
"referenceId": "2313_e3w24_ddqwdq_dasdasda",
"resultCode": 0,
"message": "Success",
"data": {
"requestId": "wqrwposs2343240xsad213",
"referenceId": "2313_e3w24_w432423_dasdasda",
"resultCode": 0,
"message": "Success",
"paymentRef": "1234567"
}
}
Request
| Method | URL |
|---|---|
| POST | api/refund/status |
| Name | Type | Len(byte) | Require | Description |
|---|---|---|---|---|
| requestId | String | 50 | x | Unique String for each request |
| checkRequestId | String | 50 | x | Partner's the old requestId need checking |
Response
| Name | Type | Level | Max Len | Description |
|---|---|---|---|---|
| requestId | String | L1 | 50 | Same with request |
| resultCode | Integer | L1 | Result Code of request | |
| referenceId | String | L1 | 50 | Unique for each response |
| message | String | L1 | 500 | Result message |
| data | JsonObject | L1 | 32000 | Data is the same with the response data of refund function before |
| requestId | String | L2 | ||
| referenceId | String | L2 | ||
| resultCode | Integer | L2 | ||
| message | String | L2 | ||
| paymentRef | String | L2 |
3. Get Trans
Allow partner get all transaction of the day
- Method: POST
- URL: api/refund/get-trans
Example :
Request
{
"requestId": "wqrwpo2343240xsad213",
"date": "2020-03-10",
"offset": 2,
"page":1
}
Response
{
"requestId": "wqrwpo2343240xsad213",
"referenceId": "13443_e3w24_ddqwdq_dasdasda",
"resultCode": 0,
"message": "Success",
"data": [
{
"requestId": "122345",
"referenceId": "12345673sfdsf",
"resultCode": 0,
"paymentRef": "123456789765",
"message": "Success"
},
{
"requestId": "12234567",
"referenceId": "12345673sfdsfdfd",
"resultCode": 0,
"paymentRef": "123456789765",
"message": "Success"
}
]
}
Request
| Method | URL |
|---|---|
| POST | api/refund/get-trans |
| Name | Type | Len(byte) | Require | Description |
|---|---|---|---|---|
| requestId | String | 50 | x | Unique String for each request |
| date | String | 10 | x | Date to get all trans (yyyy-MM-dd) |
| offset | Number | 10 | Max number of row will return | |
| page | Number | 5 | Default = 1 |
Response
| Name | Type | Level | Len | Description |
|---|---|---|---|---|
| requestId | String | L1 | 50 | Same with request |
| resultCode | Integer | L1 | Result Code of request | |
| referenceId | String | L1 | 50 | Unique for each response |
| message | String | L1 | 500 | Result message |
| data | JsonArray | L1 | 32000 | |
| requestId | String | L2 | ||
| referenceId | String | L2 | ||
| resultCode | Integer | L2 | ||
| message | String | L2 | ||
| paymentRef | String | L2 |
Glossary
Error Code
| Code | Message | Function | Status |
|---|---|---|---|
| 0 | Success | all | Success |
| 1 | Invalid signature | all | Fail |
| 2 | Cannot decrypt message | all | Fail |
| 3 | Invalid username | all | Fail |
| 5 | Invalid password | all | Fail |
| 6 | Invalid Json String | all | Fail |
| 7 | Insufficient funds | all | Fail |
| 8 | Duplicate request Id | all | Fail |
| 9 | Invalid partner code | all | Fail |
| 10 | Unknown result. Please check manual to get final result | all | Fail |
| 11 | Other Error | all | Fail |
| 13 | This function is not active. please contact the administrator | all | Fail |
| 15 | Mainternance system, please try later ! | all | Fail |
| 701 | Invalid request | all | Fail |
| 702 | The transaction ID doesn't exist in M_Service system | all | Fail |
| 703 | The Transaction is timeout | all | Fail |
| 704 | Over limited transaction per days | all | Fail |
| 705 | Amount is invalid | all | Fail |