Payment API (VietQR)#
API tạo mã QR thanh toán qua VietQR.
Base URL: https://app.socialking.vn/api/v1
1. Tạo QR Code thanh toán#
GET /pay/vietqr/qrcode/create
#
Auth: Bearer Token (JWT)
Query Parameters:
| Param | Type | Default | Mô tả |
|---|---|---|---|
amount | number | 500000 | Số tiền (VND) |
template | string | compact | compact | print |
Response (200):
{
"success": true,
"message": "QR code created",
"data": {
"qrCode": "https://img.vietqr.io/image/...",
"qrDataURL": "data:image/png;base64,...",
"amount": 500000,
"walletCode": "SK123456",
"bankInfo": {
"bank": "MB Bank",
"accountName": "SOCIALKING JSC",
"accountNumber": "0123456789"
},
"expiresIn": 1800
}
}Lưu ý: QR code có hiệu lực trong 30 phút (1800 giây). Nội dung chuyển khoản phải chứa
walletCodeđể hệ thống tự động xác nhận.