> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dolfinai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview invoice email

> Returns the rendered email that will be sent for this invoice. Only available while the invoice is in Draft status. Optional ?tone= and ?industryGroup= query parameters let callers rehearse a different catalogue cell without changing the organisation's defaults; when omitted, the organisation's DefaultInvoiceMessageTone and its industry group are used. Optional ?subject=, ?previewText=, ?greetingLine= and ?openingBodyMarkdown= mirror the SendInvoiceOverrides fields so the caller can preview the exact email that would be sent with those overrides.



## OpenAPI

````yaml /api-reference/openapi.json get /invoices/{id}/email-preview
openapi: 3.1.1
info:
  title: Dolfin API
  description: >-
    Dolfin API for AR & AP. Authenticate using the `x-dolfin-api-key` header
    with the API key distributed to your organisation.
  version: v1
servers:
  - url: https://api.dolfinai.co
    description: Production
security:
  - {}
tags:
  - name: Webhooks
  - name: Users
  - name: TaxRates
  - name: Suppliers
  - name: Supplier Credit Notes
  - name: Bills
  - name: SpendCategories
  - name: Payables
  - name: RecurringInvoices
  - name: Receivables
  - name: Purchase Orders
  - name: Products
  - name: Payments
  - name: Invoices
  - name: Organisations
  - name: Members
  - name: MCP
  - name: Matching
  - name: Invoice Reminders
  - name: Industries
  - name: Gmail
  - name: Delivery Notes
  - name: Customers
  - name: Currencies
  - name: Credit Notes
  - name: Clients
  - name: ClientInvites
  - name: BankPayments
  - name: Bank details
  - name: Auth
  - name: ApprovalPolicies
  - name: ApiKeys
  - name: Agent
paths:
  /invoices/{id}/email-preview:
    get:
      tags:
        - Invoices
      summary: Preview invoice email
      description: >-
        Returns the rendered email that will be sent for this invoice. Only
        available while the invoice is in Draft status. Optional ?tone= and
        ?industryGroup= query parameters let callers rehearse a different
        catalogue cell without changing the organisation's defaults; when
        omitted, the organisation's DefaultInvoiceMessageTone and its industry
        group are used. Optional ?subject=, ?previewText=, ?greetingLine= and
        ?openingBodyMarkdown= mirror the SendInvoiceOverrides fields so the
        caller can preview the exact email that would be sent with those
        overrides.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: tone
          in: query
          schema:
            $ref: '#/components/schemas/InvoiceTone'
        - name: industryGroup
          in: query
          schema:
            $ref: '#/components/schemas/MerchantCategoryGroup'
        - name: subject
          in: query
          schema:
            type: string
        - name: previewText
          in: query
          schema:
            type: string
        - name: greetingLine
          in: query
          schema:
            type: string
        - name: openingBodyMarkdown
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceEmailPreviewResponse'
        '400':
          description: Invoice.CustomerMissingEmail — the customer has no email address
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: >-
            Invoice.NotFound — no invoice with that id for this organisation


            Organisation.NotFound — the organisation does not exist or could not
            be resolved
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Invoice.NotPreviewable — invoice is not in Draft status
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    InvoiceTone:
      enum:
        - Friendly
        - Direct
        - Formal
    MerchantCategoryGroup:
      enum:
        - Agriculture
        - ContractedServices
        - Transportation
        - Utilities
        - RetailStores
        - Clothing
        - MiscellaneousRetail
        - FinancialServices
        - PersonalServices
        - BusinessServices
        - ProfessionalServices
        - Government
        - Entertainment
        - Travel
        - null
    InvoiceEmailPreviewResponse:
      required:
        - subject
        - previewText
        - greetingLine
        - openingBodyMarkdown
        - openingBodyHtml
        - htmlBody
        - textBody
      type: object
      properties:
        subject:
          type: string
        previewText:
          type: string
        greetingLine:
          type: string
        openingBodyMarkdown:
          type: string
        openingBodyHtml:
          type: string
        htmlBody:
          type: string
        textBody:
          type: string
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string

````