Get Balance
API นี้ช่วยให้ผู้ใช้สามารถตรวจสอบยอดเงินคงเหลือในบัญชีได้
รายละเอียด Endpoint
GET
/api/v1/client/get_balance
Headers
Name
Value
Authorization
Bearer YOUR_SECRET_TOKEN
x-api-key
YOUR_API_KEY
x-signature
YOUR_BASE64_ENCODED_SIGNATURE
ในกรณีนี้ x-signature ให้กำหนดค่า {OREDER_ID} และ {AMOUNT} ให้เป็น "null string" หรือ "empty string"
ตัวอย่างการเรียกใช้งาน (Request Example)
curl -X GET https://baseUrl/api/v1/client/get_balance \
-H "Authorization: Bearer YOUR_SECRET_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-signature: YOUR_BASE64_ENCODED_SIGNATURE" \
-H "Content-Type: application/json" \
การตอบกลับจาก API (Response Example)
{
"current_deposit_balance": 0,
"current_withdraw_balance": 0
}
Sample Code
const axios = require('axios')
try {
const { data } = await axios.get(
`${baseUrl}/api/v1/client/get_balance`,
{
headers: { // headers ที่ใช้ในการส่งคำขอ HTTP
Authorization: 'Bearer YOUR_ACCESS_TOKEN', // การให้สิทธิ์ด้วย Bearer token
'x-api-key': 'YOUR_API_KEY', // กุญแจ API
'x-signature': 'YOUR_BASE64_ENCODED_SIGNATURE', // ลายเซ็นที่เข้ารหัส
},
},
)
}
Last updated