Checking access…

Skip to main content

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.

Copy-paste template

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.

When to Use This Guide

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.

Internal-only content

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 HeadingPurposeRequired?
β€”# [UI Name] (H1)2–3 sentence intro: what it is, who uses it, when to use it vs notβœ… Always
1## Integration DetailsQuick-reference admonition: entry point, session dependency, versions, linksβœ… Always
2## Integration ModelsSupported embed modes (redirect, iFrame, modal, WebView) with trade-offsβœ… Always
3## Entry ContractURL pattern, required/optional query params, tokens β€” treat like an API Requestβœ… Always
4## Authentication & SecurityWho authenticates whom, token type, lifetime, refresh expectationsβœ… Always
5## UI–API Interaction MapTable mapping UI actions β†’ backend API calls, trigger conditions, blocking flag (internal only)Internal only
6## State Machine / LifecycleUI states, transitions, persistence, recoverability, terminal statesβœ… Always
7## Error HandlingMap error sources/codes β†’ UI behaviour, retryabilityβœ… Always
8## Configuration & Feature FlagsConfig keys, sources, and impact on UI behaviourWhen config exists
9## Versioning & Backward CompatibilityUI version vs API version matrix, migration guidance, breaking changesWhen multiple versions
10## Known LimitationsUnsupported browsers/modes, UX constraints, compliance blocksβœ… Always
11## Related DocumentationCross-reference links to API docs, business docs, error code docsβœ… Always
12## AppendixOptional: sample launch URLs and a short glossaryOptional

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.

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​