POST/api/v1/customers/{id}/accounts
ผูกบัญชีธนาคารลูกค้าเพื่อรับ customer_account_id
ENDPOINT OVERVIEW
การลงทะเบียนบัญชีลูกค้าล่วงหน้าจะคืนค่ารหัส customer_account_id (รูปแบบ UUIDv7) เพื่อนำไปใช้ทั้งขาฝาก POST /api/v2/payins และขาถอน POST /api/v1/payouts ช่วยจับคู่ผู้โอนให้ตรงตัวและสกัดยอดโอนจากบุคคลที่สาม
กฎสำคัญของโปรโตคอล
- รองรับเครือข่ายธนาคารไทยทั้ง 18 แห่ง และธนาคารฮ่องกงบนระบบ FPS ทั้ง 12 แห่ง
- นำค่า id ที่ได้ไปใส่ในฟิลด์ customer_account_id ตอนสร้างรายการฝากหรือถอน
ตัวอย่าง Request
curl -X POST https://api.example.com/api/v1/customers/0198cbc6-fd02-7459-a671-78c306d0a1ad/accounts \
-H "Content-Type: application/json" \
-H "X-API-Key: <your-api-key>" \
-H "X-Timestamp: <unix-timestamp>" \
-H "X-Signature: <hmac-sha256-of-path>" \
-d '{
"bank_code": "SCB",
"account_number": "4091234567",
"account_name": "SOMCHAI TEST"
}'ตัวอย่าง JSON Response
{
"id": "0198cbc7-35ec-7c8c-8994-d3ac3e7f5255",
"customer_id": "0198cbc6-fd02-7459-a671-78c306d0a1ad",
"bank_code": "SCB",
"status": "verified"
}