Document sequences

Use document sequencing to generate new IDs automatically for common transactions and records, such as new customers, vendors, invoices, and more. For example, you can create a document sequence for invoices. This new sequence automatically creates a new ID, such as 'INV-0100' and increments the number each time a new invoice is created.

Note: Document sequences are called "accounting sequences" in the General Ledger.

List document sequences

get/objects/company-config/document-sequence

Returns up to 100 document sequences from the collection with a key, ID, and link for each sequence. This operation is mostly for use in testing; use the query service to find document sequences that meet certain criteria and to specify the properties that are returned.

SecurityOAuth2
Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": [
    • {
      • "key": "37",
      • "id": "BOA_ACH_BatchNo",
      • "href": "/objects/company-config/document-sequence/37"
      },
    • {
      • "key": "27",
      • "id": "Purchase Order",
      • "href": "/objects/company-config/document-sequence/27"
      }
    ],
  • "ia::meta": {
    • "totalCount": 2,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}

Create a document sequence

post/objects/company-config/document-sequence

Creates a new document sequence.

SecurityOAuth2
Request
Request Body schema: application/json
required

Document sequence to create

id
required
string

Unique name for the document sequence.

Example: "Vendors"
printTitle
string

The sequence name that prints on invoice PDFs.

Example: "Vendors"
type
string
Default: "numeric"

Numeric or alpha sequence. Alpha sequences are currently only available for use with Cash Management, or French companies.

Enum: "alpha" "numeric"
Example: "numeric"
fixedLength
string or null

The total length of the primary sequence, including any padding characters, up to 16 characters. Numeric sequences will be padded with zeroes and alpha sequence will be padded with a's.

Example: "16"
fixedPrefix
string

Characters that appear before the primary sequence.

Example: "INV"
prefixSeparator
string

Characters to use between the prefix and the auto-generated sequence.

Example: "-"
fixedSuffix
string

Characters that appear after the primary sequence.

Example: "COMPANY"
suffixSeparator
string

Characters to use between the auto-generated sequence and the suffix.

Example: "-"
startingNumber
integer or null

Starting number for numeric sequences. Required when type is numeric.

Example: 1
endingNumber
integer or null

Ending number for numeric sequences.

Example: 100
nextNumber
integer or null

Next number. Required when type is numeric.

Example: 1
startingSequence
string or null

Starting sequence value. Required when type is alpha.

Example: "a"
endingSequence
string or null

Ending sequence

Example: "zzz"
nextSequence
string or null

Next sequence. Required when type is alpha.

Example: "a"
whenModified
string <date-time>

Date and time when the document sequence was last modified.

Example: "2024-04-01T11:28:12Z"
object

Fiscal year rollover configuration for the document sequence, which will automatically restart the document sequence for each fiscal year. Use the fiscalYears to configure the next number or alpha values used to generate sequences for the fiscal years. If the configuration for a fiscal year is missing then it will be generated by the system when the first sequence is generated. The next number or alpha values will be taken from the base start values.

isEnabled
boolean
Default: false

Set to true to enable sequence rollover by fiscal years.

Example: false
fiscalYearAffixPosition
string
Default: "none"

Where to insert the fiscal year in document sequence values.

** Valid values **

  • none Do not automatically insert the fiscal year into the document sequence.
  • prefix Use the fiscal year and the rollover `separator`` as a prefix to the document sequence.
  • suffix Append the rollover `separator`` and the fiscal year as a suffix to the document sequence.
Enum: "none" "prefix" "suffix"
Example: "prefix"
separator
string

Rollover separator used when the fiscalYearAffixPosition is set to prefix or suffix

Example: "-"
Array of objects

Array of document-sequence-rollover objects that define the next number or alpha values to use to generate sequences for specific fiscal years.

Array
fiscalYear
integer

Fiscal year during which this rollover configuration is used.

Example: 2024
nextNumber
integer or null

Next number used to generate sequences for the fiscal year when the document-sequence type is numeric. Must be within the limits set by the startingNumber and endingNumber fields in the document-sequence.

Example: 1
nextSequence
string or null

Next sequence used to generate sequences for the fiscal year when the document-sequence type is alpha. Must be within the limits set by the startingSequence and endingSequence fields in the document-sequence.

Example: "a"
status
string
Default: "active"

Object status. Active objects are fully functional. Inactive objects are essentially hidden and cannot be used or referenced.

Enum: "active" "inactive"
Example: "active"
Responses
201

Created

400

Bad Request

