Skip to main content
Audience: engineers building payment, transfer, or treasury systems who need a policy gate in front of settlement — amount limits, dual-approval thresholds, sanctions and jurisdiction checks, documentation completeness — and a tamper-evident receipt for every approved or rejected transaction. This recipe is a concrete instance of the synchronous pre-execution and audit patterns in Integration Patterns. It is the canonical “block a transaction and prove it later” flow from Core Concepts, wired end to end.

The scenario

A payment is about to settle. Before it does, your service calls MeshQu at the decision boundary — the moment settlement becomes irreversible — with the transaction context. The policy enforces:
  • Amount limits — over a hard ceiling is DENY; over a dual-approval threshold is REVIEW.
  • Sanctions & jurisdiction — source and destination countries must be present and not high-risk.
  • Documentation — beneficiary details and a transaction reference of sufficient length must be present.
  • Volume controls — daily volume and transaction-count ceilings flag unusual activity.
MeshQu returns the verdict; your payment rail acts on it. Because settlement is high-stakes and audited, you record the decision (not just evaluate it) so there is a durable, replayable receipt.
Mental model: MeshQu does not move money or hold funds. It governs the approval decision and hands you a signed verdict. Your payment system is what releases, queues, or blocks the transfer.
MeshQu is advisory. A DENY does not stop the transfer on its own — your settlement code reads the verdict and declines to release the funds. Treat the verdict as the input to your enforcement, never as enforcement itself.

Decision boundary

Your payment service owns SETTLE, DUAL, and BLOCK. MeshQu owns the MeshQu evaluates box and the replay proof.

Gate and record the transaction

Use record for settlement decisions — it evaluates and persists a signed receipt with an idempotency key, which is exactly what a compliance-critical path needs. (Use the stateless evaluate only for dry-run testing or non-settling previews.)
Binding action: { type: "payment_execute", reference_id: "INV-88423" } ties the receipt to the specific payment it authorized — the action type and reference_id are bound into the integrity hash, so the receipt proves this approval was for this transfer. See Integrity & Hashing.
Pass action at the top level of the record request body, as the cURL tab shows. The early-access TypeScript client does not yet forward action, so use the REST API directly when you need action binding — another reason the REST API is the primary integration surface.

Dual approval on REVIEW

A transaction over the dual-approval threshold returns REVIEW. Hold it, collect a second approver, then record what happened as a decision outcome — naming the human who approved it:
The verdict (REVIEW) and the human resolution (accepted, who, why) are now both on the record. One outcome per decision; it is immutable once written.

Prove it later

Months on, an auditor can pull any approval and replay it against the exact policy snapshot that governed it — no access to your application or database required:
replay re-evaluates the original context against the pinned snapshot and returns matches: true when the integrity hashes agree — proving the verdict was not altered. List approvals with GET /v1/decisions?decision_type=transaction_approval&decision=DENY for a clean denials report.

Operational notes

  • Idempotency is mandatory on settlement — a retried record with the same idempotency_key returns the original receipt (is_new: false), never a duplicate approval. Key it on the transaction reference. See Idempotency.
  • Tighten a limit safely — lowering a threshold or adding a jurisdiction can wrongly block real payments on day one. Introduce it in shadow_mode so its DENY is surfaced as ALERT while you watch real traffic, then promote. See Shadow Mode.
  • Page on blocked transactions — subscribe a webhook filtered to transaction_approval at severity_min: critical so compliance is notified the moment a sanctioned-jurisdiction or over-limit transfer is denied.
  • Fail-closed — for settlement, default to blocking when MeshQu is unreachable. See fail-open vs fail-closed.

Concept references