Skip to content
Spendkit
GuidesUse the dashboard
FROM REQUEST TO RESULT

Payment flow

A Spendkit approval is permission for one exact payment. The Agent's linked wallet still sends the transaction, and the Router checks the rules again before moving USDG.

1 · REQUESTAgent → Spendkit server

The Agent proposes an amount, a recipient, and a token such as USDG.

2 · DECISIONSpendkit server → Agent

Preview returns ALLOW or DENY without sending a transaction. Authorization, if allowed, is short-lived and tied to those exact details.

3 · PAYMENTAgent Payment Wallet → Router → Recipient

The wallet submits the exact transaction and pays gas. The Router checks the current Policy, then transfers USDG from that wallet.

4 · RESULTTransaction → Payment Activity

The Agent records the transaction hash. Spendkit reconciles the receipt and shows the resulting status.

If Spendkit says no

The Agent does not receive an authorization for this payment and should stop. A direct wallet transfer made outside Spendkit is outside these Policy checks.

Exact Runtime sequence

  1. Call spendkit_get_connection and spendkit_get_policy to confirm identity, wallet, network, and current limits.
  2. Call spendkit_preview_payment with a decimal-string amount and recipient. A denied preview is read-only.
  3. When the Agent genuinely intends to pay, call spendkit_authorize_payment with a stable idempotencyKey. Check allowed, intentId, authorization.paymentWallet, and the returned transaction.
  4. The bound Payment Wallet submits exactly that Router transaction. The reference local demo asks the user to confirm the displayed amount, recipient, wallet, and chain before submission.
  5. Call spendkit_record_payment({ intentId, txHash }), then spendkit_get_payment_status({ intentId }). A successful authorization or broadcast is not yet a confirmed payment.

When a result is uncertain

Use one idempotency key per logical payment. If the wallet or network does not clearly report whether a transaction was submitted, inspect the existing intent, transaction hash, and payment status before doing anything else. Do not blindly send a second blockchain transaction. A failed or reverted receipt needs investigation before another attempt.

See the MCP tool inputs → Read recovery advice →