API Mobile Topup
Endpoint: /api/v2/service/topup/charging
Method: POST
Header: How to generate JWT_TOKEN
{
"X-APPOTAPAY-AUTH": Bearer JWT_TOKEN,
"Content-Type": "application/json"
}
Params
Params | Required | Type | Description |
---|---|---|---|
partnerRefId | √ | String | This is unique code corresponding to a request send |
telco | √ | String | Vendor name (see more Table of content list vendor) |
telcoServiceType | √ | String | Service type (see more Table of content List service code) |
productCode | √ | String | Product code (see more API to get list product code) |
phoneNumber | √ | String | Phone number charge topup (format: 09x, 08x,..) |
signature | √ | String | Signature of parameter passed to the API, the parameter is included into signature like this: partnerRefId + phoneNumber + productCode + telco + telcoServiceType (see more how to generate signature) |
Data result
Params | Type | Description |
---|---|---|
errorCode | Integer | Error code result |
message | String | Description error code detail |
transaction | Object | Transaction object |
transaction.phoneNumber | String | Phone number to charge topup |
transaction.amount | Integer | Amount transaction |
transaction.productCode | String | Product code |
transaction.topupAmount | Integer | Amount topup |
transaction.appotapayTransId | String | Transaction id from AppotaPay |
transaction.time | String | Transaction time (in RFC-3339 standard format) |
account | Object | Account information |
account.balance | Integer | Balance account after topup |
signature | String | Signature of parameter passed to the API, the parameter is included into signature like this:(amount + appotapayTransId + errorCode + phoneNumber + productCode + time + topupAmount) (see more how to generate signature) |
Example
Request
{
"partnerRefId": "AB123",
"telco": "viettel",
"telcoServiceType": "prepaid",
"phoneNumber": "0866123456",
"productCode": "viettel_10",
"signature": "5a2774918a29cf4d2bdb78cccceb956f4c27837fad09a03a56e1df68b1bf29dd"
}
Response
{
"errorCode": 0,
"message": "Thành công",
"transaction": {
"phoneNumber": "0866123456",
"amount": 10000,
"productCode": "viettel_10",
"topupAmount": 10000,
"appotapayTransId": "01J7G2DYZTPCGHM3AAF8ANZC7J",
"time": "2024-09-13T17:48:06+07:00"
},
"account": {
"balance": "121000000"
},
"signature": "e5f61a7eca55ca1c5a1b6305acfa0e52f6d3d562de1b9780faf5f247ed10ab8d"
}