Request
Method
Content Type
URL
POST
Application/JSON
Partner provides api url
Params
Param Name (Case-sensitive)
Type
Required
Description
type
string
required
new | recovery
new: new message from Customer
recovery: V-COM resend on request of Merchant
client_id
string
required
client id, help to define client in partner system. Provided by V-COM
request_id
string
required
Transaction ID, this will be used to send MT API later
service_id
string
required
service number, eg 7068
command_code
string
required
Command code, eg: cskh, topup...
message
string
required
MO Message which user texted
telco
string
required
telco ID
MB: Mobifone
VT: Viettel
VN: Vinaphone
HT: Ha Noi Telecom (Vietnam Mobile)
phone
string
required
User's phone number, 84xxxxxxxxx format
time
integer
required
current timestamp
checksum
string
required
Check sum of transaction
$checksum = base64_encode(hash('sha256', $client_id . $request_id . $phone . $secure_key . $time, true));
$secure_key: provided by V-COM
Note: We use
sha256 with
binary mode, the parameter with "true" indicates this
Response
Partner returns JSON data as below, all response must return HTTP code 200
Status
Code
Response
success
200
{"data": { "code": 200, "status": "success", "message":""}}
error
104
{"errors": {"code": 104, "status": "error", "message": "Request ID existed"}}
error
106
{"errors": {"code": 106, "status": "error", "message": "Parameter is invalid, wrong checksum, "}}
error
108
{"errors": {"code": 108, "status": "error", "message": "Request from IP is not allowed"}}
* Notes: IMPORTANT
- If we receive HTTP response code different to 200, we will retry 2 more times, each time will be 20 seconds period
- Reference API:
- Send MT API Document
Example
Sample secure key: 5fdc57e97198o1
curl --location --request POST 'https://partner-api-url/api/receive-mo' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "new",
"client_id": "demo",
"request_id": "1297875832",
"service_id": "7068",
"command_code": "vuihe",
"message": "vuive ABCDEF",
"telco": "MB",
"phone": "84903528513",
"time": 1692947450,
"checksum": "CtuflD4n50ostT+U8gWc8v4fHby1lEIuoximvRz/SJA="
}'