Queries and mutations for managing States in the platform.
Queries
Query States
Get State
| Arguments | |
|---|---|
idString | Queries with specified ID |
keyString | Queries with specified key |
Mutations
Create State
Update State
| Arguments | |
|---|---|
versionLong | |
actionsArray of StateUpdateAction | |
idString | Queries with specified ID |
keyString | Queries with specified key |
Delete State
Output types
State
idString | Unique identifier of the State. |
versionLong | Current version of the State. |
keyString | User-defined unique identifier of the State. |
type | Indicates to which resource or object types the State is assigned to. Can beLineItemState, OrderState, PaymentState, ProductState, QuoteRequestState, QuoteState, RecurringOrderState, ReviewState, or StagedQuoteState |
rolesArray of StateRole | Roles the State can fulfill for Reviews and Line Items. Can be Return, or ReviewIncludedInStatistics |
nameString | Name of the State. |
nameAllLocalesArray of LocalizedString | Name of the State. |
descriptionString | Description of the State. |
descriptionAllLocalesArray of LocalizedString | Description of the State. |
builtInBoolean | true for States that are an integral part of the Project. Those States cannot be deleted and their key cannot be changed. |
transitionsRefArray of Reference |
|
transitionsArray of State |
|
initialBoolean | true for an initial State, the first State in a workflow. |
createdAt | Date and time (UTC) the State was initially created. |
lastModifiedAt | Date and time (UTC) the State was last updated. |
createdBy | IDs and references that created the State. |
lastModifiedBy | IDs and references that last modified the State. |
StateQueryResult
StateType
LineItemStateOrderStatePaymentStateProductStateQuoteRequestStateQuoteStateRecurringOrderStateReviewStateStagedQuoteState
StateRole
ReturnReviewIncludedInStatistics
Input types
StateDraft
keyString | User-defined unique identifier for the State. If set to an empty value, an InvalidOperation error is returned.
If the value is used by another State in the Project, a DuplicateField error is returned. |
type | Specify to which resource or object type the State is assigned to. Can beLineItemState, OrderState, PaymentState, ProductState, QuoteRequestState, QuoteState, RecurringOrderState, ReviewState, or StagedQuoteState |
nameArray of LocalizedStringItemInputType | Name of the State. |
descriptionArray of LocalizedStringItemInputType | Description of the State. |
initialBoolean | Set to false if the State is not the first step in a workflow. |
rolesArray of StateRole | If suitable, assign predefined roles the State can fulfill in case the State's Can be type is LineItemState or ReviewState.Return, or ReviewIncludedInStatistics |
transitionsArray of ReferenceInput | Define the list of States of the same
type to which the current State can be transitioned to.
|
StateUpdateAction
addRoles | |
changeInitial | |
changeKey | |
changeType | |
removeRoles | |
setDescription | |
setName | |
setRoles | |
setTransitions |
Update actions
Add Roles
rolesArray of StateRole | Value to append to the array. If the specified roles are already present, an InvalidOperation error is returned.
If a specified role is not applicable to the State's Can be type, an InvalidOperation error is returned.Return, or ReviewIncludedInStatistics |
Change Initial
initialBoolean | Whether to define the State as the initial State in a state machine and make it the first step in a workflow. If the new value is the same as the current value, an InvalidOperation error is returned. |
Change Key
keyString | New value to set. If set to an empty value, an InvalidOperation error is returned.
If the value is used by another State in the Project, a DuplicateField error is returned. |
Change Type
type | Resource or object types the State shall be assigned to. Must not be empty. If the new value is the same as the current value, an InvalidOperation error is returned. Can be LineItemState, OrderState, PaymentState, ProductState, QuoteRequestState, QuoteState, RecurringOrderState, ReviewState, or StagedQuoteState |
Remove Roles
rolesArray of StateRole | Roles to remove from the State. If none of the specified roles are already present, an InvalidOperation error is returned. Can be Return, or ReviewIncludedInStatistics |
Set Description
descriptionArray of LocalizedStringItemInputType | Value to set.
If the new value is the same as the current value, an InvalidOperation error is returned.
Set to an empty object to remove any existing value. |
Set Name
nameArray of LocalizedStringItemInputType | Value to set.
If the new value is the same as the current value, an InvalidOperation error is returned.
Set to an empty object to remove any existing value. |
Set Roles
rolesArray of StateRole | Value to set.
If the new value is the same as the current value, an InvalidOperation error is returned.
If a specified role is not applicable to the State's
type, an InvalidOperation error is returned.Set to an empty array to remove any existing value. Can beReturn, or ReviewIncludedInStatistics |
Set Transitions
transitionsArray of ResourceIdentifierInput | Value to set. If omitted, any existing value is removed. Possible transformations of the current State to other States of the same
type (for example, Initial -> Shipped).
When performing a transitionState update action and transitions is set, the currently referenced State must have a transition to the new State.If
transitions is an empty list, it means the current State is a final State and no further transitions are allowed.
If transitions is not set, the validation is turned off.When performing a
transitionState update action, any other State of the same type can be transitioned to.If the new value is the same as the current value, an InvalidOperation error is returned. |