Checking access…

Skip to main content

UI Integration Document Template

Explanation and examples

This page is the copy-paste skeleton only. For the purpose of each section and a worked example, see the UI Integration Document Guidelines. For internal-only sections, see the Internal vs. Merchant Content Guide.

# [UI Name]

[2-3 sentences: what it is, who uses it, when to use it vs not]
## Integration Details

:::tip[Integration Details]
- **Enablement/Prerequisites:** Session must be created via [Create Session API](/docs/...). Merchant account must be configured for UI.
- **Entry Point:** `GET /checkout-ui?sessionId=<id>&merchantId=<id>`
- **Supported Embed Models:** Redirect, iFrame, Modal
- **UI Version:** v3
- **Required API Version:** v2 (v1.3+ minimum)
- **Session Token Lifetime:** 15 minutes
- **Sandbox / Test Mode:** Append `?env=sandbox` to simulate flows.
- **Error Codes:** See UI Error Codes for UI-surface errors.
:::
## Integration Models

| Model | Description | Supported |
| -------------- | ------------------------------------ | --------- |
| Redirect | Full-page redirect to hosted UI | βœ… |
| iFrame | Embedded inside merchant page | βœ… |
| Modal / Widget | JS-injected modal overlay | βœ… |
| Native Wrapper | WebView (mobile) | βœ… |

For each supported model: how to launch, known constraints (CSP, cookies, `X-Frame-Options`),
session/context dependency, pros and cons.
## Entry Contract

GET [launch-route]

Required:
sessionId string Session token from Create Session API
merchantId string Merchant identifier

Optional:
locale string BCP 47 language tag (default: en-US)
theme string Merchant theme key
returnUrl string Redirect target on completion
cancelUrl string Redirect target on cancel
## Authentication & Security

- **Who authenticates the user** β€” backend session vs UI-level auth
- **Token type** β€” JWT, opaque session token, cookie
- **Token lifetime** β€” and what the UI does when it expires
- **Refresh expectations** β€” silent refresh or always a new session?
- **CSP and frame policy requirements** for iFrame or modal models
## UI–API Interaction Map

<Audience include="internal">

| UI Action | Backend API | Triggered When | Blocking (waits for response) |
| -------------- | ----------------------- | ---------------------- | ----------------------------- |
| Page load | `GET /session/{id}` | UI initialized | βœ… Yes |
| Submit payment | `POST /v2/payments` | User clicks "Pay" | βœ… Yes |
| Cancel | `POST /v2/cancel` | User exits / cancels | ❌ No (fire-and-forget) |

Include an internal sequence diagram (`mermaid` `sequenceDiagram`) showing the full message flow
between UI, CCG Platform, and processors.

</Audience>
## State Machine / Lifecycle

INIT β†’ LOADED β†’ INPUT β†’ PROCESSING β†’ SUCCESS
β†’ FAILURE
β†’ CANCELLED
β†’ SESSION_EXPIRED

| State | Description | Persisted? | Recoverable on refresh? | Terminal? |
| ---------- | ------------------------------------ | ---------- | ----------------------- | --------- |
| [STATE] | [What's happening] | [Yes/No] | [Yes/No] | [Yes/No] |
## Error Handling

| Error Code | UI Behaviour | Retryable? |
| ---------- | ------------------------------------ | ---------- |
| [code] | [What the UI shows/does] | [Yes/No] |
## Configuration & Feature Flags

| Config Key | Source | Impact |
| ------------------- | ----------------- | ------------------------------------------- |
| `[configKey]` | [Query param / session payload / merchant account setting] | [What it controls] |

<Audience include="internal">

Internal feature flags (LaunchDarkly / config service keys) and their rollout status.

</Audience>
## Versioning & Backward Compatibility

| UI Version | Min API Version | Max API Version | Status |
| ---------- | --------------- | --------------- | ------------------- |
| [version] | [min] | [max] | [Current/Deprecated/EOL] |

- **Breaking vs non-breaking UI changes** β€” what constitutes a breaking change
- **Migration guidance** β€” steps to upgrade from the previous version
- **Deprecation timeline** with dates
## Known Limitations

- **Unsupported browsers**
- **Unsupported embed modes**
- **Known UX constraints**
- **Regulatory / compliance blocks**
- **Known incidental issues** with workarounds if available
## Related Documentation

| Document | Link |
| ------------------------------------------------- | ------------------------------------- |
| Create Session API (entry contract dependency) | [Link to integration doc] |
| Payment API (UI–API interaction reference) | [Link to integration doc] |
| Business Use Case doc (what problem this solves) | [Link to business doc] |
| Error Code Reference | [Link to error codes] |
| OpenAPI Spec | [Link to API spec] |
| UI Changelog / Release Notes | [Link to whats-new or changelog] |
## Appendix

### Sample Launch URLs

# Redirect (full-page)
https://<host>/checkout-ui?sessionId=<id>&merchantId=<id>

# Sandbox mode
https://<host>/checkout-ui?sessionId=<id>&merchantId=<id>&env=sandbox

### Glossary

| Term | Definition |
| ---------------- | ------------------------------------------------------------ |
| Session | Backend-issued token representing a checkout context |
| Entry Contract | The set of params required to correctly initialize the UI |
| Terminal State | A UI state that cannot transition to any other state |