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

FieldTypeRequiredDescription
documentTypeStringYesThe document to generate. See Available Document Types
customerIdLongYesThe customer the document is generated for. Must be active
walletIdLongYesThe wallet the document is generated for. Must be active and belong to customerId
requestedByStringNoIdentifier of the channel or user requesting generation. Recorded on the audit trail only
additionalDataArrayNo{"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:

TypeExtra additionalData requiredNotes
ACCOUNT_CONFIRMATION_LETTERNoneThe wallet must already have a virtual account number allocated
STATEMENTdateFrom, dateTo (ISO date YYYY-MM-DD)Statement period may be capped per tenant
PROOF_OF_PAYMENTtransactionIdTenant 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

transactionId accepts 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

PropertyDescription
generate.document.supported.typesTenant 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.

PropertySub-property keyDescription
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_LETTERwelcome-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

PropertyDescription
handlebar.template.generate.document.<TYPE>Global default Handlebars template rendered into the PDF
handlebar.template.generate.document.<tenantId>.<TYPE>Tenant-specific override

Branding

PropertyDescription
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
📘

Note

The 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

PropertyDescription
document.filename.<TYPE>Tenant config item. Overrides the returned fileName for that type
generate.document.statement.max.period.daysTenant 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.fieldTenant config item. Restricts PROOF_OF_PAYMENT to specific transaction statuses. Unrestricted by default
📘

Note

The reporting.config/reporting.config.<tenantId> sub-properties and the handlebar.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.

PermissionDescription
GenerateDocument.ACCOUNT_CONFIRMATION_LETTER.CREATE.AllowedGenerate an Account Confirmation Letter
GenerateDocument.STATEMENT.CREATE.AllowedGenerate a Statement
GenerateDocument.PROOF_OF_PAYMENT.CREATE.AllowedGenerate a Proof of Payment
GenerateDocument.<TYPE>.CREATE.AllowedGenerate 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.


Did this page help you?