Cancel Deposit
API Cancel Deposit นี้อนุญาตให้ผู้ใช้ยกเลิกรายการฝากเงินที่สร้างขึ้นก่อนหน้านี้ โดยสามารถใช้งานได้เมื่อธุรกรรมเกิดขึ้นโดยไม่ตั้งใจหรือจำเป็นต้องยกเลิกธุรกรรมด้วยเหตุผลใดๆ
รายละเอียด Endpoint
POST
/api/v1/client/cancel_deposit
Headers
Name
Value
Authorization
Bearer YOUR_SECRET_TOKEN
x-api-key
YOUR_API_KEY
x-signature
YOUR_BASE64_ENCODED_SIGNATURE
Body
{
"ref_id": "string"
}
Fields
Type
Required
Description
ref_id
string
Required
หมายเลข Ref id ของรายการในระบบ Payment ที่ต้องการยกเลิก
ตัวอย่างการเรียกใช้งาน (Request Example)
curl -X POST https://baseUrl/api/v1/client/cancel_deposit \
-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" \
-d '{
"ref_id": "ref-123456789",
}'
การตอบกลับจาก API (Response Example)
{
"ref_id": "string",
"is_cancel_success": true
}
Sample Code
const axios = require('axios')
try {
const { data } = await axios.post(
`${baseUrl}/api/v1/client/cancel_deposit`,
{
ref_id: 'ref-123456789', // ตัวแปร ref_id ที่จะส่งไปใน request
},
{
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