Document Generation
Generate a tenant-branded PDF document for a customer and wallet — the underlying query, template, and branding are all tenant configuration.
The Document Generation API produces a branded PDF for a customer and wallet — an Account Confirmation Letter, a Statement, or a Proof of Payment. The document type controls which data is fetched and which template renders it; both are tenant configuration, so the underlying query and the look of the document can be changed without any code deployment.
Generating a Document
POST /eclipse-conductor/rest/v1/tenants/{tenantId}/documents/generate
Authorization: Bearer {jwt}
Content-Type: application/json
{
"documentType": "ACCOUNT_CONFIRMATION_LETTER",
"customerId": 9581252,
"walletId": 2549223,
"requestedBy": "channel-user-1"
}Response (200 OK):
{
"documentType": "ACCOUNT_CONFIRMATION_LETTER",
"fileName": "account-confirmation-letter.pdf",
"mimeType": "application/pdf",
"encoding": "base64",
"document": "JVBERi0xLjQ...",
"referenceNumber": "SBTPA-26-0728-A1B2C3D4",
"generatedDate": "2026-07-28T10:15:00.000Z"
}document is the flattened, non-editable PDF, base64-encoded. referenceNumber is stamped on the document itself and is safe to show to the customer as a reference for the request.
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
documentType | String | Yes | The document to generate. See Available Document Types |
customerId | Long | Yes | The customer the document is generated for. Must be active |
walletId | Long | Yes | The wallet the document is generated for. Must be active and belong to customerId |
requestedBy | String | No | Identifier of the channel or user requesting generation. Recorded on the audit trail only |
additionalData | Array | No | {"att": "...", "val": "..."} pairs for inputs a specific document type needs — see below |
Available Document Types
documentType is not a fixed enum — it is validated against whatever your tenant has enabled (see Configuring Document Types). Three are available out of the box:
| Type | Extra additionalData required | Notes |
|---|---|---|
ACCOUNT_CONFIRMATION_LETTER | None | The wallet must already have a virtual account number allocated |
STATEMENT | dateFrom, dateTo (ISO date YYYY-MM-DD) | Statement period may be capped per tenant |
PROOF_OF_PAYMENT | transactionId | Tenant can restrict this to specific transaction statuses |
Example — Statement with a date range:
POST /eclipse-conductor/rest/v1/tenants/{tenantId}/documents/generate
Authorization: Bearer {jwt}
Content-Type: application/json
{
"documentType": "STATEMENT",
"customerId": 9581252,
"walletId": 2549223,
"additionalData": [
{ "att": "dateFrom", "val": "2026-01-01" },
{ "att": "dateTo", "val": "2026-06-30" }
]
}Example — Proof of Payment for a specific transaction:
POST /eclipse-conductor/rest/v1/tenants/{tenantId}/documents/generate
Authorization: Bearer {jwt}
Content-Type: application/json
{
"documentType": "PROOF_OF_PAYMENT",
"customerId": 9581252,
"walletId": 2549223,
"additionalData": [
{ "att": "transactionId", "val": "TXN-45231" }
]
}
Note
transactionIdaccepts the internal transaction ID, the external transaction ID, or the unique ID — whichever you have on hand.
Configuring Document Types
Every document type — including the three above — is driven entirely by configuration, scoped to your tenant. A new document type can be enabled without any code change: enable the type name, add its query, and add its template.
Enabling document types
| Property | Description |
|---|---|
generate.document.supported.types | Tenant config item. Comma-separated list of document type names enabled for your tenant |
Report query
The query is a sub-property of a reporting.config property, keyed by report ID — not part of the property name itself.
| Property | Sub-property key | Description |
|---|---|---|
reporting.config | <reportId> | Global default query. Value format: <connectionName>,<query> |
reporting.config.<tenantId> | <reportId> | Tenant-specific override — takes precedence over the global query for your tenant |
Report IDs for the built-in types: account-confirmation-letter, statement-transactions, proof-of-payment. A new document type's report ID is the type name, lower-cased with _ replaced by - (e.g. WELCOME_LETTER → welcome-letter). additionalData values bind to the query automatically: a value that parses as an ISO date (YYYY-MM-DD) binds to the next date parameter, anything else binds to the next string parameter.
Template
| Property | Description |
|---|---|
handlebar.template.generate.document.<TYPE> | Global default Handlebars template rendered into the PDF |
handlebar.template.generate.document.<tenantId>.<TYPE> | Tenant-specific override |
Branding
| Property | Description |
|---|---|
generate.document.branding.<key> | Tenant config item. Company/sponsor details injected into every template — legalName, branchCode, sponsorBankName, and referencePrefix are required; tenantLogoUrl, website, sponsorDisclosure, and others are optional |
NoteThe global default branding belongs to another tenant. Set your own
generate.document.branding.<key>values before generating documents — otherwise your documents are branded with someone else's details.
Optional per-type settings
| Property | Description |
|---|---|
document.filename.<TYPE> | Tenant config item. Overrides the returned fileName for that type |
generate.document.statement.max.period.days | Tenant config item. Caps the STATEMENT date range, in days. Unlimited by default |
generate.document.proof-of-payment.eligible.statuses / generate.document.proof-of-payment.status.field | Tenant config item. Restricts PROOF_OF_PAYMENT to specific transaction statuses. Unrestricted by default |
NoteThe
reporting.config/reporting.config.<tenantId>sub-properties and thehandlebar.template.generate.document.*properties are platform properties, not tenant config items — setting them requires access to the Eclipse platform property store (via Admin Portal or API). Everything else on this page is a standard tenant config item.
Permissions Required
Set as tenant config items — access is denied by default until explicitly granted.
| Permission | Description |
|---|---|
GenerateDocument.ACCOUNT_CONFIRMATION_LETTER.CREATE.Allowed | Generate an Account Confirmation Letter |
GenerateDocument.STATEMENT.CREATE.Allowed | Generate a Statement |
GenerateDocument.PROOF_OF_PAYMENT.CREATE.Allowed | Generate a Proof of Payment |
GenerateDocument.<TYPE>.CREATE.Allowed | Generate any additional configured document type |
Each permission's value is a comma-delimited list of role or position names. Include CUSTOMER in the list to let a customer generate a document for their own customerId directly.
Updated about 1 hour ago
