Create Sequence Policy (POST)

Create a sequence policy to configure a unique, sequential number for posted invoices or credit memos.

A sequence policy ensures unique identification and systematic tracking of financial transactions, supporting regulatory compliance and preventing fraud. You can create a sequence policy for invoices or credit memos only.

Special Access Rules 

You need the Billing Admin permission set to use this API.

Resource 

1/connect/sequences/policy

Resource Example 

1https://{yourInstance}.salesforce.com/services/data/v68.0/connect/sequences/policy

Available Version 

65.0

HTTP Methods 

POST

Request Body for POST 

JSON Example

This example shows a sample request to create a sequence policy.

1{
2  "name": "Sample Sequence Policy",
3  "description": "This is a sample sequence policy.",
4  "effectiveFromDateTime": "2025-08-10",
5  "expirationDateTime": "2025-09-20",
6  "isActive": true,
7  "sequenceMode": "Basic",
8  "targetObject": "Invoice",
9  "dateStampFormat": "Yyyy",
10  "sequenceStartNumber": 1,
11  "incrementNumber": 1,
12  "maximumSequenceNumber": 1000,
13  "minimumSequenceNumberWidth": 2,
14  "filterCriteria": "Custom",
15  "selectionLogic": "selectionLogic",
16  "sequencePattern": "INV-{SequenceValue}-abc",
17  "selectionCondition": [
18    {
19      "filterField": "AppType",
20      "operator": "Equals",
21      "filterValue": "RLM",
22      "conditionNumber": 1
23    },
24    {
25      "filterField": "Status",
26      "operator": "Equals",
27      "filterValue": "Posted",
28      "conditionNumber": 2
29    },
30    {
31      "filterField": "LegalEntity",
32      "operator": "Equals",
33      "filterValue": "US",
34      "conditionNumber": 3
35    }
36  ]
37}

Properties

NameTypeDescriptionRequired or OptionalAvailable Version
dateStamp​FormatStringFormat of the stamp date that’s appended to the sequence number. You can’t edit this property by using the Update Sequence Policy API.Required65.0
descriptionStringAdditional details about the sequence policy.Optional65.0
effectiveFrom​DateTimeStringDate and time when the policy becomes effective. The default value is the current date.Required65.0
expiration​DateTimeStringDate and time when the policy expires.Optional65.0
filter​CriteriaStringCriteria to filter the target objects.Required65.0
increment​NumberIntegerValue by which the sequence number increases until it reaches the maximum number. This value must be greater than or equal to 1. The default value is 1. You can’t edit this property by using the Update Sequence Policy API.Required65.0
isActiveBooleanIndicates whether the policy is active (true) or not (false). The default value is false.Required65.0
maximumSequence​NumberIntegerMaximum number the sequence number can reach.Optional65.0
minimumSequence​NumberWidthIntegerMinimum number of digits a sequence number must have. You can’t edit this property by using the Update Sequence Policy API.Optional65.0
nameStringName of the sequence policy.Required65.0
selection​ConditionSelection Condition Input[]Criteria to determine which sequence policy is applied to a record. This property includes conditions based on any standard or custom fields of the record.Optional65.0
selection​LogicStringLogic that determines the objects that the sequence policy applies to.Optional65.0
sequence​ModeStringSpecifies how sequence numbers are generated. Valid values are Basic—Assigns sequential numbers without gap reconciliation; or Gapless—Assigns sequential numbers with gap reconciliation. The usage of this value ensures that the posted invoices or credit memos don’t have any numbering gaps for audits and compliance. You can’t edit this property by using the Update Sequence Policy API.Required65.0
sequence​PatternStringPattern structure that’s followed for the sequence.Required65.0
sequenceStart​NumberIntegerStarting value of the sequence number, which must be greater than or equal to 0. The default value is 1. You can’t edit this property by using the Update Sequence Policy API.Required65.0
target​ObjectStringObject that the policy is applied to. Valid values are Invoice; or CreditMemo—Available in API version 66.0 and later. You can’t edit this property by using the Update Sequence Policy API.Required65.0
timeZoneStringTime zone that’s applicable for the sequence policy.Optional65.0

Response Body for POST 

Sequence Policy