---
updatedAt: 2026-09-15T13:31:07.000Z
agentTools:
  projectIndex: https://developers.cloudbeds.com/llms.txt
---

# Resolve the email subject for a fiscal document

Returns the subject the service would put on the email, so a UI can seed an editable Subject
field from the same resolution the send uses rather than reimplementing it.

Give `documentId` for a document that exists. The answer is then exactly what a send with no
subject override produces: a token the service holds no value for resolves to an empty
string, as it would in the delivered email.

Give `documentKind`, `sourceKind` and `sourceId` instead for a document about to be created.
A token whose value is only assigned at creation is then returned **verbatim**, for example
`Grand Hotel - Invoice #[Invoice Number]`. Send the string back, edited or not, on the create
request and the service fills those tokens in once the values exist.

Supplying the chosen recipient lets the guest's language win when the property has
"use guest language" enabled; without it the subject falls back to the property's language.


# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Fiscal document service API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.cloudbeds.com"
    }
  ],
  "paths": {
    "/fiscal-document/v1/fiscal-documents/email-subject": {
      "get": {
        "summary": "Resolve the email subject for a fiscal document",
        "description": "Returns the subject the service would put on the email, so a UI can seed an editable Subject\nfield from the same resolution the send uses rather than reimplementing it.\n\nGive `documentId` for a document that exists. The answer is then exactly what a send with no\nsubject override produces: a token the service holds no value for resolves to an empty\nstring, as it would in the delivered email.\n\nGive `documentKind`, `sourceKind` and `sourceId` instead for a document about to be created.\nA token whose value is only assigned at creation is then returned **verbatim**, for example\n`Grand Hotel - Invoice #[Invoice Number]`. Send the string back, edited or not, on the create\nrequest and the service fills those tokens in once the values exist.\n\nSupplying the chosen recipient lets the guest's language win when the property has\n\"use guest language\" enabled; without it the subject falls back to the property's language.\n",
        "operationId": "getFiscalDocumentEmailSubject",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2": [
              "read:reservation"
            ]
          }
        ],
        "tags": [
          "Fiscal Documents"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/propertyIdHeader"
          },
          {
            "name": "documentId",
            "in": "query",
            "required": false,
            "description": "An existing fiscal document. When given, the document parameters below are ignored - everything is derived from the document itself.\n",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "documentKind",
            "in": "query",
            "required": false,
            "description": "Required when documentId is absent.",
            "schema": {
              "$ref": "#/components/schemas/FiscalDocumentKind"
            }
          },
          {
            "name": "sourceKind",
            "in": "query",
            "required": false,
            "description": "Required when documentId is absent.",
            "schema": {
              "$ref": "#/components/schemas/SourceKind"
            }
          },
          {
            "name": "sourceId",
            "in": "query",
            "required": false,
            "description": "Required when documentId is absent.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "recipientType",
            "in": "query",
            "required": false,
            "description": "The chosen Bill-to recipient. Supply together with recipientId. Optional because a manually entered recipient has no stored record to point at; the subject then resolves in the property's language rather than the guest's.\n",
            "schema": {
              "$ref": "#/components/schemas/EmailSubjectRecipientType"
            }
          },
          {
            "name": "recipientId",
            "in": "query",
            "required": false,
            "description": "The chosen Bill-to recipient. Supply together with recipientType.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSubjectResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.cloudbeds.com/auth/oauth/authorize",
            "tokenUrl": "https://api.cloudbeds.com/auth/oauth/token",
            "scopes": {
              "read:reservation": "Read fiscal documents and fiscalization configuration",
              "write:reservation": "Create, update, or void fiscal documents and fiscalization configuration"
            }
          }
        }
      }
    },
    "parameters": {
      "propertyIdHeader": {
        "name": "X-Property-ID",
        "in": "header",
        "required": true,
        "schema": {
          "type": "integer",
          "format": "int64",
          "minimum": 1
        },
        "description": "Property id"
      }
    },
    "responses": {
      "400": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "403": {
        "description": "Access denied",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "404": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      }
    },
    "schemas": {
      "EmailSubjectResponse": {
        "type": "object",
        "required": [
          "subject"
        ],
        "properties": {
          "subject": {
            "type": "string",
            "description": "The resolved subject. On the create-form variant, tokens the service cannot fill yet are left verbatim, e.g. \"Grand Hotel - Invoice #[Invoice Number]\".\n"
          }
        }
      },
      "EmailSubjectRecipientType": {
        "type": "string",
        "description": "Which backing record a recipient id points at. Deliberately a separate schema from RecipientRequest.type even though the values match: $ref-ing that one would rename the generated RecipientRequest.TypeEnum and break every creation call site.\n",
        "enum": [
          "GUEST",
          "CONTACT",
          "GROUP",
          "COMPANY",
          "GROUP_PROFILE",
          "GROUP_PROFILE_CONTACT"
        ]
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "errorCode": {
            "type": "string"
          },
          "errorDetails": {
            "type": "string"
          }
        }
      },
      "SourceKind": {
        "type": "string",
        "description": "Kind of the source entity",
        "enum": [
          "GROUP_PROFILE",
          "RESERVATION",
          "HOUSE_ACCOUNT",
          "ACCOUNTS_RECEIVABLE_LEDGER"
        ]
      },
      "FiscalDocumentKind": {
        "type": "string",
        "description": "Kind of fiscal document",
        "enum": [
          "INVOICE",
          "CREDIT_NOTE",
          "RECEIPT",
          "RECTIFY_INVOICE",
          "PRO_FORMA_INVOICE",
          "REFUND_RECEIPT",
          "INVOICE_RECEIPT",
          "ADVANCE_INVOICE",
          "SETTLEMENT_INVOICE",
          "TAX_WITHHOLDING"
        ]
      }
    }
  }
}
```