Document Numbering Queries

Query document numbering sequences and formats.

DocumentNumberingContext

Returns the effective numbering context for a document type, including whether manual override is allowed, shared sequences, and date constraints.

Parameters:

ParameterTypeDescription
document_typeString!Document type (e.g., invoice, estimate).
dated_atStringDate for context (format: YYYY-MM-DD).

Example Query:

query GetDocumentNumberingContext($document_type: String!, $dated_at: String) {
  DocumentNumberingContext(document_type: $document_type, dated_at: $dated_at) {
    manual_override_allowed_effective
    shared_sequence_with
    preview
    min_date
    max_date
  }
}

Example Variables:

{
  "document_type": "invoice",
  "dated_at": "2026-01-15"
}
FieldTypeDescription
manual_override_allowed_effectiveBoolean!Whether manual number override is currently allowed.
shared_sequence_withStringDocument type sharing the same sequence, if any.
previewString!Preview of the next document number.
min_dateStringMinimum allowed date for this document type.
max_dateStringMaximum allowed date for this document type.

DocumentSequencePreview

Returns a preview of the next document number for a given document type and date.

Parameters:

ParameterTypeDescription
document_typeString!Document type (e.g., invoice, estimate).
dated_atStringDate for the preview (format: YYYY-MM-DD).

Example Query:

query GetDocumentSequencePreview($document_type: String!, $dated_at: String) {
  DocumentSequencePreview(document_type: $document_type, dated_at: $dated_at)
}

Example Variables:

{
  "document_type": "invoice",
  "dated_at": "2026-01-15"
}
Return TypeDescription
String!Preview of the next document number.

DocumentFinalizationDateConstraints

Returns the minimum and maximum allowed dates for finalizing a document of a given type.

Parameters:

ParameterTypeDescription
document_typeString!Document type (e.g., invoice, estimate).

Example Query:

query GetDocumentFinalizationDateConstraints($document_type: String!) {
  DocumentFinalizationDateConstraints(document_type: $document_type) {
    min_date
    max_date
  }
}

Example Variables:

{
  "document_type": "invoice"
}
FieldTypeDescription
min_dateStringMinimum allowed finalization date.
max_dateStringMaximum allowed finalization date.