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

API gạch thẻ

Endpoint: /v1/services/card_charging?api_key=YOUR_API_KEY

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ả
codeStringMã thẻ ở dạng mã hoá
serialStringSeri thẻ (12 ký tự)
vendorStringđể mặc định là: appota
partner_codeStringMã Partner code nhận được từ phía AppotaPay cung cấp
service_nameStringMã dịch vụ mà phía đối tác đã đăng ký
transaction_idStringMã giao dịch phía đối tác sinh ra, duy nhất cho mỗi giao dịch (từ 5 - 50 kí tự)
signatureStringThông tin hash các params gửi sang API (signature= SHA256(code + serial + vendor + partner_code + service_name + transaction_id + secret_key))

Secret key phía AppotaPay cung cấp

Dữ liệu trả về

Tham sốKiểu dữ liệuMô tả
error_codeStringMã lỗi
messageStringMô tả chi tiết mã lỗi
dataObjectMô tả chi tiết giao dịch khi thành công
data.amountIntegerMệnh giá thẻ
data.serialStringSeri thẻ
data.transaction_idStringMã giao dịch phía AppotaPay
data.timeStringThời gian giao dịch

Ví dụ

Response

{
"error_code": "00",
"message": "Transaction success",
"data": {
"amount": 100000,
"serial": "OTA123456789",
"transaction_id": "abc123",
"time": "10:05:01 08/05/2019 GMT+7"
}
}

Ví dụ Code

curl -X POST "https://gateway.dev.appotapay.com/v1/services/card_charging?api_key=YOUR_API_KEY" \
-H "X-APPOTAPAY-AUTH: JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "encrypted_card_code",
"serial": "OTA123456789",
"vendor": "appota",
"partner_code": "PARTNER_CODE",
"service_name": "TEST",
"transaction_id": "unique_transaction_id_12345",
"signature": "calculated_signature_hash"
}'

Request

REQUEST

Development server
Example (from schema)