3️⃣Gọi API Get Token
Sử dụng thông tin kết nối do VietQR cung cấp để lấy token phục vụ cho việc truy cập API của VietQR
POST- Môi trường Dev (Test/Kiểm thử)
POST- Môi trường Dev (Test/Kiểm thử)https://dev.vietqr.org/vqr/api/token_generatePOST- Môi trường Production (Golive/Vận hành)
POST- Môi trường Production (Golive/Vận hành)https://api.vietqr.org/vqr/api/token_generateHeaders
Name
Value
Content-Type
application/json
Authorization
Basic Authentication: Base64[username:password]
Body
Name
Type
Description
access_token
String
Là Bearer Token do VietQR cung cấp dùng để truy cập các API của VietQR
token_type
String
Là dạng token dạng “Bearer”.
expires_in
Integer
Thời gian hết hạn của token. Mặc định là 300 giây.
Response
{
"access_token": "bearer_token_của_VietQR_cung_cấp",
"token_type": "Bearer",
"expires_in": 300
}{
"status": "FAILED",
"message": "mã_lỗi"
}Note:
Đối với môi trường Sandbox Username và Password do VietQR cung cấp khi đăng ký tích hợp và kết nối thành công (hình ảnh minh họa)


Code tham khảo
Các câu hỏi thường gặp
Last updated