Skip to navigation

Collect verification documents

Let an account holder upload the documents its verification asks for, in a secure frame on your page.

When an issuer asks for documents, GET /accountHolders/{accountHolderId}/verification lists them in requirements. The verification documents component shows each requirement in a frame on your page, takes the files and submits them. The files go from the user’s browser to the API and never pass through your servers.

1

Register your origin

In the app, open Settings, then Embedded components, and add the origin of each page that shows the component.

  • An origin is a scheme and host, plus a port only when it is not the default, such as https://app.example.com. No path or trailing slash.
  • Production accepts only https. Outside production, http://localhost and http://127.0.0.1 are also accepted, on any port.
  • Register up to 10 origins. Removing one stops the component on that site.
2

Create a session

From your backend, create a session for the account holder and the origin of the page that will show it. The key needs embeddedSessions:write and accountHolders:verify. A platform key sends Account-Holder with the account holder ID; a company key does not.

curl -X POST "https://$API_HOST/api/v2/embeddedSessions" \
-H "Authorization: Bearer $TOKEN" \
-H "Account-Holder: $ACCOUNT_HOLDER_ID" \
-H "Idempotency-Key: 3d9f1b6a-7c2e-4a8d-b5f0-9e1c4a7b2d63" \
-H "Content-Type: application/json" \
-d '{"target": {"component": "VERIFICATION_DOCUMENTS"}, "origin": "https://app.example.com"}'
{
"id": "0b6f3c1e-5d2a-4c8e-9a71-3f4d2e1b6c90",
"object": "embeddedSession",
"accountHolderId": "7c2e9a40-1b3d-4f5e-8a6b-9c0d1e2f3a4b",
"livemode": false,
"target": { "component": "VERIFICATION_DOCUMENTS" },
"origin": "https://app.example.com",
"status": "PENDING",
"expiresAt": "2026-10-12T14:40:00.000Z",
"createdAt": "2026-10-12T14:30:00.000Z",
"updatedAt": "2026-10-12T14:30:00.000Z",
"clientToken": "0b6f3c1e-5d2a-4c8e-9a71-3f4d2e1b6c90.example-not-a-real-client-token-value-0000"
}

Send only clientToken to your page. Treat it as a secret:

  • It can be redeemed once, within 10 minutes. The component then runs for at most 30 minutes.
  • Create a new session each time you show the component. A session that ended cannot be resumed.
  • Do not store it, log it or put it in a URL.
  • Revoking the key that created the session, or changing its permissions, stops the token from being redeemed.

The session covers every document requirement of the account holder. To narrow it, add target.requirementId for one requirement, or target.userId for the requirements of one person, such as a beneficial owner.

3

Load the loader

Load the loader with the @outpave/outpave-js npm package or a script tag. Replace APP_HOST with the domain of the web app assigned to your integration. Both load it over HTTPS from this address rather than a copy, so your page receives fixes.

// npm install @outpave/outpave-js
import { loadEmbedded } from "@outpave/outpave-js";
const embedded = await loadEmbedded({
loaderUrl: "https://APP_HOST/embedded/v1/loader.js",
});

The package adds TypeScript types. loadEmbedded resolves null where there is no window, such as during server rendering, so call it in the browser.

4

Mount the component

Mount the component in an element on your page, such as <div id="verification-documents"></div>. With getClientToken, the component can offer Start again after its session ends, and calls getClientToken for a new session.

const instance = embedded.mount({
container: "#verification-documents",
getClientToken: async () => {
// Your backend endpoint, which creates a session and returns its clientToken.
const response = await fetch("/verification/sessions", { method: "POST" });
const { clientToken } = await response.json();
return clientToken;
},
onComplete: ({ embeddedSessionId }) => {
// Every requirement in the session is submitted. Read the verification from your backend.
},
onExpire: ({ embeddedSessionId }) => {
// The session ended. The component offers Start again.
},
onError: ({ code }) => {
// See Errors below.
},
});

The frame fills the width of container and sets its own height to fit its content. Call instance.unmount() to remove it.

What the user does

The component lists each requirement as Business documents or under the person’s name, with the document types it accepts.

  • Files are PDF, JPEG or PNG, up to 10 MB each.
  • A requirement takes up to its maximumDocuments files. A rejected document does not count.
  • The user selects Submit for review on each requirement once its files are uploaded. The requirement’s status becomes SUBMITTED.

Submitting documents never approves a verification. The issuer’s review decides it.

Options

OptionTypeDescription
containerHTMLElement or stringRequired. The element the frame is added to, or a CSS selector that matches one.
getClientToken() => string or () => Promise<string>Returns a new session’s clientToken. Called on mount and each time the component starts again. Pass this or clientToken.
clientTokenstringA session’s clientToken, for a single mount without Start again.
titlestringThe frame’s accessible title. Default: Secure form.
localestringThe language, such as en-US or es-ES. English and Spanish are available; other values show English.
colorScheme"light" or "dark"The color scheme. The component uses your platform’s brand colors.
onReady({ embeddedSessionId }) => voidCalled when the component shows.
onComplete({ embeddedSessionId }) => voidCalled once per session when every requirement in it is submitted, including at once when none is left to submit.
onExpire({ embeddedSessionId }) => voidCalled when the session ends, by timing out or through POST /embeddedSessions/{embeddedSessionId}/expire.
onError({ code, embeddedSessionId }) => voidCalled with a code from Errors. embeddedSessionId is absent when no session was read.

mount returns an object with two methods:

MethodDescription
restart()Removes the frame and mounts a new session from getClientToken. Does nothing with clientToken.
unmount()Removes the frame. No callback fires after it.

Callbacks are advisory. Read the outcome from your backend: the session with GET /embeddedSessions/{embeddedSessionId}, and the verification with GET /accountHolders/{accountHolderId}/verification.

Session status

statusMeaningexpiresAt
PENDINGCreated. The clientToken has not been redeemed.When the clientToken stops being redeemable.
ACTIVEThe component is running.When the component stops.
EXPIREDTimed out, or expired through the API.When the session ended.

POST /embeddedSessions/{embeddedSessionId}/expire ends a session at once. A running component stops on its next request. Anything already submitted stays submitted.

Events

EventSent when
embeddedSession.completedAfter the session submitted documents, nothing in its target is left to submit.
embeddedSession.actionRequiredA requirement in the session’s target is required again after it was submitted.
embeddedSession.expiredThe session was expired through the API.
accountHolder.verification.updatedThe account holder’s verification changed, such as moving into review or being denied.

See Webhooks and events to receive them.

Errors

WhereErrorCause
API403 PERMISSION_DENIEDThe key lacks accountHolders:verify, or embeddedSessions:write (embeddedSessions:read to retrieve a session).
API422 VALIDATION_FAILEDorigin is not registered, or target.requirementId is not the requirement of target.userId.
API422 RELATED_RESOURCE_NOT_FOUNDtarget.requirementId or target.userId is not the account holder’s.
API404 RESOURCE_NOT_FOUNDNo session with this ID belongs to the account holder.
mountTypeErrorcontainer matches no element, or neither clientToken nor getClientToken is passed.
onErrorFRAME_UNAVAILABLEThe frame did not load within 20 seconds. The page’s origin may not match the session’s origin, or the session ended first.
onErrorSESSION_UNAVAILABLEgetClientToken failed or returned no token, or the token was already redeemed, expired or refused.
onErrorREQUEST_FAILEDThe frame could not reach the API. The component offers Try again.
onErrorCOMPONENT_FAILEDThe component stopped working. The component offers Try again.
onErrorCOMPONENT_UNAVAILABLEThe component cannot be shown in this frame.