Skip to main content
Version: Lastest

API Mobile Topup

Endpoint: /api/v1/service/topup/charging

Method: POST

Header: How to generate JWT_TOKEN

{
"X-APPOTAPAY-AUTH": Bearer JWT_TOKEN,
"Content-Type": "application/json"
}

Params

ParamsRequiredTypeDescription
partnerRefIdStringThis is unique code corresponding to a request send
telcoStringVendor name (see more Table of content list vendor)
telcoServiceTypeStringService type (see more Table of content List service code)
phoneNumberStringPhone number charge topup (format: 09x, 08x,..)
amountIntegerCharge money
signatureStringSignature of parameter passed to the API, the parameter is included into signature like this: amount + partnerRefId + phoneNumber + telco + telcoServiceType (see more at how to generate signature)

Data result

ParamsTypeDescription
errorCodeIntegerError code result
messageStringDescription error code detail
transactionObjectTransaction object
transaction.amountIntegerAmount transaction
transaction.topupAmountStringAmount topup
transaction.phoneNumberStringPhone number to charge topup
transaction.appotapayTransIdStringTransaction id from AppotaPay
transaction.timeStringTransaction time
accountObjectAccount information
account.balanceIntegerSBalance account after topup
signatureStringSignature of parameter passed to the API, the parameter is included into signature like this:(amount + appotapayTransId + errorCode + phoneNumber + time + topupAmount)

Example

Request

{
"partnerRefId": "AB123",
"telco": "viettel",
"telcoServiceType": "prepaid",
"phoneNumber": "0986868686",
"amount": 100000,
"signature": "b10294bae53e89919b3efd62a763bf3..."
}

Response

{
"errorCode": 0,
"message": "Thành công",
"transaction": {
"amount": 100000,
"topupAmount": 100000,
"appotapayTransId": "AP12adf21121",
"phonenumber": "0986868686",
"time": "10-04-2020 10:10:10",
},
"account": {
"balance": "121000000"
}
}