Create VA
POST /openapi/v1/va/va-account/create
Tạo tài khoản ảo (Virtual Account) cho Merchant để nhận thanh toán chuyển khoản.
Payload trước khi mã hóa:
{
"bank_code": "970454",
"account_name": "NGUYEN VAN A"
}
| Trường | Bắt buộc | Mô tả |
|---|---|---|
bank_code | ✅ | Mã ngân hàng phát hành VA |
account_name | ✅ | Tên hiển thị trên tài khoản ảo |
- cURL
- Python
- Go
- JavaScript
curl --location '<base_url>/openapi/v1/va/va-account/create' \
--header 'Partner-Code: YOUR_PARTNER_CODE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1…' \
--data '{
"data": ENCRYPTED_PAYLOAD
}'
import requests
url = "<base_url>/openapi/v1/va/va-account/create"
payload = {"data": "ENCRYPTED_PAYLOAD"}
headers = {
"Partner-Code": "YOUR_PARTNER_CODE",
"Content-Type": "application/json",
"Authorization": "Bearer eyJhbGciOiJSUzI1…",
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "<base_url>/openapi/v1/va/va-account/create"
body := strings.NewReader(`{"data":"ENCRYPTED_PAYLOAD"}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Set("Partner-Code", "YOUR_PARTNER_CODE")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer eyJhbGciOiJSUzI1…")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
result, _ := io.ReadAll(resp.Body)
fmt.Println(string(result))
}
const response = await fetch("<base_url>/openapi/v1/va/va-account/create", {
method: "POST",
headers: {
"Partner-Code": "YOUR_PARTNER_CODE",
"Content-Type": "application/json",
"Authorization": "Bearer eyJhbGciOiJSUzI1…",
},
body: JSON.stringify({ data: "ENCRYPTED_PAYLOAD" }),
});
const result = await response.text();
console.log(result);
Request
Headers
| Name | Required | Description |
|---|---|---|
Partner-Code | ✅ | Mã định danh Merchant (TCONNECT cung cấp) |
Content-Type | ✅ | application/json |
Authorization | ✅ | Bearer <access_token> từ Login |
Body
| Field | Type | Required | Description |
|---|---|---|---|
data | string | ✅ | Payload đã mã hóa AES-256-CBC dạng Hexadecimal |
Response
200 — Tạo VA thành công
| Field | Type | Description |
|---|---|---|
va_number | string | Số tài khoản ảo được tạo (vd: VA100023312) |
bank_code | string | Mã ngân hàng phát hành |
account_name | string | Tên tài khoản ảo |
status | string | Trạng thái VA (active) |