saveTransitionValidation
Saves a transition validation rule that governs how a fulfillment moves between states.
A rule belongs to a fulfillment profile. It is created when no id is given and
updated when an existing id is provided.
Expression Format
The expression follows the format:
{
"version": 1,
"base_schema": "Orders::V2::TransitionValidations::Types::OrderFulfillmentContext",
"rules": {
"key": "order.financial_status",
"predicate": "eql?",
"value": "paid"
}
}
Rules can be composed using AND/OR logic:
{
"and": [
{ "key": "order.financial_status", "predicate": "eql?", "value": "paid" },
{ "key": "order.total_price", "predicate": "gt?", "value": 0 }
]
}
Business Rules
- The fulfillment profile must exist and belong to the target company.
scopeisorder_fulfillmentororder; states must be valid fulfillment states.
Error Scenarios
- **
NOT_FOUND**: when the fulfillment profile does not exist. - **
BAD_REQUEST**: when the profile belongs to a different company, or the scope, states, or expression are invalid.
Permissions Required
orders:save_transition_validationpermission
saveTransitionValidation(
input: SaveTransitionValidationInput!
): TransitionValidation
Arguments
saveTransitionValidation.input ● SaveTransitionValidationInput! non-null input common
Parameters for SaveTransitionValidation
Type
TransitionValidation object orders
Transition Validation
Represents a validation rule for order fulfillment state transitions. These rules define conditions that must be met (or automatically trigger transitions) when transitioning between fulfillment states (e.g., ready -> in_progress).