PPID
Follow the encrypted PPID from the hosted verification return to result.user_id. The session token and its public key are different from the OAuth access_token used for API requests.
Follow the PPID from redirect to result
The HTTP example supplies separate success and failure URLs. For a real integration, configure service-owned return pages and bind each return to the original browser session with unpredictable state, expiry, and one-time handling. The optional local backend below demonstrates this session/state behavior separately; the simple cURL does not add those query parameters.
Current US personal-information client flow. Synthetic illustration only. Decoding a JWT payload is not signature or claims verification.
The success URL in this example:
https://example.tomopayment.com/success. This is redirect_url_success in the start request.The URL your browser returns to:
query.token = <SESSION_JWT>andquery.key = <PUBLIC_KEY>. After success, the browser opens the success URL with token, key, and ppid in the query. token is the hosted-completion session JWT. key is the Base64-encoded public JWK used to verify the JWT signature. No key is needed to decode the payload.Inside the session token:
payload.sub = demo-ppid-7K2M, withsub_type = encrypted_ppid. This is your PPID: the encrypted value in payload.sub.
Values are abbreviated. This JSON-style illustration is not parseable JSON; iat and exp are numbers.
{
"iss": "...",
"sub": "demo-ppid-7K2M",
"aud": ["..."],
"iat": ...,
"exp": ...,
"jti": "...",
"sub_type": "...",
"ppid_enc": "...",
"ppid_client_id": "...",
"auth_id": "..."
}
- Pass the PPID to the result API:
POST /v1/idv/result, withuser_id = demo-ppid-7K2M. Send the same encrypted value as user_id, using your OAuth access_token as bearer.
Continue to Step 3: Read the latest US verification result. Use this user_id in the QuickStart result HTTP request. These four cards explain the handoff in guide Step 2.
The same value travels through query.ppid = token.payload.sub = result.user_id.
Complete synthetic return URL
https://example.tomopayment.com/success?token=synthetic-header.eyJpc3MiOiJodHRwczovL2lkdi5leGFtcGxlLnRlc3QvYXV0aHoiLCJzdWIiOiJkZW1vLXBwaWQtN0syTSIsImF1ZCI6WyJodHRwczovL2lkdi5leGFtcGxlLnRlc3QvaWR2Il0sImlhdCI6MTgwNDIwNDgwMCwiZXhwIjoxODA0MjA4NDAwLCJqdGkiOiJkZW1vLXNlc3Npb24taWQiLCJzdWJfdHlwZSI6ImVuY3J5cHRlZF9wcGlkIiwicHBpZF9lbmMiOiJBRVMtMjU2LVBSUCtITUFDLVNIQTI1NiIsInBwaWRfY2xpZW50X2lkIjoiZGVtby1jbGllbnQtaWQiLCJhdXRoX2lkIjoiZGVtby1zZXJ2ZXItZ2VuZXJhdGVkLWF1dGgtaWQifQ.synthetic-signature&key=demo%2Bpublic%2Fkey%3D&ppid=demo-ppid-7K2M
Complete illustrative payload
{
"iss": "https://idv.example.test/authz",
"sub": "demo-ppid-7K2M",
"aud": [
"https://idv.example.test/idv"
],
"iat": 1804204800,
"exp": 1804208400,
"jti": "demo-session-id",
"sub_type": "encrypted_ppid",
"ppid_enc": "AES-256-PRP+HMAC-SHA256",
"ppid_client_id": "demo-client-id",
"auth_id": "demo-server-generated-auth-id"
}
This is front-channel browser navigation to your redirect page, not a backend webhook. The page does not have to be a backend endpoint. Keep API calls, signing, and the Secret Key on your backend.
In this client flow, query.ppid and the session JWT payload.sub contain the same encrypted PPID. Custom authentication flows may use a different subject type.
This simple return illustration contains only token, key, and ppid, matching the supplied success URL. If your service supplies existing query values, preserve them. URLSearchParams decodes each query value once; do not decode the PPID again.
query.key is Base64-encoded public JWK JSON for verifying the session token signature. Payload decoding needs no key; trusting a callback-supplied key alone does not establish issuer authenticity. Neither query.token nor query.key replaces the OAuth access_token.
The payload and token here are synthetic. The token has no valid signature, and the full claims shown are illustrative values, not your configuration.
Do not trust a decoded sub alone. Validate the session token signature and expected claims through a trusted verification path before relying on token claims.
The example failure URL is https://example.tomopayment.com/fail. A failure return does not guarantee token or ppid. In a real integration, validate the browser-session binding and state; do not query result after a failed or mismatched return.
The result body shown is an excerpt. The QuickStart request also supplies country us and the documented personal-information policy.
Complete backend example
The optional downloadable adapter is a local HTTP demonstration that handles the browser return on its own backend route. Keep its localhost callback command for local execution. Your service may instead use its own HTTPS redirect page and securely pass the return to its backend; the local adapter does not serve HTTPS.
The separate KR compatibility backend below validates its browser session, state, outcome, expiry, and one-time use, then sends query.ppid as result.user_id. It does not decode or verify the session JWT signature. The diagram explains the shared value; it does not add token verification to that example.
Follow the PPID from redirect to result
The HTTP example supplies separate success and failure URLs. For a real integration, configure service-owned return pages and bind each return to the original browser session with unpredictable state, expiry, and one-time handling. The optional local backend below demonstrates this session/state behavior separately; the simple cURL does not add those query parameters.
Current US personal-information client flow
Synthetic illustration only. Decoding a JWT payload is not signature or claims verification.
The success URL in this example
https://example.tomopayment.com/successThis is redirect_url_success in the start request.
The URL your browser returns to
https://example.tomopayment.com/success?token=<SESSION_JWT>&key=<PUBLIC_KEY>&ppid=demo-ppid-7K2Mkey is the Base64-encoded public JWK used to verify the JWT signature. No key is needed to decode the payload.
After success, the browser opens the success URL with token, key, and ppid in the query. token is the hosted-completion session JWT.
Inside the session token
Values are abbreviated. This JSON-style illustration is not parseable JSON; iat and exp are numbers.
sub is your encrypted PPID{ "iss": "...", "sub": "demo-ppid-7K2M", "aud": ["..."], "iat": ..., "exp": ..., "jti": "...", "sub_type": "...", "ppid_enc": "...", "ppid_client_id": "...", "auth_id": "..." }Pass the PPID to the result API
POST/v1/idv/result{ "user_id": "demo-ppid-7K2M" }Send the same encrypted value as user_id, using your OAuth access_token as bearer.
query.ppid also contains demo-ppid-7K2M: the same value as token.payload.sub and result.user_id.
Full return URL, token claims, and failure returns
The address preview shortens the token and key. This full synthetic URL preserves their encoding:
https://example.tomopayment.com/success?token=synthetic-header.eyJpc3MiOiJodHRwczovL2lkdi5leGFtcGxlLnRlc3QvYXV0aHoiLCJzdWIiOiJkZW1vLXBwaWQtN0syTSIsImF1ZCI6WyJodHRwczovL2lkdi5leGFtcGxlLnRlc3QvaWR2Il0sImlhdCI6MTgwNDIwNDgwMCwiZXhwIjoxODA0MjA4NDAwLCJqdGkiOiJkZW1vLXNlc3Npb24taWQiLCJzdWJfdHlwZSI6ImVuY3J5cHRlZF9wcGlkIiwicHBpZF9lbmMiOiJBRVMtMjU2LVBSUCtITUFDLVNIQTI1NiIsInBwaWRfY2xpZW50X2lkIjoiZGVtby1jbGllbnQtaWQiLCJhdXRoX2lkIjoiZGVtby1zZXJ2ZXItZ2VuZXJhdGVkLWF1dGgtaWQifQ.synthetic-signature&key=demo%2Bpublic%2Fkey%3D&ppid=demo-ppid-7K2Mtokensynthetic-header.eyJpc3MiOiJodHRwczovL2lkdi5leGFtcGxlLnRlc3QvYXV0aHoiLCJzdWIiOiJkZW1vLXBwaWQtN0syTSIsImF1ZCI6WyJodHRwczovL2lkdi5leGFtcGxlLnRlc3QvaWR2Il0sImlhdCI6MTgwNDIwNDgwMCwiZXhwIjoxODA0MjA4NDAwLCJqdGkiOiJkZW1vLXNlc3Npb24taWQiLCJzdWJfdHlwZSI6ImVuY3J5cHRlZF9wcGlkIiwicHBpZF9lbmMiOiJBRVMtMjU2LVBSUCtITUFDLVNIQTI1NiIsInBwaWRfY2xpZW50X2lkIjoiZGVtby1jbGllbnQtaWQiLCJhdXRoX2lkIjoiZGVtby1zZXJ2ZXItZ2VuZXJhdGVkLWF1dGgtaWQifQ.synthetic-signaturekeydemo+public/key=ppid- demo-ppid-7K2M
Complete illustrative payload
{
"iss": "https://idv.example.test/authz",
"sub": "demo-ppid-7K2M",
"aud": [
"https://idv.example.test/idv"
],
"iat": 1804204800,
"exp": 1804208400,
"jti": "demo-session-id",
"sub_type": "encrypted_ppid",
"ppid_enc": "AES-256-PRP+HMAC-SHA256",
"ppid_client_id": "demo-client-id",
"auth_id": "demo-server-generated-auth-id"
}- This is front-channel browser navigation to your redirect page, not a backend webhook. The page does not have to be a backend endpoint. Keep API calls, signing, and the Secret Key on your backend.
- In this client flow, query.ppid and the session JWT payload.sub contain the same encrypted PPID. Custom authentication flows may use a different subject type.
- This simple return illustration contains only token, key, and ppid, matching the supplied success URL. If your service supplies existing query values, preserve them. URLSearchParams decodes each query value once; do not decode the PPID again.
- query.key is Base64-encoded public JWK JSON for verifying the session token signature. Payload decoding needs no key; trusting a callback-supplied key alone does not establish issuer authenticity. Neither query.token nor query.key replaces the OAuth access_token.
- The payload and token here are synthetic. The token has no valid signature, and the full claims shown are illustrative values, not your configuration.
- Do not trust a decoded sub alone. Validate the session token signature and expected claims through a trusted verification path before relying on token claims.
- The example failure URL is https://example.tomopayment.com/fail. A failure return does not guarantee token or ppid. In a real integration, validate the browser-session binding and state; do not query result after a failed or mismatched return.
- The result body shown is an excerpt. The QuickStart request also supplies country us and the documented personal-information policy.
Separate KR compatibility backend example
This existing backend uses the KR certificate policy, not the current US policy. Its one-URL input and browser session/state handling are preserved for existing consumers.
The optional downloadable adapter is a local HTTP demonstration that handles the browser return on its own backend route. Keep its localhost callback command for local execution. Your service may instead use its own HTTPS redirect page and securely pass the return to its backend; the local adapter does not serve HTTPS.
The separate KR compatibility backend below validates its browser session, state, outcome, expiry, and one-time use, then sends query.ppid as result.user_id. It does not decode or verify the session JWT signature. The diagram explains the shared value; it does not add token verification to that example.
{
"url": "http://localhost:3000/idv/callback?state=...&tomo_outcome=success&ppid=...",
"query": {
"state": "<BACKEND_GENERATED_STATE>",
"tomo_outcome": "success",
"token": "<HOSTED_COMPLETION_TOKEN>",
"key": "<HOSTED_COMPLETION_SIGNING_PUBLIC_KEY>",
"ppid": "<ENCRYPTED_PPID>"
}
}
export async function startVerification(redirectUrl) {
const configuration = readConfiguration();
const callback = validateRedirectUrl(redirectUrl);
const state = randomBytes(32).toString('base64url');
const accessToken = await requestAccessToken(configuration);
// Both return URLs belong to the one callback route you supplied.
const successUrl = completionUrl(callback, state, 'success');
const failureUrl = completionUrl(callback, state, 'failure');
const started = await requestJson('start', configuration, {
country: recipe.country,
kyc_policy: recipe.policy,
redirect_url_success: successUrl,
redirect_url_fail: failureUrl,
}, accessToken, [state]);
if (typeof started.body.start_idv_uri !== 'string') {
throw new BackendFailure('The start response has no browser URL.', started);
}
let browserUrl;
try {
browserUrl = new URL(started.body.start_idv_uri);
} catch (cause) {
throw new BackendFailure('The start response contains an invalid browser URL.',
{ ...started, cause: String(cause) }, started.credentials);
}
if (!['http:', 'https:'].includes(browserUrl.protocol)) {
throw new BackendFailure('The browser verification URL must use HTTP(S).', started);
}
// Keep this object in the same user's backend session, never in the browser.
return {
state,
expiresAt: Date.now() + 15 * 60 * 1000,
consumed: false,
callbackUrl: callback.href,
startIdvUri: started.body.start_idv_uri,
accessToken,
configuration,
};
}
export async function completeVerification(callbackUrl, journey) {
const callback = validateCompletion(callbackUrl, journey);
journey.consumed = true;
if (callback.searchParams.get('tomo_outcome') !== 'success') {
throw new BackendFailure('Verification returned through the failure URL.');
}
// URLSearchParams decodes once. Do not call decodeURIComponent again.
const ppidValues = callback.searchParams.getAll('ppid');
if (ppidValues.length !== 1 || ppidValues[0].length === 0) {
throw new BackendFailure('A successful callback must contain one ppid.');
}
const encryptedPpid = ppidValues[0];
// The API bearer stays the OAuth access_token, never callback token or key.
const result = await requestJson('result', journey.configuration, {
user_id: encryptedPpid,
country: recipe.country,
policy: recipe.policy,
}, journey.accessToken);
// This policy returns the latest completed KR certificate result.
// It does not identify a particular concurrent authentication attempt.
return {
response: result.body,
rawResponse: result.rawBody,
approved: result.body.result?.kyc?.status === 'approved',
};
}
Download the compatibility backend. Extract it, set the three variables, and use Node.js 22.
node backend-server.mjs http://localhost:3000/idv/callback
Node.js 22; no npm runtime dependency. Extract the backend archive, set the three environment variables, and run the command with your one redirect URL.
Open http://localhost:3000/verify. The adapter opens the authentication window through a redirect and associates state with an HttpOnly browser session.
The local adapter is a demonstration: it keeps sessions in memory for 15 minutes and rejects reuse. Deploy the exported functions in your authenticated HTTPS backend with shared session storage and correct proxy/cookie settings.
The functions below are part of backend-flow.mjs. The archive supplies their runtime, existing signer, local HTTP adapter, and failure reporter. They are not isolated standalone fragments.
The full API response is rawResponse. The parsed response view can be used for status inspection; do not reserialize it to claim byte-preserving delivery.