Order of evaluation
Triggers are checked in order — first match wins:1
X-Mock-Outcome header
If present and recognised, the header overrides everything else (including
body triggers).
2
external_id prefix
MOCK_REJECT_INTAKE_, MOCK_REJECT_BANK_, MOCK_SLOW_, MOCK_STUCK_, MOCK_OK_.3
amount suffix
.13 and .99 (after rounding to 2dp).4
document_id
The literal value
"00000000000" triggers a compliance-screening reject.5
Default
Happy path:
PENDING → PROCESSING → PAID.external_id prefixes
MOCK_SLOW_ ignores any processing.step_seconds override and uses 30 seconds
per step — useful for demoing a “watch it process” UI.Examples
Amount suffixes
The mock looks at the 2-decimal string form ofamount (so 1000.13 →
.13, but 1000.1300001 also rounds to .13 and triggers).
Document ID trigger
Header overrides
TheX-Mock-Outcome header takes precedence over everything. Combine with
X-Mock-Outcome-At: intake for REJECTED to skip the PROCESSING step.
Unrecognised values are ignored (with a server-side warning log), and the
mock falls back to body triggers.
Example
Reading the trigger off the response
Every mock-triggered terminal outcome carries astatus_detail ending in
"(mock trigger)." — so your tests can assert on the trigger without
hardcoding the message.
Tip: synchronous + magic trigger = great for unit tests
Combineprocessing.step_seconds: 0 with any trigger. The terminal state is
already applied in the create response — no polling, no timer, no flakiness.
status: "REJECTED" and status_code: "301"
on the same line that creates the payout.