Skip to content

examples: add x402 usage-based settlement guide#212

Open
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
ygd58:examples/x402-usage-based-settlement
Open

examples: add x402 usage-based settlement guide#212
ygd58 wants to merge 1 commit intoopen-wallet-standard:mainfrom
ygd58:examples/x402-usage-based-settlement

Conversation

@ygd58
Copy link
Copy Markdown

@ygd58 ygd58 commented Apr 19, 2026

Closes #203

Summary

Adds examples/x402-upto-settlement.md — a practical guide for the upto (usage-based) settlement pattern requested in issue #203.

What is included

  • How upto settlement differs from exact payments (comparison table)
  • Minimal pay() example showing post-settlement output
  • UptoBillingTracker class for tracking authorized / settled / released amounts per request and session totals
  • OWS vs app layer responsibility boundary table — clarifies which parts belong in OWS and which belong in the application
  • Running instructions with faucet link

OWS vs app layer boundary

OWS handles signing and the 402->retry flow. Tracking authorized vs settled amounts, enforcing per-session spending caps, and reconciling with external ledgers belongs in the app layer. This guide makes that boundary explicit.

Closes open-wallet-standard#203

Adds examples/x402-upto-settlement.md covering:
- How upto settlement differs from exact payments
- Minimal pay() example with post-settlement output
- UptoBillingTracker class for authorized/settled/released accounting
- OWS vs app layer responsibility boundary table
- Running instructions
@ygd58 ygd58 requested a review from njdawn as a code owner April 19, 2026 13:37
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 19, 2026

@ygd58 is attempting to deploy a commit to the MoonPay Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add x402 usage-based settlement example and accounting guidance

1 participant