iFrame Integration
Embed the widget with a single <iframe> tag — works on any website.
Before you start: create an agent and copy its Agent ID → Create your agent.
Step 1 — Get an access token
From your backend, request an access token from the OAuth endpoint using your client_id,
client_secret, and subscription key (both from the portal's Subscriptions section). The token
is valid for 24 hours — cache and reuse it.
Step 2 — Start a widget session
Call the Generate Widget Session endpoint — open that page to see the full schema and try it live. Send your subscription key and bearer access token, with this body:
| Field | Required | Description |
|---|---|---|
AgentWorkflowId | yes | Your Agent ID (from the portal). |
accountHolder | yes | The applicant's name. |
vatNumber | no | The applicant's VAT / tax number. |
You get back a ready-to-embed iFrame URL (and a token, which you only need for the
SDK):
{
"iFrameUrl": "https://apply.prestatech.com/embed/YOUR_AGENT_ID?accessToken=eyJ...&accountHolder=John%20Doe&vatNumber=2128506",
"token": "eyJ..."
}
The applicant is already identified in this URL, so they skip the passcode step.
Custom domain. By default the widget is served from
apply.prestatech.com. If you set up a custom domain in the portal, youriFrameUrlis returned on that domain — embed it as received.
Step 3 — Embed the iFrame
<iframe
src="PASTE_THE_iFrameUrl_HERE"
title="Prestatech Widget"
style="width: 100%; height: 720px; border: 0;"
allow="camera; clipboard-write">
</iframe>
Step 4 — Listen for the result
The widget tells your page when the applicant finishes (or if something goes wrong) with a
window message:
window.addEventListener('message', (event) => {
const data = event.data
if (!data || data.type !== 'PRESTATECH_WORKFLOW_STATUS') return
if (data.event === 'done') {
console.log('Finished', data.metadata) // { workflowId, agentId, accountHolder, vatNumber }
} else if (data.event === 'error') {
console.log('Could not start')
}
})
Message payload:
{
"type": "PRESTATECH_WORKFLOW_STATUS",
"event": "done",
"value": "FINISHED",
"metadata": {
"workflowId": "YOUR_AGENT_ID",
"agentId": "YOUR_AGENT_ID",
"accountHolder": "John Doe",
"vatNumber": "2128506"
}
}
event is done or error; value is FINISHED or ERROR.
Optional — ask the applicant to verify themselves
To skip Step 2 and have the applicant identify themselves, embed the widget with only the Agent
ID and no accessToken:
<iframe src="https://apply.prestatech.com/embed/YOUR_AGENT_ID" title="Prestatech Widget"></iframe>
The widget then asks for a one-time passcode before the flow begins. Everything else works the same.