Request samples
application/json
{
  • "id": "Vendor Invoice",
  • "printTitle": "Vendor Invoice",
  • "type": "numeric",
  • "fixedPrefix": "P",
  • "fixedSuffix": "S",
  • "prefixSeparator": "-",
  • "suffixSeparator": "-",
  • "startingNumber": 1,
  • "endingNumber": null,
  • "nextNumber": 1,
  • "fixedLength": "4",
  • "rollover": {
    • "isEnabled": true,
    • "fiscalYearAffixPosition": "prefix",
    • "separator": "-",
    • "fiscalYears": [
      • {
        },
      • {
        }
      ]
    }
}
Response samples
application/json
{
  • "ia::result": {
    • "key": "107",
    • "id": "Vendor Invoice",
    • "href": "/objects/company-config/document-sequence/107"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Get a document sequence

get/objects/company-config/document-sequence/{key}

Returns detailed information for a particular document sequence.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for a document sequence.

Example: 107
Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": {
    • "key": "107",
    • "id": "BOA_ACH_BatchNo",
    • "printTitle": "BOA_ACH_BatchNo",
    • "fixedPrefix": "P",
    • "fixedSuffix": "S",
    • "prefixSeparator": "-",
    • "suffixSeparator": "-",
    • "startingNumber": 1,
    • "endingNumber": null,
    • "nextNumber": 1,
    • "whenModified": "2014-01-08T11:28:12Z",
    • "fixedLength": null,
    • "status": "active",
    • "type": "numeric",
    • "startingSequence": null,
    • "endingSequence": null,
    • "nextSequence": null,
    • "entity": {
      • "key": "54",
      • "id": "Western Region",
      • "name": "Western Region",
      • "href": "/objects/company-config/entity/54"
      },
    • "rollover": {
      • "isEnabled": true,
      • "enabledDate": "2024-02-14",
      • "fiscalYearAffixPosition": "prefix",
      • "separator": "-"
      },
    • "audit": {
      • "createdDateTime": "2014-01-08T11:28:12Z",
      • "modifiedDateTime": "2014-01-08T11:28:12Z",
      • "createdBy": "109",
      • "modifiedBy": "109"
      },
    • "fiscalYears": [
      • {
        },
      • {
        }
      ],
    • "href": "/objects/company-config/document-sequence/107"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Update a document sequence

patch/objects/company-config/document-sequence/{key}

Updates an existing document sequence by setting field values. Any fields not provided remain unchanged.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for a document sequence.

Example: 107
Request Body schema: application/json
printTitle
string

The sequence name that prints on invoice PDFs.

Example: "Vendors"
type
string
Default: "numeric"

Numeric or alpha sequence. Alpha sequences are currently only available for use with Cash Management, or French companies.

Enum: "alpha" "numeric"
Example: "numeric"
fixedLength
string or null

The total length of the primary sequence, including any padding characters, up to 16 characters. Numeric sequences will be padded with zeroes and alpha sequence will be padded with a's.

Example: "16"
fixedPrefix
string

Characters that appear before the primary sequence.

Example: "INV"
prefixSeparator
string

Characters to use between the prefix and the auto-generated sequence.

Example: "-"
fixedSuffix
string

Characters that appear after the primary sequence.

Example: "COMPANY"
suffixSeparator
string

Characters to use between the auto-generated sequence and the suffix.

Example: "-"
startingNumber
integer or null

Starting number for numeric sequences. Required when type is numeric.

Example: 1
endingNumber
integer or null

Ending number for numeric sequences.

Example: 100
nextNumber
integer or null

Next number. Required when type is numeric.

Example: 1
startingSequence
string or null

Starting sequence value. Required when type is alpha.

Example: "a"
endingSequence
string or null

Ending sequence

Example: "zzz"
nextSequence
string or null

Next sequence. Required when type is alpha.

Example: "a"
whenModified
string <date-time>

Date and time when the document sequence was last modified.

Example: "2024-04-01T11:28:12Z"
object

Fiscal year rollover configuration for the document sequence, which will automatically restart the document sequence for each fiscal year. Use the fiscalYears to configure the next number or alpha values used to generate sequences for the fiscal years. If the configuration for a fiscal year is missing then it will be generated by the system when the first sequence is generated. The next number or alpha values will be taken from the base start values.

isEnabled
boolean
Default: false

Set to true to enable sequence rollover by fiscal years.

Example: false
fiscalYearAffixPosition
string
Default: "none"

Where to insert the fiscal year in document sequence values.

** Valid values **

  • none Do not automatically insert the fiscal year into the document sequence.
  • prefix Use the fiscal year and the rollover `separator`` as a prefix to the document sequence.
  • suffix Append the rollover `separator`` and the fiscal year as a suffix to the document sequence.
Enum: "none" "prefix" "suffix"
Example: "prefix"
separator
string

Rollover separator used when the fiscalYearAffixPosition is set to prefix or suffix

Example: "-"
Array of objects

Array of document-sequence-rollover objects that define the next number or alpha values to use to generate sequences for specific fiscal years.

Array
fiscalYear
integer

Fiscal year during which this rollover configuration is used.

Example: 2024
nextNumber
integer or null

Next number used to generate sequences for the fiscal year when the document-sequence type is numeric. Must be within the limits set by the startingNumber and endingNumber fields in the document-sequence.

Example: 1
nextSequence
string or null

Next sequence used to generate sequences for the fiscal year when the document-sequence type is alpha. Must be within the limits set by the startingSequence and endingSequence fields in the document-sequence.

Example: "a"
status
string
Default: "active"

Object status. Active objects are fully functional. Inactive objects are essentially hidden and cannot be used or referenced.

Enum: "active" "inactive"
Example: "active"
Responses
200

OK

400

Bad Request

Request samples
application/json
{
  • "prefixSeparator": "-"
}
Response samples
application/json
{
  • "ia::result": {
    • "key": "107",
    • "id": "BOA_ACH_BatchNo",
    • "href": "/objects/company-config/document-sequence/107"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Delete a document sequence

delete/objects/company-config/document-sequence/{key}

Deletes a document sequence.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for a document sequence.

Example: 107
Responses
204

No Content

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": {
    • "ia::error": {
      • "code": "invalidRequest",
      • "message": "A POST request requires a payload",
      • "errorId": "REST-1028",
      • "additionalInfo": {
        },
      • "supportId": "Kxi78%7EZuyXBDEGVHD2UmO1phYXDQAAAAo"
      }
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 0,
    • "totalError": 1
    }
}