> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://docs.navalabs.ai/api/mcp` to find what you need.

# Nava Gateway payment lifecycle \[Developer Preview]

:::warning[Developer Preview]
Nava Gateway is a **Developer Preview**. The Nava Guardian payments venue,
checks, and final payment field contract remain incomplete. This lifecycle is
not a production deployment guide.
:::

The preview inserts a policy gate after structural x402 verification and before
merchant settlement.

_The HTML version of this page includes an interactive explorer; the surrounding text covers the same rules._

## Resource-server path

1. The resource gate deterministically quotes an `exact` EIP-3009 USDC payment
   for Base or Base Sepolia.
2. If Guardian applies and verification fees are enabled, it obtains a separate
   fee requirement from the facilitator's `/verification/quote` endpoint.
3. With no `X-PAYMENT` header, the gate returns `402` with the merchant
   requirement and optional verification requirement.
4. The payer signs the merchant authorization and, when quoted, a separate
   verification-fee authorization.
5. The gate calls `/verify`. The facilitator pins the configured network/asset,
   enforces a minimum value when configured, verifies the merchant payment, and
   resolves enrollment from the signed payer wallet and payment chain. In
   `optional` mode an enrolled wallet is gated and an unenrolled wallet uses
   vanilla x402; in `required` mode an unenrolled wallet is invalid. Any lookup
   error fails closed. When Guardian applies, the facilitator validates the fee
   against a fresh authoritative quote and asks Guardian to evaluate the
   merchant payment.
6. On a terminal `approved` or `rejected` verdict, the facilitator settles the
   verification fee when one was required. A timeout/error is not terminal and
   does not settle the fee.
7. On rejection, the facilitator records the rejected decision and the gate
   returns `402`; the merchant payment is not settled.
8. On approval, the facilitator records the exact approved payment. Both
   approved and rejected records freeze the resolved `agentId`, `policyId`, and
   `policyVersion`. `/settle` consumes the applicable record before submitting
   the merchant transfer. Redis uses
   atomic `GETDEL`; the default in-memory implementation does not make its
   read/delete sequence atomic under concurrent calls.
9. After successful merchant settlement, the gate returns `200` and
   `X-PAYMENT-RESPONSE`.

Diagram: Gateway payment lifecycle.

1. Payer and resource: quote and authorize.
2. Facilitator and Guardian: verify and decide.
3. Resource and Base: settle or fail closed. Approved: consume the approval, settle the merchant payment once, and return. Rejected, timeout, or error: do not settle the merchant payment.

The verification fee settles on an independent path after a terminal outcome.

The two payments are independent authorizations. Only the merchant payment is
policy-gated. The fee pays for a completed verification and can therefore settle
after either terminal outcome; the merchant receives funds only after approval.

An owner can remove a wallet or deactivate its policy before a later payment,
changing whether that later payment is enrolled. While the bridge record
remains, `/settle` always enforces it — an approval survives unenrollment and a
rejected payment never becomes claimable. Records last for the lesser of the
authorization's remaining `validBefore` and a one-hour facilitator cap;
authorizations that outlive the cap are rejected at `/verify`.

Because approval consumption precedes merchant broadcast, a settlement failure
or resource-gate `502` requires a new `/verify` before another `/settle`. A
previously settled verification fee may require a fresh fee authorization for
that new verification. Do not blindly retry `/settle`; first reconcile any
uncertain on-chain result, then re-run verification for the exact payment.

## Existing-facilitator path

1. Your verifier validates the x402 payment.
2. `withGuardian` short-circuits an invalid base result.
3. For a valid base result, the facilitator resolves the payer wallet through
   the Integrator API. When Guardian applies, `verifyPayment` maps the payment to
   a preview `PaymentAction` and waits within configured bounds.
4. `withGuardian` reports valid only when the returned verdict outcome is
   `approved`; rejected, timeout, and error results fail closed.
5. Your existing settlement path runs only after that valid response.

This wrapper path does not add fee settlement or an approval store. Those
controls remain the responsibility of the integrating facilitator.

## Outcome handling

Read `verdict.outcome`, not the wording of `humanReason` and not a reason-code
allowlist. Preserve any unknown `reasonCode` for diagnostics. Missing,
`pending`, malformed, timed-out, or error results are not approval.
