Skip to navigation

Update Routing Rule

View as Markdown

Update a routing rule, or activate/deactivate it.

An active rule’s logic is frozen: only name and status may change. To change what a live rule does, deactivate it, edit it, and reactivate it — an inactive rule accepts the same edits a draft does, and activation re-checks its routes. A rule can never return to draft.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

rule_idstringRequired
account_idstringRequired

Request

This endpoint expects an object.
namestring or nullOptional<=255 characters
match_modeenum or nullOptional

How a rule combines its conditions.

The spec offers exactly these two and no nesting. Compound logic that neither expresses is written as several rules pointing at the same route — see the spec’s “subscription tenure” example. That keeps the stored shape flat and the builder UI honest about what it can express.

Allowed values:
conditionslist of objects or nullOptional
outcomeenum or nullOptional

What happens when a rule matches.

PRIMARY_ONLY is route-less, like STOP: it names no route. But where STOP blocks the attempt entirely (fraud auto-fail, no processor reached), PRIMARY_ONLY lets the attempt run and charges only the PRIMARY processor the caller would have tried first — no fallback to others. It exists for the default dunning rule (“on a dunning retry, do not fall back across processors”). The short “primary_only” token fits the String(20) outcome column, so no migration. The merchant-facing label is “Stop Processor Fallback”.

Allowed values:
route_idstring or nullOptional
route_distributionlist of objects or nullOptional

Replace the rule’s route split. Send an empty list to clear it (paired with a route_id, that turns a split rule back into a single-route one).

statusenum or nullOptional
Activate or deactivate the rule. Draft is not reachable again.
Allowed values:

Response

Successful Response
idstring
namestring
positioninteger

Evaluation order, 1 = first

match_modeenum

How a rule combines its conditions.

The spec offers exactly these two and no nesting. Compound logic that neither expresses is written as several rules pointing at the same route — see the spec’s “subscription tenure” example. That keeps the stored shape flat and the builder UI honest about what it can express.

Allowed values:
conditionslist of objects
outcomeenum

What happens when a rule matches.

PRIMARY_ONLY is route-less, like STOP: it names no route. But where STOP blocks the attempt entirely (fraud auto-fail, no processor reached), PRIMARY_ONLY lets the attempt run and charges only the PRIMARY processor the caller would have tried first — no fallback to others. It exists for the default dunning rule (“on a dunning retry, do not fall back across processors”). The short “primary_only” token fits the String(20) outcome column, so no migration. The merchant-facing label is “Stop Processor Fallback”.

Allowed values:
statusenum

A rule’s lifecycle.

DRAFT rules are never evaluated — they exist so an operator can build and position a rule before it touches live traffic. The spec’s Flow 2 is explicit that activation is one-way: a rule cannot go back to draft. Only an ACTIVE rule’s logic is frozen, because it is routing live payments; the supported way to change it is deactivate -> edit -> reactivate, and activation re-runs the route checks on the edited rule.

Allowed values:
created_atdatetime
updated_atdatetime
route_idstring or nullOptional

Route ID, when outcome is ‘route_to’ and one route takes all

route_distributionlist of objects or nullOptional

Weighted route split, when outcome is ‘route_to’ and traffic is shared

Errors

422
Unprocessable Entity Error