Skip to content

Updating an order after a failure

object_failure_update can specify order field updates for supported processing failures. It accepts one rule object or an array of rules. Each rule contains updates and can match an errorCode, errorMessage, errorRegex, or errorKey from the response. Product-side failure updates are not supported; do not use this setting to update products.

For example, this rule is intended to mark an order when a matching failure message is returned:

{
  "object_failure_update": {
    "errorMessage": "temporarily unavailable",
    "updates": {"status": "PENDING"}
  }
}

This is a configuration excerpt. Choose a field and value appropriate for your workflow and confirm the supported order field format before use. Validate and test the rule against representative responses before enabling it. A matching failure update is an order change; it is not a retry and does not prove that the supplier did or did not process a request.

Matching rules

errorCode can be a single code or an array. errorMessage matches text without case sensitivity and can be a list of messages. errorRegex is a delimited regular expression and takes precedence over errorMessage when both are supplied. errorPosition, when present, selects a response substring using start and end positions. errorKey selects a value from a structured response. A nonempty value at errorKey can itself match when no message or regex is specified. If both code and message criteria are present, either can match.

For a regular successful HTTP response, an errorKey is required to inspect the response for an application-level error. A rule with no criteria matches a thrown exception rather than every ordinary response. If an array of rules is supplied, the first matching rule is used. Order update selection also respects order_update_search where configured.

The same response may fail at different stages. A response-processing failure after a supplier has already accepted an order is not treated as a failed send for this setting. Check the supplier's result before retrying an uncertain request, since retrying an accepted order could create a duplicate.