{
  "openapi": "3.1.0",
  "info": {
    "title": "deposit.now — Open x402 funding rail",
    "version": "3.1.0",
    "description": "Open x402 deposit API: pay amount + 1% USDC on Base; net forwards to target after settlement. Optional public receipts. Complements Coinbase CDP Fund — does not create wallets or replace CDP Fund/Send. HTTP 200 payment_received does not guarantee funds already arrived at target.",
    "x-guidance": "POST /api/deposit with { target, amount, memo? }. Unpaid → 402 for gross = amount + 1%. Paid → payment_received + receiptUrl. Check forwardStatus on the receipt. Docs: https://deposit.now/docs",
    "contact": { "email": "support@deposit.now" }
  },
  "servers": [{ "url": "https://deposit.now" }],
  "paths": {
    "/api/deposit": {
      "post": {
        "operationId": "createDeposit",
        "summary": "Pay via x402 to fund a target wallet (net forward async)",
        "tags": ["Deposits"],
        "x-payment-info": {
          "price": { "mode": "dynamic", "currency": "USD", "description": "amount + 1% platform fee" },
          "protocols": [{ "x402": {} }]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["target", "amount"],
                "properties": {
                  "target": {
                    "type": "string",
                    "description": "EVM address receiving net USDC (you must already control or know this address)",
                    "pattern": "^0x[a-fA-F0-9]{40}$"
                  },
                  "amount": {
                    "type": "string",
                    "description": "Net USDC to forward to target (agent pays this + 1%)",
                    "examples": ["50.00"]
                  },
                  "memo": {
                    "type": "string",
                    "description": "Optional note (max 256 chars)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment accepted. Forwarding is async — inspect receiptUrl / forwardStatus.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "examples": ["payment_received"],
                      "description": "payment_received means x402 payment accepted, not that target already holds net funds"
                    },
                    "forwardStatus": {
                      "type": "string",
                      "examples": ["pending", "settled", "forward_failed"]
                    },
                    "target": { "type": "string" },
                    "depositAmount": { "type": "string" },
                    "fee": { "type": "string" },
                    "feePercent": { "type": "number" },
                    "grossPaid": { "type": "string" },
                    "paymentReceived": { "type": "boolean" },
                    "receiptId": { "type": "string" },
                    "receiptUrl": { "type": "string" }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Pay amount + 1% USDC via x402 exact scheme on Base mainnet."
          },
          "400": {
            "description": "Invalid target or amount."
          },
          "429": {
            "description": "Rate limit exceeded."
          }
        }
      },
      "get": {
        "operationId": "getDepositService",
        "summary": "Service metadata",
        "tags": ["Deposits"],
        "responses": {
          "200": {
            "description": "Service description and links."
          }
        }
      }
    },
    "/api/discovery": {
      "get": {
        "operationId": "getDiscovery",
        "summary": "Machine-readable discovery manifest",
        "tags": ["Discovery"],
        "responses": {
          "200": {
            "description": "Discovery JSON"
          }
        }
      }
    }
  }
}
