# Integration flow

One routed payment and a surviving, separately funded refund obligation.

Cleard provider API · 1.4.0 · Base Sepolia test USDC.

## Who performs each action

| Actor | Responsibility |
| --- | --- |
| Provider / direct merchant | Choose risk/funding terms and reviewer, obtain scoped access, create checkout and handle customer support. |
| Merchant wallet | Review and enroll bounded registrar/funding authority before payment. |
| Buyer wallet | Inspect terms, authorize payment and file qualifying claims. No Cleard account. |
| Designated reviewer | Evaluate evidence and sign an exact approved amount. |
| Cleard service and enrolled contract | Verify commitments and decisions, register within authority, route funds, execute separate refunds and reconcile receipts. |

## Route the payment

The buyer calls the enrolled contract’s pay method. Direct-wallet mode forwards the full amount to the merchant immediately. Reserve mode applies the agreed withholding and eligible recovery before paying the remainder. A direct token transfer to the merchant cannot be marked paid through this API. Confirm the chain receipt before fulfilling the purchase.

## Approval and funding stay separate

The buyer files a timely claim and the designated reviewer signs a purchase-bound decision. Refund execution records approved, paid and outstanding amounts separately. Direct-wallet mode collects within the signed mandate and allowance; an unpaid balance requires an explicit retry. Reserve mode uses available backing and agreed recovery from later routed payments. Neither guarantees reimbursement or reverses the original payment.

## Changes, withdrawal and exit

Accepted purchases retain exact beneficiary, asset, chain, contract, policy and deadlines. New policy enrollment is refused while purchases remain open. Reserve withdrawals preserve remaining exposure. Stopping new purchases does not remove accrued protections. Collection authority has a fixed deadline; unpaid debt can remain after it expires.

[Exact routed-checkout contract](https://cleard.ai/docs/routed-checkout.md): Funding fields, deadlines, source bounds and reconciliation.

[Quickstart](https://cleard.ai/docs/quickstart.md): Run the complete browser and SDK flow.
