UI Integration Document Guidelines
This guide standardizes UI integration documentation for frontend engineers, platform engineers, and QE/automation engineers. Think of a UI integration doc as "How do I integrate, operate, and test your UI safely?" β not product marketing.
This page explains the purpose of each section with worked examples. For the plain skeleton to copy into a new doc, see the UI Integration Document Template.
Use this guide when documenting a UI component, widget, or hosted page that consuming teams need to embed, launch, or automate (e.g., the Checkout UI, payment widget, 3DS challenge frame). For backend API documentation, refer to the Integration/API Document Guidelines.
For sequence diagrams, feature-flag internals, or processor-level behaviour, follow the Internal vs. Merchant Content Guide.
Standard Section Headingsβ
Every UI integration document must follow these section headings in this order.
| # | Section Heading | Purpose | Required? |
|---|---|---|---|
| β | # [UI Name] (H1) | 2β3 sentence intro: what it is, who uses it, when to use it vs not | β Always |
| 1 | ## Integration Details | Quick-reference admonition: entry point, session dependency, versions, links | β Always |
| 2 | ## Integration Models | Supported embed modes (redirect, iFrame, modal, WebView) with trade-offs | β Always |
| 3 | ## Entry Contract | URL pattern, required/optional query params, tokens β treat like an API Request | β Always |
| 4 | ## Authentication & Security | Who authenticates whom, token type, lifetime, refresh expectations | β Always |
| 5 | ## UIβAPI Interaction Map | Table mapping UI actions β backend API calls, trigger conditions, blocking flag (internal only) | Internal only |
| 6 | ## State Machine / Lifecycle | UI states, transitions, persistence, recoverability, terminal states | β Always |
| 7 | ## Error Handling | Map error sources/codes β UI behaviour, retryability | β Always |
| 8 | ## Configuration & Feature Flags | Config keys, sources, and impact on UI behaviour | When config exists |
| 9 | ## Versioning & Backward Compatibility | UI version vs API version matrix, migration guidance, breaking changes | When multiple versions |
| 10 | ## Known Limitations | Unsupported browsers/modes, UX constraints, compliance blocks | β Always |
| 11 | ## Related Documentation | Cross-reference links to API docs, business docs, error code docs | β Always |
| 12 | ## Appendix | Optional: sample launch URLs and a short glossary | Optional |
What NOT to include:
- β Business justification or product marketing
- β End-user training or UX rationale
- β Full API specs (link to them instead)
- β Design discussions or visual design decisions
Section guidanceβ
The Template has the exact skeleton for every section (Integration Details block, tables, state table, Related Documentation table). Below is only what the template does not say. Section numbers match the table above.
H1 introductionβ
Orient the reader in 2β3 sentences: what the UI is, when to use it versus an alternative (API-only flow, different widget version), and the supported integration models.
The Checkout UI enables merchants to collect payment details securely and complete a checkout session created via CCG APIs. It supports redirect, iFrame, and modal integration models.
1. Integration Detailsβ
A quick-reference :::tip Integration Details admonition summarizing the integration surface; see the template for the block.
2. Integration Modelsβ
For each supported model, give how to launch (URL pattern or JS snippet), known constraints (CSP, third-party cookies, X-Frame-Options), session dependency, and pros and cons.
The iFrame model requires
Content-Security-Policy: frame-ancestors 'self' https://<merchant-domain>and does not support third-party cookie-dependent flows. Use the Redirect model for maximum compatibility.
3. Entry Contractβ
Treat UI launch like an API request. Link to the API doc that creates the session instead of duplicating field definitions, and document what happens when required params are missing.
4. Authentication & Securityβ
Make the trust model explicit so developers do not guess who authenticates whom.
The UI trusts the sessionId issued by the backend (Create Session API).
If the session expires mid-flow, the UI displays a session-expired error and redirects to cancelUrl.
Token lifetime: 15 minutes, non-refreshable. A new session must be created for re-entry.
5. UIβAPI Interaction Map (internal only)β
The primary reference for QE automation and defect triage. List all API interactions, including fire-and-forget calls, note which ones block the UI, and link each API to its integration doc. Wrap the section as internal-only.
6. State Machine / Lifecycleβ
Document UI states like backend transaction states. For each state record whether it is persisted, recoverable on refresh, and terminal.
7. Error Handlingβ
Document only error codes actually handled at the UI layer, map each to a UI behaviour, and document error screen content (heading, body, CTA) for non-recoverable states. Link to Error Codes for the full reference.
8. Configuration & Feature Flagsβ
State the source of truth for each config (query param, session payload, merchant setting), its default when absent, and whether a change needs a new session. Internal feature flags are internal-only content.
9. Versioning & Backward Compatibilityβ
Define what counts as a breaking UI change (removed elements, changed data-testid values, removed states), give migration steps, and list deprecation dates.
UI v2 requires API v1.3+. Breaking change: `card-submit-button` data-testid renamed to `payment-submit-cta` in v3.
10. Known Limitationsβ
Be explicit about unsupported browsers, embed modes, UX constraints, compliance blocks, and workarounds for known issues.
11. Related Documentationβ
Link the entry-contract dependency, UIβAPI interaction reference, business use case doc, error codes, OpenAPI spec, and UI changelog.
12. Appendix (optional)β
Use only for sample launch URLs and a glossary that would clutter the main sections.
See Alsoβ
- UI Integration Document Template β the copy-paste skeleton