Create QR
POST /openapi/v1/qr
Create a payment QR code for an order.
Call Get Services first to obtain the service_code (used as the x-service-code header) and bincode.
Payload before encryption:
{
"order_id": "TCTK010520260001",
"va": "VA100023312",
"bincode": "970454",
"amount": 10000
}
| Field | Required | Description |
|---|---|---|
order_id | ✅ | Order ID — max 16 alphanumeric characters (A–Z, 0–9), no special characters. E.g. TCTK010520260001 |
va | ✅ | Virtual account number |
bincode | ✅ | Bank code |
amount | ❌ | 0 or empty = static QR; > 0 = dynamic QR |
- cURL
- Python
- Go
- JavaScript
curl --location '<base_url>/openapi/v1/qr' \
--header 'partner-code: YOUR_PARTNER_CODE' \
--header 'x-service-code: vccb-qr' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI…' \
--header 'Content-Type: application/json' \
--data '{
"data": ENCRYPTED_PAYLOAD
}'
import requests
url = "<base_url>/openapi/v1/qr"
payload = {"data": "ENCRYPTED_PAYLOAD"}
headers = {
"partner-code": "YOUR_PARTNER_CODE",
"x-service-code": "vccb-qr",
"Authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI…",
"Content-Type": "application/json",
}
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/qr"
body := strings.NewReader(`{"data":"ENCRYPTED_PAYLOAD"}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Set("partner-code", "YOUR_PARTNER_CODE")
req.Header.Set("x-service-code", "vccb-qr")
req.Header.Set("Authorization", "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI…")
req.Header.Set("Content-Type", "application/json")
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/qr", {
method: "POST",
headers: {
"partner-code": "YOUR_PARTNER_CODE",
"x-service-code": "vccb-qr",
"Authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI…",
"Content-Type": "application/json",
},
body: JSON.stringify({ data: "ENCRYPTED_PAYLOAD" }),
});
const result = await response.text();
console.log(result);
Request
Headers
| Name | Required | Description |
|---|---|---|
partner-code | ✅ | Merchant identifier code (provided by TCONNECT) |
Content-Type | ✅ | application/json |
Authorization | ✅ | Bearer <access_token> |
x-service-code | ✅ | Service code from the Get Services API (e.g. vccb-qr) |
Body
| Field | Type | Required | Description |
|---|---|---|---|
data | string | ✅ | AES-256-CBC encrypted payload as Hexadecimal |
Response
200 — QR created successfully
| Field | Type | Description |
|---|---|---|
image_png_base64 | string | Base64 string of the QR PNG image. Use directly in <img src="data:image/png;base64,..."> |
qr_content | string | Raw content string of the QR code — use to render manually if needed |