#嵌入頁面

#目錄


#URL 結構

{RESULT_WEBSITE_BASE_URL}/render/:template?gameType=&variant=&lang=&ccy=&tz=&data=

#路徑參數

參數描述範例
template範本類型resultroundticket

#查詢參數

參數 必填 預設 說明
data ✅ 是的 Base64 編碼的 JSON 有效負載(請參閱資料格式
gameType 沒有 bcr 遊戲識別碼。當有效負載是固定介面時,data.gameType 自動偵測(值必須是已知的固定程式碼)。傳遞小遊戲 API 資料時需要。如果將來迷你遊戲資料獲得 gameType 欄位,它仍然會被標準化為已確定的模式。值:bcr(百家樂)、rob(紅或黑)、sicbohhh(嘿嘿怎麼樣)、rlt(輪盤)
variant 沒有 default 模板內的子模板變體
lang 沒有 en 語言代碼:envizhko
ccy 沒有 貨幣代碼,例如USDTHB。回退到資料值
tz 沒有 Asia/Bangkok IANA 時區字串,例如Asia/Ho_Chi_Minh

#可用路線

gameType 模板 變體 URL
bcr result default /render/result?gameType=bcr
bcr round default /render/round?gameType=bcr
bcr ticket default /render/ticket?gameType=bcr

#嵌入 iframe

<iframe
	src="https://<your-domain>/render/result?gameType=bcr&lang=en&data=<base64>"
	style="border: none; background: transparent;"
	allowtransparency="true"
	width="400"
	height="300"
></iframe>

透明背景:在 iframe 上設定allowtransparency="true",在style 屬性中設定background: transparent。當沒有data-theme強制顏色時,渲染的頁面預設使用background: transparent,因此不需要在主頁上進行額外的配置。

#動態 URL 建構器 (JavaScript)

function buildRenderUrl(
	baseUrl,
	{ gameType = 'bcr', template, variant, data, lang = 'en', ccy, tz }
) {
	const encoded = btoa(JSON.stringify(data));
	const params = new URLSearchParams({ gameType, data: encoded, lang });
	if (variant) params.set('variant', variant);
	if (ccy) params.set('ccy', ccy);
	if (tz) params.set('tz', tz);
	return `${baseUrl}/render/${template}?${params}`;
}

#資料格式

data 查詢參數必須是 Base64 編碼的 JSON 字串

const encoded = btoa(JSON.stringify(payload));

接受兩種有效負載形狀:


#百家樂/結果/默認

Embed Result

{
	"result": "1,5,13-2,6" // BCR result format
}

BCR結果編碼和牌號編號請參閱百家樂結果格式

範例

const data = { result: '1,5,13-2,6' };
const url = buildRenderUrl(base, {
	gameType: 'bcr',
	template: 'result',
	data,
	lang: 'en'
});

#百家樂/回合/默認

Embed Round

入駐API(建議)

此有效負載形狀與單錢包APIs中的settled-round請求Body以及回合結果通知中的回合結束有效負載相符。您可以將這些有效負載直接傳遞到圓形渲染器。

{
	"roundId": "BCR_MD2729-260511-0162",
	"tableId": "BCR_MD2729",
	"result": "1,5,13-2,6",
	"openAt": 1778473519401, // epoch ms
	"closeAt": 1778473549401, // epoch ms
	"status": "ENDED",
	"gameType": "BCR" // auto-detects game — no gameType query param needed
}

小遊戲API — 設定?gameType=bcr查詢參數(或預設為bcr

{
	"id": "BCR_MD2729-260511-0162", // → roundId
	"scheduler": "BCR_MD2729", // → tableId
	"result": "1,5,13-2,6",
	"openAt": "2026-05-11T10:00:00+07:00", // ISO string, normalized to epoch ms
	"closeAt": "2026-05-11T10:02:00+07:00",
	"status": "ENDED"
}

status 使用回合/問題狀態


#百家樂/樂透/默認

Embed Ticket

已入駐API(建議)

此負載形狀與單一錢包APIs中的settled-ticket請求Body和已結算贏取注單通知/輸單已結算通知中的TicketInfoEvent負載相符。您可以將這些有效負載直接傳遞給注單渲染器。

{
	"ticketId": "2c5decb7-f66b-4b7b-ac55-673a34009ae1",
	"userId": "69d8b601bf3db08ac14df74f",
	"username": "player01",
	"userType": "AGENT",
	"tableId": "BCR_MD2707",
	"roundId": "BCR_MD2707-260511-0859",
	"ccy": "THB",
	"status": "WON",
	"betTime": 1778488082003, // epoch ms
	"betItems": "[{\"betLocation\":\"PLAYER\",\"betAmt\":100.0,\"wonAmt\":95.0}]", // JSON-encoded string
	"totalBet": 100.0,
	"totalPayout": 195.0,
	"result": "1,5,13-2,6",
	"gameType": "BCR" // auto-detects game — no gameType query param needed
}

小遊戲API — 設定?gameType=bcr查詢參數(或預設為bcr

此負載形狀與小遊戲服務APIs傳回的注單資料相符。渲染器在顯示注單之前對這些欄位進行標準化。

{
	"id": "8620ce49-cb80-4973-9158-5f281b976ebb", // → ticketId
	"accountId": "68b7c310f4e77cd715f1e33a", // → userId
	"username": "player01",
	"accountType": "AGENT", // → userType
	"scheduler": "BCR_3D_1", // → tableId
	"issueId": "BCR_3D_1-260508-1632", // → roundId
	"ccy": "THB",
	"status": "WON",
	"timeBet": "2026-05-08T18:08:28.411+07:00", // → betTime (ISO string, normalized to epoch ms)
	"betItems": [{ "betLocation": "PLAYER", "betAmt": 100.0, "wonAmt": 95.0 }], // array, normalized to JSON string
	"totalBetAmt": 100.0, // → totalBet
	"totalPayoutAmt": 195.0, // → totalPayout
	"result": "1,5,13-2,6"
}

status 使用投注/注單狀態。有關BCR 投注項目值,請參閱投注類型。 BCR結果編碼請參閱百家樂結果格式


#完整範例

<!DOCTYPE html>
<html>
	<body style="margin:0; background:#1a1a1a;">
		<script>
			const data = {
				ticketId: 'TKT-00001',
				roundId: 'ISS-0001',
				username: 'player01',
				userType: 'NORMAL',
				tableId: 'BACCARAT_A',
				ccy: 'THB',
				status: 'WON',
				betTime: 1778488082003,
				createdAt: '2026-05-11T10:01:01Z',
				totalBet: 100,
				totalPayout: 195,
				result: '1,5,13-2,6',
				gameType: 'BCR', // auto-detects game — no gameType in params needed
				betItems: '[{"betLocation":"PLAYER","betAmt":100,"wonAmt":95}]'
			};

			const params = new URLSearchParams({
				data: btoa(JSON.stringify(data)),
				lang: 'en',
				tz: 'Asia/Bangkok'
			});

			const iframe = document.createElement('iframe');
			iframe.src = `https://<your-domain>/render/ticket?${params}`;
			iframe.style = 'border:none; background:transparent; width:400px; height:600px;';
			iframe.setAttribute('allowtransparency', 'true');
			document.body.appendChild(iframe);
		</script>
	</body>
</html>