Hosted form contract
Use this contract when maintaining hosted forms or implementing a custom WebView adapter. Apps using the SDK-owned presentation do not need to implement this bridge.
Form origins and URLs
Both platforms in the reviewed revision use https://devsdk.wollette.com. There is no configurable form origin. Changing the API or login base URL does not switch it.
The SDK constructs the following paths on the fixed origin. Values come from the current session and confirmed API data and are URL-encoded.
| Step | URL |
|---|---|
| AIS | /ais?consumerId=<id> |
| Griffin | /griffin?consumerId=<id>&mode=<mode>[®istrationId=<id>][&status=<status>] |
| PIS | /pis?consumerId=<id>&aisConsentId=<id> |
Griffin mode is start, resume, verify, pending or retry. Right after AIS completes in the same call, a DRAFT registration opens with mode=start and its registrationId so the form shows Griffin consent before KYC. A resumed form fetches its data by registrationId; the URL never carries registration data or version. For ordinary activation, PIS uses the most recently created completed AIS consent; ambiguous or missing creation dates can produce INVALID_RESPONSE. Account linking uses the new consent ID returned by the trusted AIS callback. Targeted recovery uses the saved consent ID.
Account-linking form URLs carry flow=add-account. Recovered PIS also carries resume=pis. These identify the flow; they do not replace API confirmation.
No access token, OTP, developer signature or private key ever appears in a form URL.
Session injection
Before page scripts run on the form origin, the SDK-owned presenter injects:
window.WOLLETTE_SESSION = { token: "<current access token>", consumerId: "<current consumer id>" };
localStorage.setItem("WOLLETTE_SESSION", JSON.stringify(window.WOLLETTE_SESSION));A custom adapter must obtain the current token from its own approved host-managed session integration. The public adapter receives no session, and hosted login exposes no public token getter. See public adapter limits.
The form reads either value at startup. Both are overwritten on every opening with the current session; the injected value is a snapshot for that opening. Only trusted scripts should run on the form origin. Do not add a token URL fallback for browser testing.
Completion messages
When the form has finished its work, its main frame sends one terminal message for the step that is currently open:
window.WOLLETTE_NATIVE.postMessage(JSON.stringify({
version: 1,
step: "ais", // "griffin" or "pis" on those pages
event: "finished", // or "cancelled", "saved", "failed"
data: { consentId: "<completed AIS consent id>" } // Required for AIS account linking
}));| Event | Meaning | SDK-owned presenter behaviour |
|---|---|---|
finished | The form believes the step completed | Re-check the API for up to about 30 seconds; open the next form on a confirmed change |
cancelled | The user cancelled | End the flow with CANCELLED |
saved | A Griffin draft was saved to continue later | Close the form, read progress once, return it. Ignored for AIS and PIS |
failed | The form cannot complete | End the flow with ONBOARDING_FAILED without opening the next form |
version must be the number 1 and step must match the active step. Send one terminal message per opening. For AIS account linking, include only the completed consent ID in data.consentId; omit that field for other steps. Do not include tokens, personal data or whole API responses. The SDK accepts the message only from the main frame on the form origin; a malformed or mismatched message is ignored and the form stays open. The legacy postMessage("complete") signal has no step or consent ID. It cannot satisfy account linking, which requires a trusted new consent ID.
The Griffin saved path uses an internal native signal. The public custom-adapter interface cannot emit that signal; returning normally starts confirmation polling instead. Use the SDK-owned presenter for save-and-return, and do not reinterpret saved as cancellation.
When to send finished:
| Form | Condition |
|---|---|
| AIS | After the form confirms CONSENT_COMPLETED for the consent being authorised. Creating a consent or returning from the bank is not enough |
| Griffin | After a status read confirms ACCEPTED, or when the form must hand control to the SDK to open identity verification (see below) |
| PIS | After the form confirms CONSENT_COMPLETED for the payment consent |
The Griffin form keeps waiting for approval in its hosted status screen. It also sends finished before acceptance when the server reports the IDV stage, the form is not already in verify mode, and either a submission job has been processed or the opening mode is pending or retry. The SDK then re-reads the registration and opens verify when required. Submission alone, a waiting or failure screen, or a return from IDV does not send finished; the form checks the registration state first.
Bank returns (AIS and PIS)
AIS and PIS navigate to the bank's authorisation page in the same WebView. The SDK recognises only the active step's callback on the API origin from WolletteConfig.apiBaseUrl, matching scheme, host and effective port:
| Active step | Backend callback path | Hosted continuation path |
|---|---|---|
| AIS | /api/v1/psd/ais/consents/callbacks | /ais/authorising?consumerId=<id> |
| PIS | /api/v1/psd/pis/consents/callbacks | /pis/authorising?consumerId=<id> |
After the callback's main-frame load finishes, the SDK loads the continuation page on the form origin in the same WebView. This happens once per opening and does not finish the step. The SDK preserves flow=add-account on a linking continuation. The continuation receives the injected session, resolves the consent from form state or API reads (the SDK adds no consent ID to the continuation URL), and confirms CONSENT_COMPLETED before sending finished. A linking AIS page then includes data.consentId. Callbacks for the wrong step, or on other origins or paths, do not trigger restoration.
Identity-provider return (Griffin)
When Griffin opens in verify mode with a registration id and its main frame navigates to an external HTTPS page, the SDK polls that registration every 2 seconds. Once its non-empty status leaves PENDING_VERIFICATION_DOCUMENTS, PENDING_VERIFICATION_RESOURCES and PENDING_VERIFICATION_SUBMISSION, the SDK loads /griffin in the same WebView with the updated mode, id and status. A provider navigation back to the form origin stops the polling. API errors during observation are retried while the external page stays open. Returning to Griffin does not prove acceptance; the form checks again before sending finished.
Bank and IDV waits happen before finished and are not limited by the 30-second confirmation window.
Open a link in the device browser
window.WOLLETTE_NATIVE.postMessage(JSON.stringify({
version: 1,
event: "open_url",
data: { url: "https://example.com/terms" }
}));Accepted only from the main frame on the form origin. The URL must be HTTPS, have a host and contain no user information. A top-level url field is also accepted. The message has no step, leaves the form open and triggers no progress check.
Server confirmation
| Step | Evidence | API route |
|---|---|---|
| AIS | At least one consent has CONSENT_COMPLETED | GET psd/ais/consents?consumerId=… |
| Griffin | The latest registration has ACCEPTED | GET baas/consumer-registrations?consumerId=… |
| BaaS account | A BaaS account exists; otherwise the SDK creates one from the accepted registration's entity id | GET baas/accounts?ownerId=…&ownerType=CONSUMER; POST baas/accounts?entityId=… |
| PIS | A CONSENT_COMPLETED PIS consent refers to a completed AIS consent and the wallet exists | GET psd/pis/consents?consumerId=… |
progress performs general reads. Targeted linking/recovery checks the selected AIS consent and its matching PIS consent. start, resumeRegistration, addAccount and targeted recovery confirm server state after callbacks and can create the BaaS account when needed before PIS.
Storage and cleanup
On clear or a consumer switch the SDK closes its owned forms and clears their storage: Android deletes Web Storage for the form origin; iOS replaces its non-persistent data store. The SDK also deletes any saved pending wallet operation. Before PIS, that record contains the consumer ID, AIS consent ID and linking flag; it survives interruptions and is cleared on completion or explicit cancellation. Handle storage failures rather than assuming cleanup finished. Host app storage is untouched. Custom adapters own their own form/storage cleanup; the SDK cannot automatically clear an independently managed WebView.
Android camera policy
The SDK requests camera permission when the page uses getUserMedia or a capture file input, and grants the WebView video capture only. A request from the HTTPS form origin proceeds after the Android permission is granted. The HTTP localhost origin does not pass this policy. An HTTPS KYC page on another origin additionally needs explicit user confirmation showing that origin.