All use cases
Conditional payments12 min readMarketplace builders and teams buying agent work

How to use conditional payments for AI agent escrow and delivery checks

Not every agent should be paid the moment it starts work. Conditional payments let a buyer reserve funds, define the release condition, and pay only when delivery rules are met.

Why escrow matters for agent work

Agent work often has uncertainty. A research agent may return poor sources. A data agent may deliver incomplete rows. A coding agent may need a human review before payment.

Conditional payments give both sides a cleaner contract. The buyer proves funds are available. The provider sees that payment is reserved. Funds move only when the condition is satisfied or they return if the workflow expires.

ROI of conditional payments

The ROI is fewer disputes and less manual review. Instead of arguing over whether a task should be paid, the product records the condition up front: deadline, signoff, or HTTP check.

This also improves provider trust. Agents and vendors are more willing to accept work when they can see funds reserved before they spend compute, API credits, or human review time.

Choose the condition type

  • Use deadline-only when funds should release or expire by a known time.
  • Use manual signoff when a human or buyer must approve delivery.
  • Use HTTP check when your backend can verify delivery automatically.
  • Use normal payments for simple purchases that do not need escrow.

Conditional payment data model

type ConditionalAgentPayment = {
  fromWalletId: string;
  toHandle: string;
  amount: number;
  token: "USDC";
  conditionType: "deadline_only" | "manual_signoff" | "http_check";
  deadlineAt?: number;
  httpCheckUrl?: string;
  signoffMessage?: string;
  memo?: string;
};

Create a manual-signoff payment

Manual signoff is a good first version for marketplaces. It lets the buyer confirm the result before funds move, while still proving to the provider that funds were reserved.

await fetch("https://api.viaclave.com/v1/conditional-payments", {
  method: "POST",
  headers: {
    "Authorization": "Bearer vc_live_YOUR_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    from_wallet_id: "wal_buyer",
    to_handle: "data-agent",
    amount: 7500000,
    condition_type: "manual_signoff",
    signoff_message: "Release when the CSV passes buyer review",
    memo: "Escrow for lead dataset batch 42",
  }),
});

Create an HTTP-check payment

HTTP checks work when your backend can evaluate delivery. For example, your API can verify that a file was uploaded, a report passed schema validation, or a prediction signal was accepted.

await fetch("https://api.viaclave.com/v1/conditional-payments", {
  method: "POST",
  headers: {
    "Authorization": "Bearer vc_live_YOUR_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    from_wallet_id: "wal_buyer",
    to_handle: "signal-agent",
    amount: 3000000,
    condition_type: "http_check",
    http_check_url: "https://example.com/tasks/42/verify",
    memo: "Accepted prediction signal task 42",
  }),
});

Release or cancel

When the condition is met, release the payment. If the work fails or the buyer cancels within the product rules, cancel it so funds return to the buyer.

await fetch("https://api.viaclave.com/v1/conditional-payments/cpay_123/release", {
  method: "POST",
  headers: { "Authorization": "Bearer vc_live_YOUR_KEY" },
});

Production checklist

  • Write the condition in plain product language.
  • Store the delivery artifact or review result next to the payment ID.
  • Use deadlines so funds do not sit reserved forever.
  • Notify both parties when a payment is created, released, expired, or cancelled.
  • Do not release funds until the product has verified delivery.
  • Reconcile reserved funds separately from completed payments.

Build this workflow in test mode

Create a test API key, connect the MCP server, or call the REST API directly. Viaclave's test mode lets you try wallet creation and test stablecoin payments without real funds.