Nhảy tới nội dung
Phiên bản: Lastest

API Nạp tiền điện thoại

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

Method: POST

Header: Cách tạo JWT_TOKEN

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

Tham số

Tham sốYêu cầuKiểu dữ liệuMô tả
partnerRefIdStringMã giao dịch phía đối tác, duy nhất cho mỗi giao dịch
telcoStringTên nhà mạng (xem thêm phần Phụ Lục bảng nhà mạng)
telcoServiceTypeStringLoại dịch vụ (xem thêm phần Phụ Lục bảng mã dịch vụ)
phoneNumberStringSố điện thoại nạp tiền (truyền dạng: 09x, 08x,..)
amountIntegerSố tiền nạp
signatureStringChữ ký các tham số truyền lên API, các tham số được đưa vào chữ ký theo thứ tự bao gồm: amount + partnerRefId + phoneNumber + telco + telcoServiceType (xem thêm phần cách tạo signature)

Dữ liệu trả về

Tham sốKiểu dữ liệuMô tả
errorCodeIntegerMã lỗi trả về
messageStringMô tả chi tiết mã lỗi
transactionObjectThông tin giao dịch
transaction.amountIntegerSố tiền giao dịch
transaction.topupAmountStringSố tiền nạp
transaction.phoneNumberStringSố điện thoại nạp
transaction.appotapayTransIdStringMã giao dịch phía AppotaPay
transaction.timeStringThời gian giao dịch
accountObjectThông tin tài khoản
account.balanceIntegerSố dư tài khoản sau giao dịch
signatureStringChữ ký thông tin giao dịch trả về, các trường được ký bao gồm (amount + appotapayTransId + errorCode + phoneNumber + time + topupAmount)

Ví dụ

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"
}
}