{
  "openapi": "3.1.0",
  "info": {
    "title": "Paywall-Base store",
    "version": "1.0.0",
    "description": "A self-custodied storefront: USDC on Base paid straight to the seller's wallet, delivered only after the payment is settled through a keyless facilitator or verified on-chain from a plain transfer."
  },
  "servers": [
    {
      "url": "https://penny-paywall-base.penny-mcamp.workers.dev"
    }
  ],
  "paths": {
    "/buy": {
      "get": {
        "summary": "Paywall-Base v1 — a Cloudflare Worker paywall with verified delivery: serve an x402 v2 402 challenge naming your own Base payTo, verify-then-settle through a keyless facilitator, and deliver the bytes only after settlement. Includes the engine, a Node on-chain verifier (receipt + USDC Transfer log + amount + confirmations), a 402 readiness CLI, and field notes on the x402 discovery gates.",
        "operationId": "buy_kit",
        "parameters": [],
        "x-payment-info": {
          "price": 19,
          "currency": "USDC",
          "offers": [
            {
              "scheme": "exact",
              "network": "eip155:8453",
              "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "amount": "19000000",
              "payTo": "0x8b8543A9566b7C75e5484Ce4385D76879EDA2068",
              "maxTimeoutSeconds": 300
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paywall-Base kit v1 delivered after payment settles or a plain transfer is verified on-chain."
          },
          "402": {
            "description": "Payment required: x402 v2 PaymentRequired body, mirrored in the PAYMENT-REQUIRED header."
          }
        }
      }
    },
    "/verify": {
      "get": {
        "summary": "Verify one Base USDC payment on-chain and get a machine-readable receipt: tx status, the ERC-20 Transfer of USDC to the expected payTo, the paid amount in atomic units, sender, block and confirmation depth. Read-only: no custody, no signing.",
        "operationId": "buy_verify",
        "parameters": [
          {
            "name": "tx",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minAtomic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-payment-info": {
          "price": 0.01,
          "currency": "USDC",
          "offers": [
            {
              "scheme": "exact",
              "network": "eip155:8453",
              "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "amount": "10000",
              "payTo": "0x8b8543A9566b7C75e5484Ce4385D76879EDA2068",
              "maxTimeoutSeconds": 300
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Payment verification (one call) delivered after payment settles or a plain transfer is verified on-chain."
          },
          "402": {
            "description": "Payment required: x402 v2 PaymentRequired body, mirrored in the PAYMENT-REQUIRED header."
          }
        }
      }
    },
    "/claim": {
      "get": {
        "summary": "Verify a plain USDC transfer to the store's payTo on Base and deliver the product it pays for.",
        "operationId": "claim",
        "parameters": [
          {
            "name": "tx",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "product",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "kit",
                "verify"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product delivered."
          },
          "402": {
            "description": "No verified on-chain payment matching this product's price and payTo."
          }
        }
      }
    }
  },
  "x-discovery": {
    "manifest": "/.well-known/x402",
    "bazaar": true,
    "claim": "/claim"
  }
}