Query document numbering sequences and formats.
DocumentNumberingContext
DocumentNumberingContextReturns the effective numbering context for a document type, including whether manual override is allowed, shared sequences, and date constraints.
Parameters:
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"
}| Field | Type | Description |
|---|---|---|
manual_override_allowed_effective | Boolean! | Whether manual number override is currently allowed. |
shared_sequence_with | String | Document type sharing the same sequence, if any. |
preview | String! | Preview of the next document number. |
min_date | String | Minimum allowed date for this document type. |
max_date | String | Maximum allowed date for this document type. |
DocumentSequencePreview
DocumentSequencePreviewReturns a preview of the next document number for a given document type and date.
Parameters:
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 Type | Description |
|---|---|
String! | Preview of the next document number. |
DocumentFinalizationDateConstraints
DocumentFinalizationDateConstraintsReturns the minimum and maximum allowed dates for finalizing a document of a given type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
document_type | String! | 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"
}DocumentSequenceConfigs
DocumentSequenceConfigsReturns the list of document sequence configurations for the company. Requires the company_update permission.
Example Query:
query GetDocumentSequenceConfigs(
$where: QueryDocumentSequenceConfigsWhereWhereConditions,
$orderBy: [QueryDocumentSequenceConfigsOrderByOrderByClause!]
) {
DocumentSequenceConfigs(
where: $where,
orderBy: $orderBy
) {
id
document_type
format_mode
manual_override_allowed
prefix
next_number
padding_length
reset_policy
can_apply_now
}
}Filters: id, document_type, format_mode, manual_override_allowed, reset_policy.
DocumentSequenceConfig type
DocumentSequenceConfig type| Field | Type | Description |
|---|---|---|
id | Int! | Configuration ID. |
company_id | Int! | Company ID. |
document_type | String! | Document type (e.g., invoice, estimate). |
format_mode | String! | Numbering format mode. |
manual_override_allowed | Boolean! | Whether manual override is allowed. |
prefix | String | Number prefix. |
next_number | Int | Next number in the sequence. |
padding_length | Int | Zero-padding length. |
reset_policy | String | Reset policy (e.g., monthly, yearly). |
current_period_key | String | Current period key. |
shared_sequence_with | String | Document type sharing the sequence. |
can_apply_now | Boolean! | Whether pending settings can be applied now. |
pending_settings | JSON | Pending settings to apply. |
pending_activation_period_key | String | Period key for pending activation. |
created_at | DateTime | Creation time. |
updated_at | DateTime | Last update time. |
