Skip to main content
Version: 1.0

API Mobile Topup

API Mobile Topup

Chat with AI▼

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

Method: POST

Header: How to generate JWT_TOKEN

Language: en | vi

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

Params​

ParamsRequiredTypeDescription
partnerRefId√StringThis is unique code corresponding to a request send
telco√StringVendor name (see more Table of content list vendor)
telcoServiceType√StringService type (see more Table of content List service code)
phoneNumber√StringPhone number charge topup (format: 09x, 08x,..)
amount√IntegerCharge money
signature√StringSignature of parameter passed to the API, the parameter is included into signature like this: amount + partnerRefId + phoneNumber + telco + telcoServiceType (see more how to generate signature)

Data result​

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

Example​

Request​

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

Response​

Success

{
"errorCode": 0,
"message": "Success",
"transaction": {
"phoneNumber": "0986868686",
"amount": 10000,
"topupAmount": 10000,
"appotapayTransId": "01J7G2PKFDPTWJN6P9K3DDP1J5",
"time": "11-09-2024 15:20:20"
},
"account": {
"balance": "121000000"
},
"signature": "5a2774918a29cf4d2bdb78cccceb956f4c27837fad09a03a56e1df68b1bf29dd"
}

Error

{
"errorCode": 40,
"message": "The system is under maintenance, please try again later"
}