Skip to main content
Version: Lastest

API Card Charging

API Card Charging

Chat with AI▼

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

Method: POST

Header: How to generate JWT_TOKEN

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

Params​

ParamsRequiredTypeDescription
code√StringCard code is encrypted
serial√StringCard Serial
vendor√StringDefault is: appota
partner_code√StringPartner code is provided by AppotaPay
service_name√StringPartner service name
transaction_id√StringUnique ID per transaction (5 - 50 char)
signature√StringHash params: signature= SHA256(code + serial + vendor + partner_code + service_name + transaction_id + secret_key)

Secret key is provided by AppotaPay

Data result​

ParamsTypeDescription
error_codeStringError Code
messageStringError Message
dataObjectResponse data
data.amountIntegerCard value
data.serialStringCard serial
data.transaction_idStringAppotaPay Transaction ID
data.timeStringTransaction Time

Example​

Response​

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

Code Examples​

curl --location 'https://gateway.dev.appotapay.com/v1/services/card_charging?api_key=YOUR_API_KEY' \
--header 'X-APPOTAPAY-AUTH: JWT_TOKEN' \
--header '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)