{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stabledrop-me/json-schema/stabledrop-me-settle-body-schema.json",
  "title": "SettleBody",
  "description": "The payment contract's terms, plus whatever is funding it.\n\nEverything down to `arbiter` is in the payment contract's CREATE2 salt — these values ARE its address.\nWhich is why they are accepted from the wire without ceremony: alter one and the address\nmoves, and the payer's signed destination no longer matches it.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stabledrop-me-openapi.json#/components/schemas/SettleBody",
  "properties": {
    "seller": {
      "type": "string",
      "title": "Seller",
      "description": "Where the payment contract pays out to: a wallet address, or an email address. An email resolves to the wallet Privy holds for that person — made for them if they have never logged in — and the same email always resolves to the same wallet."
    },
    "token": {
      "type": "string",
      "title": "Token",
      "description": "The ERC-20 the payment contract will hold"
    },
    "amount": {
      "type": "integer",
      "title": "Amount",
      "description": "In the TOKEN's own base units, not fiat minor units. The payer needed this exact figure to derive the payment address before they could sign a destination for it."
    },
    "expiry_timestamp": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expiry Timestamp",
      "description": "Unix timestamp the dispute window closes at. 0 settles instantly with no recourse. Omitted is refused — say which, because the two differ in whether anyone can get their money back."
    },
    "external_id": {
      "type": "string",
      "title": "External Id",
      "description": "Any opaque string that keeps two otherwise-identical payment contracts apart. Use your checkout's hash and you get one-checkout-one-payment for free, verifiable by anyone holding the mandate."
    },
    "eip3009": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Eip3009",
      "description": "The payer's signed EIP-3009 authorization, for us to relay so they need no gas. Omit it if you have already funded the payment address yourself."
    },
    "buyer_claims": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Buyer Claims",
      "description": "UCP Buyer object. Carry stabledrop.nominal_buyer_account to name who may dispute — a CAIP-10 account, or the person's email address; without it the payer holds those rights."
    },
    "creator_fee": {
      "type": "integer",
      "title": "Creator Fee",
      "default": 0
    },
    "arbiter": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Arbiter"
    },
    "description": {
      "type": "string",
      "title": "Description",
      "default": "Protected payment"
    },
    "mandate_chain": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mandate Chain",
      "description": "An AP2 payment mandate chain. Optional, and NEVER verified — it is hashed into the receipt's `reference` so you can tie this settlement to your checkout. Verify it yourself against a key you trust; we make no claim about it."
    },
    "brand_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[a-z0-9-]{2,32}$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Brand Id",
      "description": "The white-label partner this payment was made under (the `?b=` id, e.g. `escrow-me`). Recorded on the contract for attribution. Not a term of the payment contract — it does not change the address — and never used to authorise anything."
    },
    "seller_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Seller Email",
      "description": "Display only: the seller's email, recorded so the payment contract reads on their dashboard like a request made on the site. Not a term. Used automatically when `seller` is itself an email."
    },
    "buyer_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Buyer Email",
      "description": "Display only: the nominal buyer's email. Not a term. Used automatically when `buyer_claims` names the buyer by email."
    },
    "product_name": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 160
        },
        {
          "type": "null"
        }
      ],
      "title": "Product Name",
      "description": "Display only: what is being paid for, as shown on the dashboard. Not a term."
    }
  },
  "type": "object",
  "required": [
    "seller",
    "token",
    "amount",
    "external_id"
  ]
}