3️⃣API Get Token
Used to generate and retrieve a token. Used to obtain a bearer token for accessing the API to generate VietQR payment codes.
POST
POST
https://dev.vietqr.org/vqr/api/token_generate
Headers
Name
Value
Content-Type
application/json
Authorization
Basic Authentication: Base64[username:password
]
Body
Name
Type
Description
access_token
String
It is the Bearer Token provided by VietQR after completing Step 4.
Used to access and generate VietQR payment codes.
token_type
String
It is a “Bearer” type token.
expires_in
String
The token expiration time is set to 300 seconds by default.
Response
{
"access_token": "bearer_token_của_đối_tác",
"token_type": "Bearer",
"expires_in": 300
}
Reference code
curl --location --request POST 'https://dev.vietqr.org/vqr/api/token_generate' \
--header 'Authorization: Basic Y3VzdG9tZXItdmlldHFydGVzdC11c2VyMjQ2ODpZM1Z6ZEc5dFpYSXRkbWxsZEhGeWRHVnpkQzExYzJWeU1qUTJPQT09'
Response:
{
"access_token": "eyJhbGciOiJIUzUxMiJ9.eyJhdXRob3JpdGllcyI6WyJST0xFX1VTRVIiXSwidXNlciI6IlkzVnpkRzl0WlhJdGRtbGxkSEZ5ZEdWemRDMTFjMlZ5TWpRMk9BPT0iLCJpYXQiOjE3MjEzNzI2MzQsImV4cCI6MTcyMTM3MjkzNH0.D19qvrpYHUgcGjDCXuXXAv3j6lZr6tfmIB0VzdCzAXMJAElGok04sNLysS6PRLdRb0hSgEX5_9KpLjB-xErn-A",
"token_type": "Bearer",
"expires_in": 300
}
Frequently Asked Questions (FAQs)
Last updated