Printago API
POST
/v1/routing-rules/validate
Validate a routing rule
Check a rule without saving it Runs the checks that creating or updating a rule runs: every field exists, each operator suits its field's type, values have the right type and are allowed values, dates can be read, and `whenExpr` reads only the part, SKU, order and order item. A rule that fails them comes back with `valid: false` and the reasons, as a 200.
Request Body
The `whenExpr` and `expr` to check
RoutingRuleValidateRequest
exprrequired
object
allrequired
object[]
anyrequired
object[]
notrequired
object
allrequired
object[]
anyrequired
object[]
cmprequired
enum
in<>contains!=>=<=betweenexists==containsAnycontainsAllisEmptymatches
leftrequired
object
A reference to an attribute on one side of the pairing.
pathrequired
string
Catalog path, e.g. `userTags`, `source`, `custom.batchColor`.
refrequired
"order" | "sku" | "printer" | "part" | "orderItem"
orderskuprinterpartorderItem
rightoptional
object
Left out for the operators that take no value: `exists`, `isEmpty`.
pathrequired
string
Catalog path, e.g. `userTags`, `source`, `custom.batchColor`.
refrequired
"order" | "sku" | "printer" | "part" | "orderItem"
orderskuprinterpartorderItem
constrequired
string | number | boolean | string | number[]
cmprequired
enum
in<>contains!=>=<=betweenexists==containsAnycontainsAllisEmptymatches
leftrequired
object
A reference to an attribute on one side of the pairing.
pathrequired
string
Catalog path, e.g. `userTags`, `source`, `custom.batchColor`.
refrequired
"order" | "sku" | "printer" | "part" | "orderItem"
orderskuprinterpartorderItem
rightoptional
object
Left out for the operators that take no value: `exists`, `isEmpty`.
pathrequired
string
Catalog path, e.g. `userTags`, `source`, `custom.batchColor`.
refrequired
"order" | "sku" | "printer" | "part" | "orderItem"
orderskuprinterpartorderItem
constrequired
string | number | boolean | string | number[]
whenExproptionalnullable
object
allrequired
object[]
anyrequired
object[]
notrequired
object
allrequired
object[]
anyrequired
object[]
cmprequired
enum
in<>contains!=>=<=betweenexists==containsAnycontainsAllisEmptymatches
leftrequired
object
A reference to an attribute on one side of the pairing.
pathrequired
string
Catalog path, e.g. `userTags`, `source`, `custom.batchColor`.
refrequired
"order" | "sku" | "printer" | "part" | "orderItem"
orderskuprinterpartorderItem
rightoptional
object
Left out for the operators that take no value: `exists`, `isEmpty`.
pathrequired
string
Catalog path, e.g. `userTags`, `source`, `custom.batchColor`.
refrequired
"order" | "sku" | "printer" | "part" | "orderItem"
orderskuprinterpartorderItem
constrequired
string | number | boolean | string | number[]
cmprequired
enum
in<>contains!=>=<=betweenexists==containsAnycontainsAllisEmptymatches
leftrequired
object
A reference to an attribute on one side of the pairing.
pathrequired
string
Catalog path, e.g. `userTags`, `source`, `custom.batchColor`.
refrequired
"order" | "sku" | "printer" | "part" | "orderItem"
orderskuprinterpartorderItem
rightoptional
object
Left out for the operators that take no value: `exists`, `isEmpty`.
pathrequired
string
Catalog path, e.g. `userTags`, `source`, `custom.batchColor`.
refrequired
"order" | "sku" | "printer" | "part" | "orderItem"
orderskuprinterpartorderItem
constrequired
string | number | boolean | string | number[]
Example Request
application/json
{
"whenExpr": {
"all": []
},
"expr": {
"all": []
}
}
Response Schema
RoutingRuleValidation
errorsrequired
object[]
fieldrequired
"expr" | "when"
Which half of the rule the error is in.
exprwhen
messagerequired
string
refoptional
string
The field (`entity.path`) the error is about, when there is one.
validrequired
boolean
Example Response
201 OK — application/json
{
"valid": true,
"errors": [
{
"field": "expr",
"message": "string",
"ref": "string"
}
]
}