{
  "openapi": "3.1.0",
  "info": {
    "title": "Loyal Spark — Onchain Loyalty Protocol on Base",
    "version": "2.2.0",
    "summary": "AI-agent-native loyalty-as-a-service protocol on Base L2 with paid x402 + MPP corridors.",
    "description": "Loyal Spark is an onchain loyalty-as-a-service protocol on Base L2. AI agents and merchants can create B20 loyalty programs (legacy ERC-20 optional), mint tokens to customer wallets, manage reward catalogs, trade tokens on a P2P escrow marketplace, redeem rewards for vouchers, and run analytics — all via paid x402 endpoints (USDC on Base) or via standard REST with x-api-key. Coverage: 89 paid operations across 83 paths (x402 corridor). Direct MCP exposes 43 merchant + 20 recipient tools (get_platform_info answers without a key or a payment); paid x402 MCP prices 32 merchant + 16 recipient tools (confirm_mint_fee is lsk_-only settlement, not x402-priced). Builder Code bc_wdmnog7m. Paying $0.01 USDC at POST /x402-gateway/register-agent (when the wallet has no Merchant Store Plan or Paid Agent Plan) issues a full lsk_ key on the Free plan (1 agent, 200 API calls/month, 1,000 mint tokens/month, 1.25% mint fee, all 5 scopes: read, create_program, mint, trade, manage_rewards). A Shopify Store Plan (Starter $39: 1 agent, 1,000 calls/mo, read only; Growth $79 or 45-day store trial: 3 agents, 10,000 calls/mo, read, mint, manage_rewards; Scale $149: 10 agents, 100,000 calls/mo, all 5 scopes) or Paid Agent Plan (Pro $49: 5 agents, 10,000 calls/mo, unlimited mint, 0.5% fee; Enterprise $129: unlimited, 0.25% fee) sets the wallet's call and scope ceiling. Mint fee is loyalty tokens: 1.25% Free, 0.5% Pro, 0.25% Enterprise. Keyed REST and MCP calls are scoped by Postgres row-level security to the owner wallet behind the lsk_/rwk_ key. On x402 and MPP, every recipient-api route, the merchant GET reads (programs, rewards, balance, customers, vouchers, analytics, merchant-profile, workflow/program-status), the merchant read MCP tools (list_loyalty_programs, list_rewards, get_token_balance, get_program_analytics, export_customers, and similar) and the holder MCP tools accept the payment alone: the paying wallet is the caller (holder on recipient routes, merchant owner on merchant reads). Other routes (mint, create program, create rewards, trade, bazaar tools) need a live lsk_ (merchant) or rwk_ (holder) key on the same request as the payment; a payment without that live key is not charged. Every keyed call and merchant read enforces the wallet's plan rate and monthly call limits. These routes accept the payment alone; do not send an API key: GET /offers and GET /recipient-api/offers on both gateways, GET /public-programs ($0.001, active programs, same price as GET /programs), POST /x402-gateway/register-agent ($0.01 USDC on Base; when the wallet has no Merchant Store Plan or Paid Agent Plan, issues a full lsk_ key on the Free plan — 1 agent, 200 API calls/month, 1,000 mint tokens/month, 1.25% mint fee, all 5 scopes: read, create_program, mint, trade, manage_rewards; when the wallet belongs to a Merchant Store Plan — Starter $39: 1 agent, 1,000 calls/mo, read only; Growth $79 or 45-day store trial: 3 agents, 10,000 calls/mo, read, mint, manage_rewards; Scale $149: 10 agents, 100,000 calls/mo, all 5 scopes — or a Paid Agent Plan — Pro $49: 5 agents, 10,000 calls/mo, unlimited mint, 0.5% fee; Enterprise $129: unlimited agents/calls/mint, 0.25% fee — the lsk_ key operates strictly within that plan's call and scope limits; unpaid SIWE registration without a plan returns HTTP 402 error_code payment_required and next_action pay_x402), POST /x402-gateway/mcp-tools/get_platform_info, POST /x402-gateway/mcp-tools/list_marketplace_offers, and POST /x402-gateway/recipient-mcp-tools/list_p2p_offers. 16 agent skill guides (00-15): https://loyalspark.online/.well-known/skills/index.md",
    "x-guidance": "Loyal Spark on Base L2 (chain 8453, USDC native).\n\nAuth modes:\n• Merchant agents — header x-api-key: lsk_... (or Authorization: Bearer lsk_...). Look first: GET https://api.loyalspark.online/x402-gateway/public-programs ($0.001, active programs, not your own list). Autonomous onboarding: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, no API key; when the wallet has no Merchant Store Plan or Paid Agent Plan, issues a full lsk_ key on the Free plan — 1 agent, 200 API calls/month, 1,000 mint tokens/month, 1.25% mint fee, all 5 scopes: read, create_program, mint, trade, manage_rewards; when the wallet belongs to a Shopify Store Plan — Starter $39: 1 agent, 1,000 calls/month, read only; Growth $79 or 45-day store trial: 3 agents, 10,000 calls/month, read, mint, manage_rewards; Scale $149: 10 agents, 100,000 calls/month, all 5 scopes, 300 rpm — or a Paid Agent Plan — Pro $49: 5 agents, 10,000 calls/month, unlimited mint, 0.5% fee; Enterprise $129: unlimited agents/calls/mint, 0.25% fee — the lsk_ key operates strictly within that plan's call and scope limits). Dashboard / SIWE registration: https://loyalspark.online/merchant → AI Agents, or POST https://api.loyalspark.online/agent-register-siwe once the wallet has a Store Plan, Paid Agent Plan, or registered agent.\n• Holder agents — header x-api-key: rwk_... (or Authorization: Bearer rwk_...). Issued via SIWE: https://loyalspark.online/.well-known/agent.json (200 calls/month Free quota or per-call x402).\n• x402 corridor — pay USDC on Base per call. Discovery (application/json): https://api.loyalspark.online/.well-known/x402. Marketing mirror (application/json): https://loyalspark.online/.well-known/x402.json. The extensionless https://loyalspark.online/.well-known/x402 is the same document but that host serves it as application/octet-stream; use the .json mirror or the API origin. Look first with no key: GET https://api.loyalspark.online/x402-gateway/public-programs ($0.001).\n\nDirect REST (this document, not only the paid gateway): every /agent-api and /recipient-api route, including free ones. Typical merchant flow (B20 default):\n1. GET /me — profile and scopes\n2. POST /programs — B20 createB20 calldata\n3. POST /register-program — persist program (status active)\n4. POST /update-program-config — set cashback_rate / points_per_dollar\n5. POST /rewards — catalog\n6. POST /mint or POST /earn — fee-first calls[] + fee_obligation_id\n7. POST /mint/confirm — settle protocol fee on-chain\n8. GET /analytics — metrics\n\nLegacy ERC-20: add POST /activate-program + program-status after register.\n\nDirect MCP: 43 merchant tools at https://api.loyalspark.online/loyalty-mcp and 20 recipient tools at https://api.loyalspark.online/recipient-loyalty-mcp. Paid x402 MCP paths: /x402-gateway/mcp-tools/<name> (32) and /x402-gateway/recipient-mcp-tools/<name> (16).\n\nDocs: https://loyalspark.online/api-docs · llms: https://loyalspark.online/llms.txt · agent manifest: https://loyalspark.online/.well-known/agent.json\n\nPlan limits: Free plan (issued via $0.01 POST /x402-gateway/register-agent when the wallet has no Store Plan or Paid Agent Plan): 1 agent, 200 API calls/month, 1,000 mint tokens/month, 1.25% mint fee, all 5 scopes (read, create_program, mint, trade, manage_rewards). Shopify Store Plans set the merchant's ceiling (an agent plan does not raise a store ceiling): Starter ($39/mo) 1 agent, 1,000 calls/month, read only; Growth ($79/mo and 45-day store trial) 3 agents, 10,000 calls/month, read, mint, manage_rewards; Scale ($149/mo) 10 agents, 100,000 calls/month, all 5 scopes, 300 rpm. Paid Agent Plans: Pro ($49/mo) 5 agents, 10,000 calls/month, unlimited mint, 0.5% mint fee; Enterprise ($129/mo) unlimited agents, calls, and mint, 0.25% mint fee. Mint fee is charged in loyalty tokens: 1.25% Free, 0.5% Pro, 0.25% Enterprise.\n\nAccess control: Keyed REST and MCP calls are scoped by Postgres row-level security to the owner wallet behind the lsk_/rwk_ key. On x402 and MPP, every recipient-api route, the merchant GET reads (programs, rewards, balance, customers, vouchers, analytics, merchant-profile, workflow/program-status), the merchant read MCP tools (list_loyalty_programs, list_rewards, get_token_balance, get_program_analytics, export_customers, and similar) and the holder MCP tools accept the payment alone: the paying wallet is the caller (holder on recipient routes, merchant owner on merchant reads). Other routes (mint, create program, create rewards, trade, bazaar tools) need a live lsk_ (merchant) or rwk_ (holder) key on the same request as the payment; a payment without that live key is not charged. Every keyed call and merchant read enforces the wallet's plan rate and monthly call limits. These routes accept the payment alone; do not send an API key: GET /offers and GET /recipient-api/offers on both gateways, GET /public-programs ($0.001, active programs, same price as GET /programs), POST /x402-gateway/register-agent ($0.01 USDC on Base; when the wallet has no Merchant Store Plan or Paid Agent Plan, issues a full lsk_ key on the Free plan — 1 agent, 200 API calls/month, 1,000 mint tokens/month, 1.25% mint fee, all 5 scopes: read, create_program, mint, trade, manage_rewards; when the wallet belongs to a Merchant Store Plan — Starter $39: 1 agent, 1,000 calls/mo, read only; Growth $79 or 45-day store trial: 3 agents, 10,000 calls/mo, read, mint, manage_rewards; Scale $149: 10 agents, 100,000 calls/mo, all 5 scopes — or a Paid Agent Plan — Pro $49: 5 agents, 10,000 calls/mo, unlimited mint, 0.5% fee; Enterprise $129: unlimited agents/calls/mint, 0.25% fee — the lsk_ key operates strictly within that plan's call and scope limits; unpaid SIWE registration without a plan returns HTTP 402 error_code payment_required and next_action pay_x402), POST /x402-gateway/mcp-tools/get_platform_info, POST /x402-gateway/mcp-tools/list_marketplace_offers, and POST /x402-gateway/recipient-mcp-tools/list_p2p_offers.\n\nSkills: 16 agent skill guides (00-15): https://loyalspark.online/.well-known/skills/index.md",
    "contact": {
      "name": "Loyal Spark",
      "email": "admin@loyalspark.online",
      "url": "https://loyalspark.online"
    },
    "license": {
      "name": "MIT",
      "url": "https://loyalspark.online"
    },
    "x-logo": {
      "url": "https://loyalspark.online/new-favicon.png",
      "altText": "Loyal Spark"
    },
    "x-provider": "Loyal Spark",
    "x-brand": "Loyal Spark",
    "x-builder-code": "bc_wdmnog7m",
    "x-mcp": {
      "url": "https://api.loyalspark.online/loyalty-mcp",
      "transport": "streamable-http",
      "tool_count": 43
    },
    "x-recipient-mcp": {
      "url": "https://api.loyalspark.online/recipient-loyalty-mcp",
      "transport": "streamable-http",
      "tool_count": 20
    },
    "x-x402-discovery": {
      "wellKnownResources": "https://api.loyalspark.online/.well-known/x402",
      "gatewayBaseUrl": "https://api.loyalspark.online/x402-gateway",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "network": "eip155:8453"
    },
    "x-skills": {
      "url": "https://loyalspark.online/.well-known/skills/index.md",
      "guide_count": 16,
      "range": "00-15"
    },
    "x-plan-limits": {
      "free": {
        "api_calls_monthly": 200,
        "max_mint_amount_monthly": 1000,
        "max_agents": 1,
        "transaction_fee_percent": 1.25,
        "scopes": [
          "read",
          "create_program",
          "mint",
          "trade",
          "manage_rewards"
        ]
      },
      "starter_store": {
        "api_calls_monthly": 1000,
        "max_agents": 1,
        "scopes": [
          "read"
        ]
      },
      "growth_store": {
        "api_calls_monthly": 10000,
        "max_agents": 3,
        "scopes": [
          "read",
          "mint",
          "manage_rewards"
        ]
      },
      "scale_store": {
        "api_calls_monthly": 100000,
        "max_agents": 10,
        "scopes": [
          "read",
          "create_program",
          "mint",
          "trade",
          "manage_rewards"
        ]
      },
      "pro": {
        "api_calls_monthly": 10000,
        "max_mint_amount_monthly": null,
        "max_agents": 5,
        "transaction_fee_percent": 0.5
      },
      "enterprise": {
        "api_calls_monthly": null,
        "max_mint_amount_monthly": null,
        "max_agents": null,
        "transaction_fee_percent": 0.25
      },
      "note": "Paying $0.01 at POST /x402-gateway/register-agent (when the wallet has no Store Plan or Paid Agent Plan) issues a full lsk_ key on the Free plan (1 agent, 200 calls/month, 1,000 mint tokens/month, 1.25% mint fee, all 5 scopes). A Shopify Store Plan caps that merchant: Starter 1 agent and 1,000 calls/month read only, Growth (and 45-day store trial) 3 agents and 10,000 calls/month read, mint, manage_rewards, Scale 10 agents and 100,000 calls/month all 5 scopes and 300 rpm. Paid Agent Plans: Pro ($49/mo, 5 agents, 10,000 calls/mo, unlimited mint, 0.5% fee) and Enterprise ($129/mo, unlimited agents/calls/mint, 0.25% fee)."
    },
    "x-access-control": {
      "model": "row-level-security",
      "description": "Keyed REST and MCP calls are scoped by Postgres row-level security to the owner wallet behind the lsk_/rwk_ key. On x402 and MPP, every recipient-api route, the merchant GET reads (programs, rewards, balance, customers, vouchers, analytics, merchant-profile, workflow/program-status), the merchant read MCP tools (list_loyalty_programs, list_rewards, get_token_balance, get_program_analytics, export_customers, and similar) and the holder MCP tools accept the payment alone: the paying wallet is the caller (holder on recipient routes, merchant owner on merchant reads). Other routes (mint, create program, create rewards, trade, bazaar tools) need a live lsk_ (merchant) or rwk_ (holder) key on the same request as the payment; a payment without that live key is not charged. Every keyed call and merchant read enforces the wallet's plan rate and monthly call limits. These routes accept the payment alone; do not send an API key: GET /offers and GET /recipient-api/offers on both gateways, GET /public-programs ($0.001, active programs, same price as GET /programs), POST /x402-gateway/register-agent ($0.01 USDC on Base; when the wallet has no Merchant Store Plan or Paid Agent Plan, issues a full lsk_ key on the Free plan — 1 agent, 200 API calls/month, 1,000 mint tokens/month, 1.25% mint fee, all 5 scopes: read, create_program, mint, trade, manage_rewards; when the wallet belongs to a Merchant Store Plan — Starter $39: 1 agent, 1,000 calls/mo, read only; Growth $79 or 45-day store trial: 3 agents, 10,000 calls/mo, read, mint, manage_rewards; Scale $149: 10 agents, 100,000 calls/mo, all 5 scopes — or a Paid Agent Plan — Pro $49: 5 agents, 10,000 calls/mo, unlimited mint, 0.5% fee; Enterprise $129: unlimited agents/calls/mint, 0.25% fee — the lsk_ key operates strictly within that plan's call and scope limits; unpaid SIWE registration without a plan returns HTTP 402 error_code payment_required and next_action pay_x402), POST /x402-gateway/mcp-tools/get_platform_info, POST /x402-gateway/mcp-tools/list_marketplace_offers, and POST /x402-gateway/recipient-mcp-tools/list_p2p_offers."
    }
  },
  "servers": [
    {
      "url": "https://api.loyalspark.online",
      "description": "Loyal Spark — canonical API origin for x402scan discovery and paid resource invocation. All listed x402 gateway paths return live HTTP 402 payment requirements."
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Agent API key (lsk_... merchant or rwk_... recipient)"
      },
      "siwx": {
        "type": "apiKey",
        "in": "header",
        "name": "SIGN-IN-WITH-X",
        "description": "SIWE proof (identity-only routes)"
      }
    }
  },
  "tags": [
    {
      "name": "Identity",
      "description": "Public SIWE nonce and merchant agent registration (no API key)"
    },
    {
      "name": "Merchant REST",
      "description": "Authenticated merchant REST API (lsk_)"
    },
    {
      "name": "Recipient REST",
      "description": "Holder REST API (rwk_)"
    },
    {
      "name": "Merchant MCP",
      "description": "32 paid merchant MCP tools via x402 (direct loyalty-mcp exposes 43 with x-api-key)"
    },
    {
      "name": "Recipient MCP",
      "description": "16 paid recipient MCP tools via x402 (direct recipient-loyalty-mcp exposes 20 with x-api-key)"
    }
  ],
  "paths": {
    "/x402-gateway/programs": {
      "get": {
        "operationId": "get_programs",
        "summary": "List loyalty programs",
        "description": "Lists all loyalty programs owned by the authenticated merchant agent (active + expired).",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "programs"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "programs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [],
        "x-example-input": {
          "kind": "query",
          "value": {}
        },
        "x-api-key-required": false
      },
      "post": {
        "operationId": "post_programs",
        "summary": "Get calldata to deploy a loyalty token",
        "description": "Default: B20 factory calldata (createB20 on 0xB20f…, one tx, active after register). Legacy: set token_standard erc20 for LoyaltyTokenFactory 0x5F3DdB… + activation. Agent broadcasts with its wallet (or /agent-wallet), then POST /register-program. The response keeps contract_call and adds tx {to, data, value: 0x0, chainId: 8453}. deploy_validity.unsigned_tx_expires_at is null: salt includes Date.now(), so each prepare is a new token address and the unsigned payload does not expire. program_expires_at is the loyalty program lifetime applied at register.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "contract_call": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "token_address": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "name",
            "symbol"
          ],
          "additionalProperties": true,
          "properties": {
            "name": {
              "type": "string",
              "maxLength": 50,
              "description": "Loyalty program name."
            },
            "symbol": {
              "type": "string",
              "minLength": 2,
              "maxLength": 5,
              "description": "Token symbol (2-5 chars)."
            },
            "expiration_days": {
              "type": "number",
              "minimum": 1,
              "description": "Program lifetime in days (default 365)."
            },
            "token_standard": {
              "type": "string",
              "enum": [
                "b20",
                "erc20"
              ],
              "default": "b20",
              "description": "b20 (default): Base-native B20, single tx. erc20: legacy factory, needs activate-program."
            },
            "agent_wallet_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "(B20) Extra wallet granted MINT_ROLE in the deploy tx."
            },
            "extra_minters": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "EVM address on Base (eip155:8453)."
              },
              "description": "(B20) More addresses granted MINT_ROLE in the same deploy tx."
            },
            "use_agent_wallet": {
              "type": "boolean",
              "description": "Deploy as the agent's CDP MPC wallet instead of the owner address."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "symbol"
                ],
                "additionalProperties": true,
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 50,
                    "description": "Loyalty program name."
                  },
                  "symbol": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 5,
                    "description": "Token symbol (2-5 chars)."
                  },
                  "expiration_days": {
                    "type": "number",
                    "minimum": 1,
                    "description": "Program lifetime in days (default 365)."
                  },
                  "token_standard": {
                    "type": "string",
                    "enum": [
                      "b20",
                      "erc20"
                    ],
                    "default": "b20",
                    "description": "b20 (default): Base-native B20, single tx. erc20: legacy factory, needs activate-program."
                  },
                  "agent_wallet_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "(B20) Extra wallet granted MINT_ROLE in the deploy tx."
                  },
                  "extra_minters": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^0x[a-fA-F0-9]{40}$",
                      "description": "EVM address on Base (eip155:8453)."
                    },
                    "description": "(B20) More addresses granted MINT_ROLE in the same deploy tx."
                  },
                  "use_agent_wallet": {
                    "type": "boolean",
                    "description": "Deploy as the agent's CDP MPC wallet instead of the owner address."
                  }
                }
              },
              "example": {
                "name": "Demo Cafe Rewards",
                "symbol": "CAFE"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "name": "Demo Cafe Rewards",
            "symbol": "CAFE"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/rewards": {
      "get": {
        "operationId": "get_rewards",
        "summary": "List rewards for a program",
        "description": "Returns the reward catalog for a given loyalty token (token_address required as query).",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rewards"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "rewards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            },
            "all": {
              "type": "string",
              "enum": [
                "true"
              ],
              "description": "Send all=true instead of token_address to list the rewards of every program you own."
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "token_address"
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input.",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          },
          {
            "name": "all",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Send all=true instead of token_address to list the rewards of every program you own."
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      },
      "post": {
        "operationId": "post_rewards",
        "summary": "Create a redeemable reward",
        "description": "Creates a reward in the merchant catalog (name, description, cost in points, optional stock and validity).",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "reward": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: invalid_amount: a present amount is 0, negative or not a number (field, min_exclusive:0). Send a positive number.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "name",
            "cost",
            "token_address"
          ],
          "additionalProperties": true,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "cost": {
              "type": "number",
              "minimum": 1,
              "description": "Loyalty-token cost to redeem."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "cost",
                  "token_address"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "cost": {
                    "type": "number",
                    "minimum": 1,
                    "description": "Loyalty-token cost to redeem."
                  }
                }
              },
              "example": {
                "name": "Demo Cafe Rewards",
                "cost": 100,
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "name": "Demo Cafe Rewards",
            "cost": 100,
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/balance": {
      "get": {
        "operationId": "get_balance",
        "summary": "Get on-chain token balance, off-chain ledger, virtual pending points, and tier",
        "description": "current_balance / current is the live on-chain balanceOf on Base. onchain_balance repeats it (null if the chain read failed, then current_balance falls back to the ledger and balance_basis is offchain_ledger). offchain_ledger_balance is customer_tier_status, written when POST /mint/confirm verifies the recipient Transfer or a CDP server mint settles, so it can lag the chain. Also returns tokens_earned_total, tier, and unminted virtual points from store_points_ledger. Query customer_address (0x Base wallet or customer email), or the aliases customer_email, recipient_email, email, address, and wallet_address. If the customer email has not signed in to create a Base wallet yet, returns status virtual_pending_signup and virtual_pending_balance. For an email lookup the wallet is shown in full when the customer already has a record with your programs, otherwise masked (customer_wallet_masked). A missing query param is HTTP 400 missing_fields with example and next_action.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "balance"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "balance": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "current_balance": {
                          "type": "number"
                        },
                        "current": {
                          "type": "number"
                        },
                        "onchain_balance": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "offchain_ledger_balance": {
                          "type": "number"
                        },
                        "balance_basis": {
                          "type": "string"
                        },
                        "tokens_earned_total": {
                          "type": "number"
                        },
                        "total_earned": {
                          "type": "number"
                        },
                        "virtual_pending_balance": {
                          "type": "number"
                        },
                        "tier": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true
                        },
                        "token_address": {
                          "type": "string"
                        },
                        "customer_address": {
                          "type": "string"
                        }
                      }
                    },
                    "balance_source": {
                      "type": "string"
                    },
                    "balance_source_note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            },
            "customer_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "token_address",
                "customer_address"
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input.",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          },
          {
            "name": "customer_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453).",
            "example": "0x0000000000000000000000000000000000000002"
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "customer_address": "0x0000000000000000000000000000000000000002"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/customers": {
      "get": {
        "operationId": "get_customers",
        "summary": "List customers for a program",
        "description": "Union of voucher holders, customer_tier_status rows, and completed mint recipients for the token. The platform fee wallet is excluded. total / total_customers is the same count analytics and MCP export_customers report; email-only store customers are listed separately in store_customers. Wallets are shown in full (these are your customers). Owner only: token_address must be a program your wallet (key owner or keyless x402 payer) owns; otherwise 404 program_not_found and nothing is charged.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "customers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "total": {
                      "type": "number"
                    },
                    "total_customers": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "token_address"
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input.",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/vouchers": {
      "get": {
        "operationId": "get_vouchers",
        "summary": "List vouchers issued by the merchant",
        "description": "Returns vouchers issued by the authenticated merchant; filterable by customer_address.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "vouchers"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "vouchers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "status": {
              "type": "string",
              "enum": [
                "active",
                "used",
                "expired",
                "cancelled"
              ]
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453).",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "used",
                "expired",
                "cancelled"
              ]
            }
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/analytics": {
      "get": {
        "operationId": "get_analytics",
        "summary": "Program analytics",
        "description": "One row per program you own: total_customers (the same set GET /customers counts), voucher_customers, active customers (30d/7d), vouchers issued and redeemed, tokens spent. Optional query token_address narrows to one program; a program you do not own returns 404 program_not_found and nothing is charged.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "analytics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "Optional: one of your programs. A program you do not own returns 404 program_not_found (not charged)."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "Optional: one of your programs. A program you do not own returns 404 program_not_found (not charged).",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/offers": {
      "get": {
        "operationId": "get_offers",
        "summary": "List P2P marketplace offers",
        "description": "Returns active P2P swap offers across loyalty tokens (filterable by token_address). Payment alone gives access; do not send an API key.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "offers"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "security": [],
        "x-auth": {
          "type": "none",
          "note": "Payment alone gives access; do not send an API key."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453).",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      },
      "post": {
        "operationId": "post_offers",
        "summary": "Create a P2P swap offer",
        "description": "Creates a P2P swap offer between two loyalty tokens (offer_token / offer_amount ↔ request_token / request_amount).",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_amount: a present amount is 0, negative or not a number (field, min_exclusive:0). Send a positive number. insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "offer_token_address",
            "offer_amount",
            "request_token_address",
            "request_amount"
          ],
          "additionalProperties": true,
          "properties": {
            "offer_token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "offer_amount": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "request_token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "request_amount": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer_token_address",
                  "offer_amount",
                  "request_token_address",
                  "request_amount"
                ],
                "additionalProperties": true,
                "properties": {
                  "offer_token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "offer_amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "request_token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "request_amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                }
              },
              "example": {
                "offer_token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                "offer_amount": 10,
                "request_token_address": "0xb2000000000000000000002a96dcb4274f5493fe",
                "request_amount": 10
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "offer_token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "offer_amount": 10,
            "request_token_address": "0xb2000000000000000000002a96dcb4274f5493fe",
            "request_amount": 10
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/public-programs": {
      "get": {
        "operationId": "get_public_programs",
        "summary": "List active public loyalty programs",
        "description": "Payment alone gives access; do not send an API key. Returns active programs (name, symbol, token address, standard, cashback, points per dollar). Same price as GET /programs. This is not the caller's own program list. Your programs need an lsk_ key on GET /programs.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "programs"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "programs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "security": [],
        "x-auth": {
          "type": "none",
          "note": "Payment alone gives access; do not send an API key."
        },
        "parameters": [],
        "x-example-input": {
          "kind": "query",
          "value": {}
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/merchant-profile": {
      "get": {
        "operationId": "get_merchant_profile",
        "summary": "Read merchant profile",
        "description": "Returns the merchant public profile (name, logo, description) for the authenticated agent owner.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "profile": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "business_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "use_agent_wallet": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "use_agent_wallet",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {}
        },
        "x-api-key-required": false
      },
      "post": {
        "operationId": "post_merchant_profile",
        "summary": "Create merchant profile",
        "description": "Creates or replaces the merchant public profile for the authenticated agent owner. business_name is always required, also when a profile already exists (400 missing_fields, uncharged on x402); use PUT /merchant-profile for a partial update.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "profile": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "business_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_url: website or logo_url is not an absolute https:// or http:// URL (javascript:, data: and relative values are rejected). field names the value.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "business_name"
          ],
          "additionalProperties": true,
          "properties": {
            "business_name": {
              "type": "string",
              "maxLength": 100
            },
            "category": {
              "type": "string",
              "enum": [
                "cafe",
                "restaurant",
                "retail",
                "beauty",
                "fitness",
                "grocery",
                "pharmacy",
                "entertainment",
                "services",
                "education",
                "travel",
                "other"
              ]
            },
            "logo_url": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "website": {
              "type": "string"
            },
            "location": {
              "type": "string"
            },
            "use_agent_wallet": {
              "type": "boolean"
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "business_name"
                ],
                "additionalProperties": true,
                "properties": {
                  "business_name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "cafe",
                      "restaurant",
                      "retail",
                      "beauty",
                      "fitness",
                      "grocery",
                      "pharmacy",
                      "entertainment",
                      "services",
                      "education",
                      "travel",
                      "other"
                    ]
                  },
                  "logo_url": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "business_name": "Demo Cafe"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "business_name": "Demo Cafe"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      },
      "put": {
        "operationId": "put_merchant_profile",
        "summary": "Update merchant profile",
        "description": "Partial update of merchant profile fields for the authenticated agent owner: send at least one of business_name, category, logo_url, description, website, location, use_agent_wallet. business_name is required only when no profile exists yet (missing_business_name, uncharged on x402).",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "profile": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "business_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_url: website or logo_url is not an absolute https:// or http:// URL (javascript:, data: and relative values are rejected). field names the value.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "minProperties": 1,
          "anyOf": [
            {
              "required": [
                "business_name"
              ]
            },
            {
              "required": [
                "category"
              ]
            },
            {
              "required": [
                "logo_url"
              ]
            },
            {
              "required": [
                "description"
              ]
            },
            {
              "required": [
                "website"
              ]
            },
            {
              "required": [
                "location"
              ]
            },
            {
              "required": [
                "use_agent_wallet"
              ]
            }
          ],
          "properties": {
            "business_name": {
              "type": "string",
              "maxLength": 100,
              "description": "Required only to create a profile that does not exist yet."
            },
            "category": {
              "type": "string"
            },
            "logo_url": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "website": {
              "type": "string"
            },
            "location": {
              "type": "string"
            },
            "use_agent_wallet": {
              "type": "boolean"
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "minProperties": 1,
                "anyOf": [
                  {
                    "required": [
                      "business_name"
                    ]
                  },
                  {
                    "required": [
                      "category"
                    ]
                  },
                  {
                    "required": [
                      "logo_url"
                    ]
                  },
                  {
                    "required": [
                      "description"
                    ]
                  },
                  {
                    "required": [
                      "website"
                    ]
                  },
                  {
                    "required": [
                      "location"
                    ]
                  },
                  {
                    "required": [
                      "use_agent_wallet"
                    ]
                  }
                ],
                "properties": {
                  "business_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Required only to create a profile that does not exist yet."
                  },
                  "category": {
                    "type": "string"
                  },
                  "logo_url": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "business_name": "Demo Cafe"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "business_name": "Demo Cafe"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/workflow/program-status": {
      "get": {
        "operationId": "get_workflow_program_status",
        "summary": "Autonomous program workflow status",
        "description": "Returns the current merchant program lifecycle step and machine-readable next_actions[] for self-orchestration.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "workflow"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "program": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    },
                    "examples": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "Optional program token; omit to plan from your first program."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "Optional program token; omit to plan from your first program.",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/register-agent": {
      "post": {
        "operationId": "post_register_agent",
        "summary": "Register a merchant agent with a Base USDC payment",
        "description": "HTTP 402 is $0.01 USDC on Base. Pay it and do not send an API key. Registration is one-time per wallet: the first payment issues a full-featured lsk_ key on the Free plan when the wallet has no Merchant Store Plan or Paid Agent Plan (Pro/Enterprise) (1 agent max, 200 API calls/month, 1,000 mint tokens/month, 1.25% mint fee, all 5 scopes: read, create_program, mint, trade, manage_rewards), shown once. When the wallet belongs to a Shopify Store Plan (Starter $39: 1 agent, 1,000 calls/month, read only; Growth $79 or 45-day store trial: 3 agents, 10,000 calls/month, read, mint, manage_rewards; Scale $149: 10 agents, 100,000 calls/month, all 5 scopes, 300 rpm) or a Paid Agent Plan (Pro $49: 5 agents, 10,000 calls/month, unlimited mint, 0.5% fee; Enterprise $129: unlimited agents/calls/mint, 0.25% fee), the lsk_ key operates strictly within that plan's call and scope limits. Paying again with the same name rotates that agent's key. A repeat from a wallet that already has an agent under another name and no free seat is 409 agent_exists (charged:false) unless the body has rotate:true.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "api_key": {
                      "type": "string"
                    },
                    "agent_id": {
                      "type": "string"
                    },
                    "agent_name": {
                      "type": "string"
                    },
                    "plan": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: agent_exists: this wallet already has an agent under another name; this call would replace its key and rename it. charged:false. Keep the existing key, or resend with rotate:true. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "agent_name": {
              "type": "string",
              "maxLength": 64,
              "description": "Optional agent name (trimmed, control/markup characters removed, max 64). Default: x402 agent. A re-key without a name keeps the stored name."
            },
            "name": {
              "type": "string",
              "maxLength": 64,
              "description": "Alias of agent_name (agent_name wins when both are sent)."
            },
            "rotate": {
              "type": "boolean",
              "description": "Set true to confirm re-keying an existing agent with a different name. Without it that case is a 409 agent_exists (charged:false)."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "security": [],
        "x-auth": {
          "type": "none",
          "note": "Payment alone gives access; do not send an API key."
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "agent_name": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Optional agent name (trimmed, control/markup characters removed, max 64). Default: x402 agent. A re-key without a name keeps the stored name."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Alias of agent_name (agent_name wins when both are sent)."
                  },
                  "rotate": {
                    "type": "boolean",
                    "description": "Set true to confirm re-keying an existing agent with a different name. Without it that case is a 409 agent_exists (charged:false)."
                  }
                }
              },
              "example": {
                "agent_name": "my-agent"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "agent_name": "my-agent"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/register-program": {
      "post": {
        "operationId": "post_register_program",
        "summary": "Register a deployed loyalty token in the database",
        "description": "Persists a deployed loyalty token (name, symbol, token_address, optional cashback_rate / points_per_dollar). deploy_tx_hash is documented in the field catalog and is not stored: pass that hash to GET /tx-receipt to read token_address, then send token_address here. Next step for B20 uses recipient_address.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "program": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "token_address": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "name",
            "symbol",
            "token_address"
          ],
          "additionalProperties": true,
          "properties": {
            "name": {
              "type": "string"
            },
            "symbol": {
              "type": "string"
            },
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "expiration_days": {
              "type": "number",
              "minimum": 1
            },
            "cashback_rate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "description": "Cashback % of purchase amount."
            },
            "points_per_dollar": {
              "type": "number",
              "minimum": 0
            },
            "use_agent_wallet": {
              "type": "boolean"
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "symbol",
                  "token_address"
                ],
                "additionalProperties": true,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "expiration_days": {
                    "type": "number",
                    "minimum": 1
                  },
                  "cashback_rate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100,
                    "description": "Cashback % of purchase amount."
                  },
                  "points_per_dollar": {
                    "type": "number",
                    "minimum": 0
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "name": "Demo Cafe Rewards",
                "symbol": "CAFE",
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "name": "Demo Cafe Rewards",
            "symbol": "CAFE",
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/update-program-config": {
      "post": {
        "operationId": "post_update_program_config",
        "summary": "Update default cashback / points-per-dollar",
        "description": "Updates the loyalty program economics (cashback_rate 0-50%, points_per_dollar). Owner agent only.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "program": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "cashback_rate": {
                      "type": "number"
                    },
                    "points_per_dollar": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "token_address"
          ],
          "additionalProperties": true,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "cashback_rate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100
            },
            "points_per_dollar": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "cashback_rate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "points_per_dollar": {
                    "type": "number",
                    "minimum": 0
                  }
                }
              },
              "example": {
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/activate-program": {
      "post": {
        "operationId": "post_activate_program",
        "summary": "Get activation calldata for an inactive program",
        "description": "Returns calldata to unpause a program and enable mint operations. Caller submits the on-chain tx. Each step keeps contract_call and adds tx. The response also includes calls [{to, data, value}] (ERC-5792).",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "contract_call": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "calls": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "token_address"
          ],
          "additionalProperties": true,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "use_agent_wallet": {
              "type": "boolean"
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/program-status": {
      "post": {
        "operationId": "post_program_status",
        "summary": "Set program status in the database",
        "description": "Sets the database status (active / paused / archived) of a loyalty program.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "program": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "previous_status": {
                          "type": "string"
                        },
                        "new_status": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "token_address",
            "status"
          ],
          "additionalProperties": true,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "status": {
              "type": "string",
              "enum": [
                "active",
                "paused",
                "expired",
                "cancelled"
              ]
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address",
                  "status"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "expired",
                      "cancelled"
                    ]
                  }
                }
              },
              "example": {
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                "status": "active"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "status": "active"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mint": {
      "post": {
        "operationId": "post_mint",
        "summary": "Mint loyalty tokens (fee-first calls[] or virtual points for unregistered email)",
        "description": "Accepts recipient_address as a 0x Base wallet address or customer email (or pass recipient_email to automatically resolve the customer's wallet). If the email is not registered yet, credits virtual loyalty points in store_points_ledger (status virtual_pending_signup, mint_status unminted, calls []) which automatically bind to the customer's Base wallet and convert to on-chain B20 tokens when they sign in. For registered wallets, returns a fee-first calls[] bundle (protocol fee mint first, then recipient; each call has to, data, value 0x0) plus fee_obligation_id, fee_amount_wei, execution (EIP-5792 atomic or EOA sequential), and next_actions. A single-call bundle also includes tx {to, data, value: 0x0, chainId: 8453}. Addresses in tx.to and calls[].to are EIP-55. The protocol fee is a decimal amount of the merchant's own loyalty token (18 decimals), not USDC. Confirm with POST /agent-api/mint/confirm { obligation_id, fee_tx_hash, recipient_tx_hash }; 5+ obligations unpaid for over 60 minutes block further mints with HTTP 402.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "mint": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "fee_percent": {
                      "type": "number"
                    },
                    "fee_amount": {
                      "type": "number"
                    },
                    "fee_amount_wei": {
                      "type": "string"
                    },
                    "fee_currency": {
                      "type": "string",
                      "example": "loyalty_tokens"
                    },
                    "fee_wallet": {
                      "type": "string"
                    },
                    "fee_obligation_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "calls": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "execution": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "next_actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "token_address",
            "amount"
          ],
          "additionalProperties": true,
          "anyOf": [
            {
              "required": [
                "recipient_address"
              ]
            },
            {
              "required": [
                "recipient_email"
              ]
            }
          ],
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "recipient_address": {
              "type": "string",
              "description": "Customer 0x wallet or email. Alias: recipient_email."
            },
            "recipient": {
              "type": "string",
              "description": "Legacy alias for recipient_address."
            },
            "recipient_email": {
              "type": "string",
              "description": "Customer email resolved to Base wallet."
            },
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address",
                  "amount"
                ],
                "additionalProperties": true,
                "anyOf": [
                  {
                    "required": [
                      "recipient_address"
                    ]
                  },
                  {
                    "required": [
                      "recipient_email"
                    ]
                  }
                ],
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "recipient_address": {
                    "type": "string",
                    "description": "Customer 0x wallet or email. Alias: recipient_email."
                  },
                  "recipient": {
                    "type": "string",
                    "description": "Legacy alias for recipient_address."
                  },
                  "recipient_email": {
                    "type": "string",
                    "description": "Customer email resolved to Base wallet."
                  },
                  "amount": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000000
                  }
                }
              },
              "example": {
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                "recipient_address": "0x0000000000000000000000000000000000000002",
                "amount": 10
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "recipient_address": "0x0000000000000000000000000000000000000002",
            "amount": 10
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/earn": {
      "post": {
        "operationId": "post_earn",
        "summary": "Record an earn / cashback for a purchase (0x wallet or email)",
        "description": "Computes and mints loyalty points for a purchase (uses program's cashback_rate and points_per_dollar). Accepts customer_address (0x wallet or email) or customer_email. If the email is not registered yet, credits virtual loyalty points in store_points_ledger (status virtual_pending_signup, mint_status unminted, calls []) that automatically convert to B20 tokens on Base when the customer signs in. For registered wallets, uses the same fee-first calls[] plus confirm model as /mint. A single-call bundle also includes tx {to, data, value: 0x0, chainId: 8453}.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "calls": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "token_address",
            "customer_address",
            "purchase_amount"
          ],
          "additionalProperties": true,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "customer_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "purchase_amount": {
              "type": "number",
              "minimum": 0,
              "description": "Purchase amount in fiat units (USD)."
            },
            "cashback_rate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "description": "Optional override of program cashback %."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address",
                  "customer_address",
                  "purchase_amount"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "customer_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "purchase_amount": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Purchase amount in fiat units (USD)."
                  },
                  "cashback_rate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100,
                    "description": "Optional override of program cashback %."
                  }
                }
              },
              "example": {
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                "customer_address": "0x0000000000000000000000000000000000000002",
                "purchase_amount": 25
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "customer_address": "0x0000000000000000000000000000000000000002",
            "purchase_amount": 25
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/transfer": {
      "post": {
        "operationId": "post_transfer",
        "summary": "Get transfer calldata for loyalty tokens",
        "description": "Returns B20/ERC-20 transfer calldata for the merchant agent to move loyalty tokens. The response keeps contract_call and adds tx {to, data, value: 0x0, chainId: 8453}.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "calls": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "token_address",
            "to_address",
            "amount"
          ],
          "additionalProperties": true,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "to_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address",
                  "to_address",
                  "amount"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "to_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "amount": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000000
                  }
                }
              },
              "example": {
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                "to_address": "0x0000000000000000000000000000000000000002",
                "amount": 10
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "to_address": "0x0000000000000000000000000000000000000002",
            "amount": 10
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/redeem-reward": {
      "post": {
        "operationId": "post_redeem_reward",
        "summary": "Redeem a reward for a customer",
        "description": "Burns reward cost from customer balance and issues a voucher; returns voucher code and id.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "voucher": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "voucher_code": {
                      "type": "string"
                    },
                    "voucher_id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "404": {
            "description": "Error, not charged on x402. error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "reward_id",
            "customer_address",
            "transaction_hash"
          ],
          "additionalProperties": true,
          "properties": {
            "reward_id": {
              "type": "string",
              "format": "uuid"
            },
            "customer_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "transaction_hash": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{64}$",
              "description": "On-chain transfer tx hash used to verify the redemption."
            },
            "tx_hash": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{64}$",
              "description": "Alias of transaction_hash."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reward_id",
                  "customer_address",
                  "transaction_hash"
                ],
                "additionalProperties": true,
                "properties": {
                  "reward_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "customer_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "On-chain transfer tx hash used to verify the redemption."
                  },
                  "tx_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Alias of transaction_hash."
                  }
                }
              },
              "example": {
                "reward_id": "00000000-0000-4000-8000-000000000001",
                "customer_address": "0x0000000000000000000000000000000000000002",
                "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "reward_id": "00000000-0000-4000-8000-000000000001",
            "customer_address": "0x0000000000000000000000000000000000000002",
            "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/vouchers/use": {
      "post": {
        "operationId": "post_vouchers_use",
        "summary": "Mark a voucher as used",
        "description": "Marks a previously-issued voucher as used (consumed at point-of-sale).",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "voucher": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: voucher_already_used: the voucher was already redeemed (used_at). Do not retry it; check status with GET /vouchers/status. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "Either voucher_code or voucher_id is required.",
          "properties": {
            "voucher_code": {
              "type": "string",
              "description": "Voucher code (LOYAL-XXXX...)."
            },
            "code": {
              "type": "string",
              "description": "Alias of voucher_code."
            },
            "voucher_id": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Either voucher_code or voucher_id is required.",
                "properties": {
                  "voucher_code": {
                    "type": "string",
                    "description": "Voucher code (LOYAL-XXXX...)."
                  },
                  "code": {
                    "type": "string",
                    "description": "Alias of voucher_code."
                  },
                  "voucher_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              },
              "example": {
                "voucher_code": "LS-DEMO-0001"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "voucher_code": "LS-DEMO-0001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/accept-offer": {
      "post": {
        "operationId": "post_accept_offer",
        "summary": "Accept a P2P swap offer (two-phase)",
        "description": "Phase 1 (no transaction_hash): reserves the offer for your wallet (active -> accepted) and returns approve + fillOffer escrow calldata. Phase 2: call again with transaction_hash of the confirmed LoyaltyTokenEscrow fillOffer tx; the API verifies it on Base and sets the offer to completed.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved. onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "404": {
            "description": "Error, not charged on x402. error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error, not charged on x402. error_code: offer_reserved: another wallet holds the 30-minute reservation. Retry after reserved_until, or pick another offer from GET /offers. onchain_offer_unlinked: the order-book row has no escrow offerId yet, so it cannot be reserved. Pass onchain_offer_id or create_tx_hash, or pick another offer. Nothing was reserved. onchain_offer_inactive: the escrow offer is already filled or cancelled on-chain, so fillOffer would revert. Pick another offer. onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "offer_id"
          ],
          "additionalProperties": true,
          "description": "Two-phase: omit transaction_hash to reserve the offer (active -> accepted) and get approve + fillOffer escrow calldata; send transaction_hash of the confirmed fillOffer tx to finalize (accepted -> completed).",
          "properties": {
            "offer_id": {
              "type": "string",
              "format": "uuid",
              "description": "Marketplace offer id."
            },
            "onchain_offer_id": {
              "type": "number",
              "description": "On-chain escrow offer id (phase 1, when known)."
            },
            "transaction_hash": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{64}$",
              "description": "Phase 2: hash of the confirmed escrow fillOffer transaction on Base."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer_id"
                ],
                "additionalProperties": true,
                "description": "Two-phase: omit transaction_hash to reserve the offer (active -> accepted) and get approve + fillOffer escrow calldata; send transaction_hash of the confirmed fillOffer tx to finalize (accepted -> completed).",
                "properties": {
                  "offer_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Marketplace offer id."
                  },
                  "onchain_offer_id": {
                    "type": "number",
                    "description": "On-chain escrow offer id (phase 1, when known)."
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Phase 2: hash of the confirmed escrow fillOffer transaction on Base."
                  }
                }
              },
              "example": {
                "offer_id": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "offer_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/cancel-offer": {
      "post": {
        "operationId": "post_cancel_offer",
        "summary": "Cancel an own P2P swap offer",
        "description": "Cancels a P2P swap offer the caller created (status active only).",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response. If the escrow offer is already inactive on-chain (onchain_offer_inactive), cancel still closes the order-book row: 200 {status:\"cancelled\", onchain_active:false} with no cancelOffer calldata. The creator can cancel while another wallet holds a reservation: 200 with reservation_released:true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "required": [
            "offer_id"
          ],
          "additionalProperties": true,
          "properties": {
            "offer_id": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer_id"
                ],
                "additionalProperties": true,
                "properties": {
                  "offer_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              },
              "example": {
                "offer_id": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "offer_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/workflow/generate-program-defaults": {
      "post": {
        "operationId": "post_workflow_generate_program_defaults",
        "summary": "Generate program defaults from business context",
        "description": "Autonomous planner: proposes program name, symbol, cashback economics, and starter rewards from merchant business context.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "field_catalog": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "next_actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "examples": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "business_name": {
              "type": "string"
            },
            "category": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "locale": {
              "type": "string"
            },
            "preferred_style": {
              "type": "string"
            },
            "target_audience": {
              "type": "string"
            },
            "use_agent_wallet": {
              "type": "boolean"
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "business_name": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "locale": {
                    "type": "string"
                  },
                  "preferred_style": {
                    "type": "string"
                  },
                  "target_audience": {
                    "type": "string"
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "business_name": "Demo Cafe",
                "category": "cafe"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "business_name": "Demo Cafe",
            "category": "cafe"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/resolve-recipient": {
      "get": {
        "operationId": "get_resolve_recipient",
        "summary": "Resolve a customer email or wallet to a Base 0x address (keyless, x402)",
        "description": "Payment alone gives access; do not send an API key. Same response and masking as GET /agent-api/resolve-recipient: send one of recipient_email, recipient_address or identifier (aliases accepted). x402 only (USDC on Base); not on MPP.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "wallet_address": {
                      "type": "string"
                    },
                    "wallet_masked": {
                      "type": "boolean"
                    },
                    "email": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "recipient_email": {
              "type": "string",
              "format": "email",
              "description": "Customer email (aliases: email, customer_email)."
            },
            "recipient_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "Customer 0x wallet (aliases: address, wallet, wallet_address, customer_address)."
            },
            "identifier": {
              "type": "string",
              "description": "Email, 0x wallet, or @username."
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "anyOf": [
                {
                  "required": [
                    "recipient_email"
                  ]
                },
                {
                  "required": [
                    "recipient_address"
                  ]
                },
                {
                  "required": [
                    "identifier"
                  ]
                }
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "security": [],
        "x-auth": {
          "type": "none",
          "note": "Payment alone gives access; do not send an API key."
        },
        "parameters": [
          {
            "name": "recipient_email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Customer email (aliases: email, customer_email).",
            "example": "customer@example.com"
          },
          {
            "name": "recipient_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "Customer 0x wallet (aliases: address, wallet, wallet_address, customer_address)."
          },
          {
            "name": "identifier",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Email, 0x wallet, or @username."
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "recipient_email": "customer@example.com"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/balances": {
      "get": {
        "operationId": "get_recipient_api_balances",
        "summary": "List all loyalty balances for the holder",
        "description": "Returns balances and tiers across every loyalty program the holder participates in.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "balances"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "balances": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [],
        "x-example-input": {
          "kind": "query",
          "value": {}
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/balance": {
      "get": {
        "operationId": "get_recipient_api_balance",
        "summary": "Get balance for one loyalty token",
        "description": "Returns balance and tier for the holder for a single loyalty token.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "balance"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "balance": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "current_balance": {
                          "type": "number"
                        },
                        "current": {
                          "type": "number"
                        },
                        "onchain_balance": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "offchain_ledger_balance": {
                          "type": "number"
                        },
                        "balance_basis": {
                          "type": "string"
                        },
                        "tokens_earned_total": {
                          "type": "number"
                        },
                        "total_earned": {
                          "type": "number"
                        },
                        "virtual_pending_balance": {
                          "type": "number"
                        },
                        "tier": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true
                        },
                        "token_address": {
                          "type": "string"
                        },
                        "customer_address": {
                          "type": "string"
                        }
                      }
                    },
                    "balance_source": {
                      "type": "string"
                    },
                    "balance_source_note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            }
          },
          "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
          "x-bare-call-default": "inject"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input.",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/rewards": {
      "get": {
        "operationId": "get_recipient_api_rewards",
        "summary": "List rewards available to the holder",
        "description": "Lists redeemable rewards for a program. Response always includes has_engagement (boolean): false when the holder wallet has no activity on the program (active catalog only); true when the wallet already has loyalty engagement.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rewards",
                    "has_engagement"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "rewards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "has_engagement": {
                      "type": "boolean",
                      "description": "true when the holder wallet already has loyalty activity or balance on this program; false returns the active catalog only (no prior engagement)."
                    },
                    "note": {
                      "type": "string"
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            }
          },
          "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
          "x-bare-call-default": "inject"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input.",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/vouchers": {
      "get": {
        "operationId": "get_recipient_api_vouchers",
        "summary": "List vouchers issued to the holder",
        "description": "Returns the holder's vouchers (redeemed rewards) with status.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "vouchers"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "vouchers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "status": {
              "type": "string"
            },
            "limit": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453).",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/offers": {
      "get": {
        "operationId": "get_recipient_api_offers",
        "summary": "List P2P marketplace offers visible to the holder",
        "description": "Lists P2P swap offers the holder can accept (filterable by token_address). Payment alone gives access; do not send an API key.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "offers"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "security": [],
        "x-auth": {
          "type": "none",
          "note": "Payment alone gives access; do not send an API key."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453).",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      },
      "post": {
        "operationId": "post_recipient_api_offers",
        "summary": "Create P2P swap offer",
        "description": "Creates a P2P swap intent between two loyalty tokens.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_amount: a present amount is 0, negative or not a number (field, min_exclusive:0). Send a positive number. insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "offer_token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            },
            "offer_amount": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "request_token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            },
            "request_amount": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "offer_token_address",
                "offer_amount",
                "request_token_address",
                "request_amount"
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "offer_token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
                  },
                  "offer_amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "request_token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
                  },
                  "request_amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "offer_token_address",
                      "offer_amount",
                      "request_token_address",
                      "request_amount"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              },
              "example": {
                "offer_token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                "offer_amount": 10,
                "request_token_address": "0xb2000000000000000000002a96dcb4274f5493fe",
                "request_amount": 10
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "offer_token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "offer_amount": 10,
            "request_token_address": "0xb2000000000000000000002a96dcb4274f5493fe",
            "request_amount": 10
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/workflow/reward-status": {
      "get": {
        "operationId": "get_recipient_api_workflow_reward_status",
        "summary": "Autonomous reward redemption status",
        "description": "Returns the current reward redemption step and machine-readable next_actions[] for the holder.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "reward": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    },
                    "balance": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            },
            "reward_id": {
              "type": "string",
              "format": "uuid"
            }
          },
          "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
          "x-bare-call-default": "inject"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input.",
            "example": "0xb2000000000000000000008ce542828ec5f09bb7"
          },
          {
            "name": "reward_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-example-input": {
          "kind": "query",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/prepare-transfer": {
      "post": {
        "operationId": "post_recipient_api_prepare_transfer",
        "summary": "Prepare B20/ERC-20 transfer calldata",
        "description": "Returns B20/ERC-20 transfer calldata for the holder to send loyalty tokens to any address.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "note": {
                      "type": "string"
                    },
                    "from_wallet": {
                      "type": "string"
                    },
                    "program": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "contract_call": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "token_address": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
            },
            "to": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$",
              "description": "EVM address on Base (eip155:8453)."
            },
            "amount": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "token_address",
                "to",
                "amount"
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
                  },
                  "to": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "token_address",
                      "to",
                      "amount"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              },
              "example": {
                "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                "to": "0x0000000000000000000000000000000000000002",
                "amount": 10
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "to": "0x0000000000000000000000000000000000000002",
            "amount": 10
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/redeem-reward": {
      "post": {
        "operationId": "post_recipient_api_redeem_reward",
        "summary": "Redeem a reward",
        "description": "Redeems a reward using a transfer tx hash; returns the issued voucher.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "voucher": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "voucher_code": {
                      "type": "string"
                    },
                    "voucher_id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "404": {
            "description": "Error, not charged on x402. error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "reward_id": {
              "type": "string",
              "format": "uuid"
            },
            "transaction_hash": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{64}$"
            },
            "tx_hash": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{64}$",
              "description": "Alias of transaction_hash."
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "reward_id",
                "transaction_hash"
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "reward_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$"
                  },
                  "tx_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Alias of transaction_hash."
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "reward_id",
                      "transaction_hash"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              },
              "example": {
                "reward_id": "00000000-0000-4000-8000-000000000001",
                "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "reward_id": "00000000-0000-4000-8000-000000000001",
            "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/accept-offer": {
      "post": {
        "operationId": "post_recipient_api_accept_offer",
        "summary": "Accept a P2P swap offer (two-phase)",
        "description": "Phase 1 (no transaction_hash): reserves the offer (active -> accepted) and returns approve + fillOffer escrow calldata. Phase 2: call again with transaction_hash of the confirmed fillOffer tx to finalize (accepted -> completed).",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved. onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "404": {
            "description": "Error, not charged on x402. error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error, not charged on x402. error_code: offer_reserved: another wallet holds the 30-minute reservation. Retry after reserved_until, or pick another offer from GET /offers. onchain_offer_unlinked: the order-book row has no escrow offerId yet, so it cannot be reserved. Pass onchain_offer_id or create_tx_hash, or pick another offer. Nothing was reserved. onchain_offer_inactive: the escrow offer is already filled or cancelled on-chain, so fillOffer would revert. Pick another offer. onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "description": "Two-phase: call without transaction_hash to reserve the offer (status active -> accepted) and receive approve + fillOffer escrow calldata; call again with transaction_hash of the confirmed fillOffer tx to finalize (accepted -> completed). A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "properties": {
            "offer_id": {
              "type": "string",
              "format": "uuid"
            },
            "onchain_offer_id": {
              "type": "number",
              "description": "On-chain escrow offer id (phase 1, when known)."
            },
            "transaction_hash": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{64}$",
              "description": "Phase 2: hash of the confirmed escrow fillOffer transaction on Base."
            },
            "tx_hash": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{64}$",
              "description": "Alias of transaction_hash."
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "offer_id"
              ]
            }
          ],
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Two-phase: call without transaction_hash to reserve the offer (status active -> accepted) and receive approve + fillOffer escrow calldata; call again with transaction_hash of the confirmed fillOffer tx to finalize (accepted -> completed). A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "properties": {
                  "offer_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "onchain_offer_id": {
                    "type": "number",
                    "description": "On-chain escrow offer id (phase 1, when known)."
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Phase 2: hash of the confirmed escrow fillOffer transaction on Base."
                  },
                  "tx_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Alias of transaction_hash."
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "offer_id"
                    ]
                  }
                ],
                "x-bare-call-default": "view"
              },
              "example": {
                "offer_id": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "offer_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/cancel-offer": {
      "post": {
        "operationId": "post_recipient_api_cancel_offer",
        "summary": "Cancel own P2P swap offer",
        "description": "Cancels a P2P swap offer created by the holder.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response. If the escrow offer is already inactive on-chain (onchain_offer_inactive), cancel still closes the order-book row: 200 {status:\"cancelled\", onchain_active:false} with no cancelOffer calldata. The creator can cancel while another wallet holds a reservation: 200 with reservation_released:true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error, not charged on x402. error_code: onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "offer_id": {
              "type": "string",
              "format": "uuid"
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "offer_id"
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "offer_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "offer_id"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              },
              "example": {
                "offer_id": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "offer_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-api/workflow/prepare-reward-redemption": {
      "post": {
        "operationId": "post_recipient_api_workflow_prepare_reward_redemption",
        "summary": "Prepare reward redemption plan + transfer calldata",
        "description": "One-shot planner: returns B20/ERC-20 transfer calldata for the reward cost plus workflow so the agent can broadcast then redeem.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "reward": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "transfer_preparation": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "balance": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Error, not charged on x402. error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-input-schema": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "reward_id": {
              "type": "string",
              "format": "uuid",
              "description": "Reward UUID from GET /recipient-api/rewards."
            }
          },
          "anyOf": [
            {
              "maxProperties": 0
            },
            {
              "required": [
                "reward_id"
              ]
            }
          ],
          "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
          "x-bare-call-default": "view"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "reward_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Reward UUID from GET /recipient-api/rewards."
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "reward_id"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              },
              "example": {
                "reward_id": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "x-example-input": {
          "kind": "body",
          "value": {
            "reward_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/get_platform_info": {
      "post": {
        "operationId": "mcp_get_platform_info",
        "summary": "MCP tool: get_platform_info",
        "description": "Protocol metadata and capabilities on Base L2. Body: JSON-RPC 2.0 tools/call named get_platform_info, or just the tool arguments as the JSON body. Payment alone gives access; do not send an API key.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "none",
          "note": "Payment alone gives access; do not send an API key."
        },
        "x-mcp": {
          "tool": "get_platform_info",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {}
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "get_platform_info"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "get_platform_info",
                  "arguments": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {}
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/get_my_profile": {
      "post": {
        "operationId": "mcp_get_my_profile",
        "summary": "MCP tool: get_my_profile",
        "description": "Authenticated agent profile and scopes. Body: JSON-RPC 2.0 tools/call named get_my_profile, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "get_my_profile",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {}
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "get_my_profile"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "get_my_profile",
                  "arguments": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {}
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/list_loyalty_programs": {
      "post": {
        "operationId": "mcp_list_loyalty_programs",
        "summary": "MCP tool: list_loyalty_programs",
        "description": "List B20/ERC-20 merchant loyalty programs. Body: JSON-RPC 2.0 tools/call named list_loyalty_programs, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "list_loyalty_programs",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "include_expired": {
                "type": "boolean",
                "description": "When true, include programs with status expired."
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_loyalty_programs"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "include_expired": {
                            "type": "boolean",
                            "description": "When true, include programs with status expired."
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_loyalty_programs",
                  "arguments": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {}
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/create_loyalty_program": {
      "post": {
        "operationId": "mcp_create_loyalty_program",
        "summary": "MCP tool: create_loyalty_program",
        "description": "Factory calldata to deploy a loyalty token. Response includes contract_call and tx {to, data, value: 0x0, chainId: 8453}. Body: JSON-RPC 2.0 tools/call named create_loyalty_program, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "create_loyalty_program",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Program display name (max 50 characters)."
              },
              "symbol": {
                "type": "string",
                "description": "Token symbol (2–5 characters)."
              },
              "expiration_days": {
                "type": "number",
                "description": "Program lifetime in days (default 365)."
              },
              "token_standard": {
                "type": "string",
                "enum": [
                  "b20",
                  "erc20"
                ],
                "default": "b20",
                "description": "b20 (default): Base-native B20, single tx. erc20: legacy factory, needs activate_loyalty_program."
              },
              "agent_wallet_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "(B20) Extra wallet granted MINT_ROLE in the deploy tx. Default: the agent's CDP wallet."
              },
              "extra_minters": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^0x[a-fA-F0-9]{40}$",
                  "description": "EVM address on Base mainnet (eip155:8453)."
                },
                "description": "(B20) More addresses granted MINT_ROLE in the same deploy tx."
              },
              "auto_generate": {
                "type": "boolean",
                "description": "Internal automation only — fills missing name/symbol from examples. External agents should pass explicit name and symbol."
              },
              "business_context": {
                "type": "object",
                "description": "Optional context for examples only"
              },
              "preferred_style": {
                "type": "string"
              },
              "locale": {
                "type": "string"
              },
              "target_audience": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "symbol"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "create_loyalty_program"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Program display name (max 50 characters)."
                          },
                          "symbol": {
                            "type": "string",
                            "description": "Token symbol (2–5 characters)."
                          },
                          "expiration_days": {
                            "type": "number",
                            "description": "Program lifetime in days (default 365)."
                          },
                          "token_standard": {
                            "type": "string",
                            "enum": [
                              "b20",
                              "erc20"
                            ],
                            "default": "b20",
                            "description": "b20 (default): Base-native B20, single tx. erc20: legacy factory, needs activate_loyalty_program."
                          },
                          "agent_wallet_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "(B20) Extra wallet granted MINT_ROLE in the deploy tx. Default: the agent's CDP wallet."
                          },
                          "extra_minters": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^0x[a-fA-F0-9]{40}$",
                              "description": "EVM address on Base mainnet (eip155:8453)."
                            },
                            "description": "(B20) More addresses granted MINT_ROLE in the same deploy tx."
                          },
                          "auto_generate": {
                            "type": "boolean",
                            "description": "Internal automation only — fills missing name/symbol from examples. External agents should pass explicit name and symbol."
                          },
                          "business_context": {
                            "type": "object",
                            "description": "Optional context for examples only"
                          },
                          "preferred_style": {
                            "type": "string"
                          },
                          "locale": {
                            "type": "string"
                          },
                          "target_audience": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "symbol"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "create_loyalty_program",
                  "arguments": {
                    "name": "Demo Cafe Rewards",
                    "symbol": "CAFE"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "name": "Demo Cafe Rewards",
            "symbol": "CAFE"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/register_loyalty_program": {
      "post": {
        "operationId": "mcp_register_loyalty_program",
        "summary": "MCP tool: register_loyalty_program",
        "description": "Register deployed token in database. Body: JSON-RPC 2.0 tools/call named register_loyalty_program, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "register_loyalty_program",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Program display name."
              },
              "symbol": {
                "type": "string",
                "description": "Token symbol."
              },
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Deployed B20/ERC-20 loyalty contract on Base."
              },
              "expiration_days": {
                "type": "number",
                "description": "Duration in days (default: 365)"
              },
              "cashback_rate": {
                "type": "number",
                "description": "Default cashback percent for earn (1–100). Omit for DB default (5)."
              },
              "points_per_dollar": {
                "type": "number",
                "description": "Loyalty points per $1 spent (1–1000). Omit for DB default (1)."
              },
              "token_standard": {
                "type": "string",
                "description": "'b20' (default) or 'erc20' (legacy)"
              }
            },
            "required": [
              "name",
              "symbol",
              "token_address"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "register_loyalty_program"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Program display name."
                          },
                          "symbol": {
                            "type": "string",
                            "description": "Token symbol."
                          },
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Deployed B20/ERC-20 loyalty contract on Base."
                          },
                          "expiration_days": {
                            "type": "number",
                            "description": "Duration in days (default: 365)"
                          },
                          "cashback_rate": {
                            "type": "number",
                            "description": "Default cashback percent for earn (1–100). Omit for DB default (5)."
                          },
                          "points_per_dollar": {
                            "type": "number",
                            "description": "Loyalty points per $1 spent (1–1000). Omit for DB default (1)."
                          },
                          "token_standard": {
                            "type": "string",
                            "description": "'b20' (default) or 'erc20' (legacy)"
                          }
                        },
                        "required": [
                          "name",
                          "symbol",
                          "token_address"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "register_loyalty_program",
                  "arguments": {
                    "name": "Demo Cafe Rewards",
                    "symbol": "CAFE",
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "name": "Demo Cafe Rewards",
            "symbol": "CAFE",
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/activate_loyalty_program": {
      "post": {
        "operationId": "mcp_activate_loyalty_program",
        "summary": "MCP tool: activate_loyalty_program",
        "description": "Activation calldata for an inactive legacy program. Response includes calls [{to, data, value}] and tx on each contract_call. Body: JSON-RPC 2.0 tools/call named activate_loyalty_program, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "activate_loyalty_program",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              }
            },
            "required": [
              "token_address"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "activate_loyalty_program"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          }
                        },
                        "required": [
                          "token_address"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "activate_loyalty_program",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/update_program_status": {
      "post": {
        "operationId": "mcp_update_program_status",
        "summary": "MCP tool: update_program_status",
        "description": "Update program status in DB. Body: JSON-RPC 2.0 tools/call named update_program_status, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "update_program_status",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "paused",
                  "expired",
                  "cancelled"
                ],
                "description": "New program status."
              }
            },
            "required": [
              "token_address",
              "status"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "update_program_status"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "paused",
                              "expired",
                              "cancelled"
                            ],
                            "description": "New program status."
                          }
                        },
                        "required": [
                          "token_address",
                          "status"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "update_program_status",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "status": "active"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "status": "active"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/update_program_config": {
      "post": {
        "operationId": "mcp_update_program_config",
        "summary": "MCP tool: update_program_config",
        "description": "Update program economics config (cashback_rate, points_per_dollar). Body: JSON-RPC 2.0 tools/call named update_program_config, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "update_program_config",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "anyOf": [
              {
                "required": [
                  "cashback_rate"
                ]
              },
              {
                "required": [
                  "points_per_dollar"
                ]
              }
            ],
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              },
              "cashback_rate": {
                "type": "number",
                "description": "Cashback percentage of purchase amount (0–100)."
              },
              "points_per_dollar": {
                "type": "number",
                "description": "Loyalty points earned per USD spent."
              }
            },
            "required": [
              "token_address"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "update_program_config"
                      },
                      "arguments": {
                        "type": "object",
                        "anyOf": [
                          {
                            "required": [
                              "cashback_rate"
                            ]
                          },
                          {
                            "required": [
                              "points_per_dollar"
                            ]
                          }
                        ],
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          },
                          "cashback_rate": {
                            "type": "number",
                            "description": "Cashback percentage of purchase amount (0–100)."
                          },
                          "points_per_dollar": {
                            "type": "number",
                            "description": "Loyalty points earned per USD spent."
                          }
                        },
                        "required": [
                          "token_address"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "update_program_config",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "cashback_rate": 5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "cashback_rate": 5
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/list_rewards": {
      "post": {
        "operationId": "mcp_list_rewards",
        "summary": "MCP tool: list_rewards",
        "description": "List rewards for a program. Body: JSON-RPC 2.0 tools/call named list_rewards, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "list_rewards",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "token_address"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_rewards"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "token_address"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_rewards",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/create_reward": {
      "post": {
        "operationId": "mcp_create_reward",
        "summary": "MCP tool: create_reward",
        "description": "Create redeemable reward. Body: JSON-RPC 2.0 tools/call named create_reward, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "create_reward",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              },
              "name": {
                "type": "string",
                "description": "Reward title shown to customers."
              },
              "description": {
                "type": "string",
                "description": "Optional reward description."
              },
              "cost": {
                "type": "number",
                "description": "Token amount required to redeem (minimum 1)."
              }
            },
            "required": [
              "token_address",
              "name",
              "cost"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "create_reward"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          },
                          "name": {
                            "type": "string",
                            "description": "Reward title shown to customers."
                          },
                          "description": {
                            "type": "string",
                            "description": "Optional reward description."
                          },
                          "cost": {
                            "type": "number",
                            "description": "Token amount required to redeem (minimum 1)."
                          }
                        },
                        "required": [
                          "token_address",
                          "name",
                          "cost"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "create_reward",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "name": "Demo Cafe Rewards",
                    "cost": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: invalid_amount: a present amount is 0, negative or not a number (field, min_exclusive:0). Send a positive number.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "name": "Demo Cafe Rewards",
            "cost": 100
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/mint_loyalty_tokens": {
      "post": {
        "operationId": "mcp_mint_loyalty_tokens",
        "summary": "MCP tool: mint_loyalty_tokens",
        "description": "Fee-first mint calls[] (protocol fee first, each {to, data, value: 0x0}) + fee_obligation_id. A one-call bundle also includes tx {to, data, value: 0x0, chainId: 8453}. Confirm via confirm_mint_fee / POST /mint/confirm. Accepts a 0x Base wallet address or customer email in recipient_address (or recipient_email) to automatically resolve the customer's wallet; recipient is a legacy alias. Body: JSON-RPC 2.0 tools/call named mint_loyalty_tokens, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "mint_loyalty_tokens",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "anyOf": [
              {
                "required": [
                  "recipient_address"
                ]
              },
              {
                "required": [
                  "recipient"
                ]
              },
              {
                "required": [
                  "recipient_email"
                ]
              }
            ],
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              },
              "recipient_address": {
                "type": "string",
                "description": "Customer 0x wallet or email (preferred)."
              },
              "recipient": {
                "type": "string",
                "description": "Legacy alias for recipient_address."
              },
              "recipient_email": {
                "type": "string",
                "description": "Customer email to resolve to wallet."
              },
              "amount": {
                "type": "number",
                "description": "Whole-token amount to mint (human units, not wei)."
              }
            },
            "required": [
              "token_address",
              "amount"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "mint_loyalty_tokens"
                      },
                      "arguments": {
                        "type": "object",
                        "anyOf": [
                          {
                            "required": [
                              "recipient_address"
                            ]
                          },
                          {
                            "required": [
                              "recipient"
                            ]
                          },
                          {
                            "required": [
                              "recipient_email"
                            ]
                          }
                        ],
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          },
                          "recipient_address": {
                            "type": "string",
                            "description": "Customer 0x wallet or email (preferred)."
                          },
                          "recipient": {
                            "type": "string",
                            "description": "Legacy alias for recipient_address."
                          },
                          "recipient_email": {
                            "type": "string",
                            "description": "Customer email to resolve to wallet."
                          },
                          "amount": {
                            "type": "number",
                            "description": "Whole-token amount to mint (human units, not wei)."
                          }
                        },
                        "required": [
                          "token_address",
                          "amount"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "mint_loyalty_tokens",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "amount": 10,
                    "recipient_address": "0x0000000000000000000000000000000000000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "amount": 10,
            "recipient_address": "0x0000000000000000000000000000000000000002"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/transfer_loyalty_tokens": {
      "post": {
        "operationId": "mcp_transfer_loyalty_tokens",
        "summary": "MCP tool: transfer_loyalty_tokens",
        "description": "B20/ERC-20 transfer loyalty tokens. Response includes contract_call and tx {to, data, value: 0x0, chainId: 8453}. Body: JSON-RPC 2.0 tools/call named transfer_loyalty_tokens, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "transfer_loyalty_tokens",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "anyOf": [
              {
                "required": [
                  "to"
                ]
              },
              {
                "required": [
                  "to_address"
                ]
              }
            ],
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              },
              "to": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Recipient wallet address."
              },
              "to_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Alias for to (same as REST to_address)."
              },
              "amount": {
                "type": "number",
                "description": "Whole-token amount to transfer."
              }
            },
            "required": [
              "token_address",
              "amount"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "transfer_loyalty_tokens"
                      },
                      "arguments": {
                        "type": "object",
                        "anyOf": [
                          {
                            "required": [
                              "to"
                            ]
                          },
                          {
                            "required": [
                              "to_address"
                            ]
                          }
                        ],
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          },
                          "to": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Recipient wallet address."
                          },
                          "to_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Alias for to (same as REST to_address)."
                          },
                          "amount": {
                            "type": "number",
                            "description": "Whole-token amount to transfer."
                          }
                        },
                        "required": [
                          "token_address",
                          "amount"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "transfer_loyalty_tokens",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "amount": 10,
                    "to": "0x0000000000000000000000000000000000000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "amount": 10,
            "to": "0x0000000000000000000000000000000000000002"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/earn_points": {
      "post": {
        "operationId": "mcp_earn_points",
        "summary": "MCP tool: earn_points",
        "description": "Record earn / points for a customer purchase. Fee-first calls[] plus tx when the bundle is a single call. Confirm the fee after broadcast. Body: JSON-RPC 2.0 tools/call named earn_points, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "earn_points",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              },
              "customer_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Customer wallet to credit."
              },
              "customer_email": {
                "type": "string",
                "description": "Customer email address"
              },
              "purchase_amount": {
                "type": "number",
                "description": "Purchase total in USD (fiat units)."
              },
              "cashback_rate": {
                "type": "number",
                "description": "Optional override of program cashback % (0–100)."
              },
              "points_to_redeem": {
                "type": "number",
                "description": "Optional integer loyalty points to redeem at the counter to reduce purchase_amount."
              },
              "redeem_all": {
                "type": "boolean",
                "description": "If true, redeems all available customer loyalty points (up to purchase_amount when positive)."
              }
            },
            "required": [
              "token_address",
              "customer_address",
              "purchase_amount"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "earn_points"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          },
                          "customer_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Customer wallet to credit."
                          },
                          "customer_email": {
                            "type": "string",
                            "description": "Customer email address"
                          },
                          "purchase_amount": {
                            "type": "number",
                            "description": "Purchase total in USD (fiat units)."
                          },
                          "cashback_rate": {
                            "type": "number",
                            "description": "Optional override of program cashback % (0–100)."
                          },
                          "points_to_redeem": {
                            "type": "number",
                            "description": "Optional integer loyalty points to redeem at the counter to reduce purchase_amount."
                          },
                          "redeem_all": {
                            "type": "boolean",
                            "description": "If true, redeems all available customer loyalty points (up to purchase_amount when positive)."
                          }
                        },
                        "required": [
                          "token_address",
                          "customer_address",
                          "purchase_amount"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "earn_points",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "customer_address": "0x0000000000000000000000000000000000000002",
                    "purchase_amount": 25
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "customer_address": "0x0000000000000000000000000000000000000002",
            "purchase_amount": 25
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/get_token_balance": {
      "post": {
        "operationId": "mcp_get_token_balance",
        "summary": "MCP tool: get_token_balance",
        "description": "Balance and tier for a wallet. Body: JSON-RPC 2.0 tools/call named get_token_balance, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "get_token_balance",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
              },
              "customer_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Customer wallet to query."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "token_address",
                  "customer_address"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "get_token_balance"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
                          },
                          "customer_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Customer wallet to query."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "token_address",
                              "customer_address"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "get_token_balance",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "customer_address": "0x0000000000000000000000000000000000000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "customer_address": "0x0000000000000000000000000000000000000002"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/get_program_analytics": {
      "post": {
        "operationId": "mcp_get_program_analytics",
        "summary": "MCP tool: get_program_analytics",
        "description": "Program analytics. Body: JSON-RPC 2.0 tools/call named get_program_analytics, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "get_program_analytics",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "token_address"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "get_program_analytics"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "token_address"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "get_program_analytics",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/list_marketplace_offers": {
      "post": {
        "operationId": "mcp_list_marketplace_offers",
        "summary": "MCP tool: list_marketplace_offers",
        "description": "List P2P offers. Body: JSON-RPC 2.0 tools/call named list_marketplace_offers, or just the tool arguments as the JSON body. Payment alone gives access; do not send an API key.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "none",
          "note": "Payment alone gives access; do not send an API key."
        },
        "x-mcp": {
          "tool": "list_marketplace_offers",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "description": "Filter: active/completed/cancelled"
              },
              "limit": {
                "type": "number",
                "description": "Max results (1-100)"
              },
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Optional. When set, only offers that give or ask for this token."
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_marketplace_offers"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "description": "Filter: active/completed/cancelled"
                          },
                          "limit": {
                            "type": "number",
                            "description": "Max results (1-100)"
                          },
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Optional. When set, only offers that give or ask for this token."
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_marketplace_offers",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/redeem_reward": {
      "post": {
        "operationId": "mcp_redeem_reward",
        "summary": "MCP tool: redeem_reward",
        "description": "Redeem reward for voucher. Body: JSON-RPC 2.0 tools/call named redeem_reward, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "redeem_reward",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "reward_id": {
                "type": "string",
                "format": "uuid",
                "description": "Reward UUID from list_rewards."
              },
              "customer_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Customer wallet that paid the token cost."
              },
              "transaction_hash": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{64}$",
                "description": "On-chain transfer tx proving token payment."
              }
            },
            "required": [
              "reward_id",
              "customer_address",
              "transaction_hash"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "redeem_reward"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "reward_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Reward UUID from list_rewards."
                          },
                          "customer_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Customer wallet that paid the token cost."
                          },
                          "transaction_hash": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{64}$",
                            "description": "On-chain transfer tx proving token payment."
                          }
                        },
                        "required": [
                          "reward_id",
                          "customer_address",
                          "transaction_hash"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "redeem_reward",
                  "arguments": {
                    "reward_id": "00000000-0000-4000-8000-000000000001",
                    "customer_address": "0x0000000000000000000000000000000000000002",
                    "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "404": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "reward_id": "00000000-0000-4000-8000-000000000001",
            "customer_address": "0x0000000000000000000000000000000000000002",
            "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/use_voucher": {
      "post": {
        "operationId": "mcp_use_voucher",
        "summary": "MCP tool: use_voucher",
        "description": "Mark voucher used. Send one of voucher_code or voucher_id. Neither returns error_code missing_identifier. Body: JSON-RPC 2.0 tools/call named use_voucher, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "use_voucher",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "anyOf": [
              {
                "required": [
                  "voucher_code"
                ]
              },
              {
                "required": [
                  "code"
                ]
              },
              {
                "required": [
                  "voucher_id"
                ]
              }
            ],
            "properties": {
              "voucher_code": {
                "type": "string",
                "description": "Voucher code (LOYAL-XXXX-XXXX)."
              },
              "code": {
                "type": "string",
                "description": "Alias of voucher_code."
              },
              "voucher_id": {
                "type": "string",
                "format": "uuid",
                "description": "Voucher UUID (alternative to code)."
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "use_voucher"
                      },
                      "arguments": {
                        "type": "object",
                        "anyOf": [
                          {
                            "required": [
                              "voucher_code"
                            ]
                          },
                          {
                            "required": [
                              "code"
                            ]
                          },
                          {
                            "required": [
                              "voucher_id"
                            ]
                          }
                        ],
                        "properties": {
                          "voucher_code": {
                            "type": "string",
                            "description": "Voucher code (LOYAL-XXXX-XXXX)."
                          },
                          "code": {
                            "type": "string",
                            "description": "Alias of voucher_code."
                          },
                          "voucher_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Voucher UUID (alternative to code)."
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "use_voucher",
                  "arguments": {
                    "code": "LS-DEMO-0001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: voucher_already_used: the voucher was already redeemed (used_at). Do not retry it; check status with GET /vouchers/status. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "code": "LS-DEMO-0001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/check_voucher_status": {
      "post": {
        "operationId": "mcp_check_voucher_status",
        "summary": "MCP tool: check_voucher_status",
        "description": "Check voucher status. Send one of code, voucher_code, or voucher_id. None returns error_code missing_identifier. Body: JSON-RPC 2.0 tools/call named check_voucher_status, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "check_voucher_status",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Voucher code (LOYAL-XXXX-XXXX). Preferred."
              },
              "voucher_id": {
                "type": "string",
                "format": "uuid",
                "description": "Voucher UUID (alternative to code)."
              },
              "voucher_code": {
                "type": "string",
                "description": "Alias of code."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "anyOf": [
                  {
                    "required": [
                      "code"
                    ]
                  },
                  {
                    "required": [
                      "voucher_id"
                    ]
                  },
                  {
                    "required": [
                      "voucher_code"
                    ]
                  }
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "check_voucher_status"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Voucher code (LOYAL-XXXX-XXXX). Preferred."
                          },
                          "voucher_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Voucher UUID (alternative to code)."
                          },
                          "voucher_code": {
                            "type": "string",
                            "description": "Alias of code."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "anyOf": [
                              {
                                "required": [
                                  "code"
                                ]
                              },
                              {
                                "required": [
                                  "voucher_id"
                                ]
                              },
                              {
                                "required": [
                                  "voucher_code"
                                ]
                              }
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "check_voucher_status",
                  "arguments": {
                    "code": "LS-DEMO-0001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "code": "LS-DEMO-0001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/create_personalized_offer": {
      "post": {
        "operationId": "mcp_create_personalized_offer",
        "summary": "MCP tool: create_personalized_offer",
        "description": "Create retention offer for a customer. Body: JSON-RPC 2.0 tools/call named create_personalized_offer, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "create_personalized_offer",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              },
              "customer_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Target customer wallet."
              },
              "title": {
                "type": "string",
                "description": "Offer title shown to the customer."
              },
              "description": {
                "type": "string",
                "description": "Offer description"
              },
              "bonus_tokens": {
                "type": "number",
                "description": "Bonus tokens to award"
              },
              "discount_percentage": {
                "type": "number",
                "description": "Discount percentage (0-100)"
              },
              "valid_days": {
                "type": "number",
                "description": "How many days the offer is valid (default: 7)"
              }
            },
            "required": [
              "token_address",
              "customer_address",
              "title"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "create_personalized_offer"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          },
                          "customer_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Target customer wallet."
                          },
                          "title": {
                            "type": "string",
                            "description": "Offer title shown to the customer."
                          },
                          "description": {
                            "type": "string",
                            "description": "Offer description"
                          },
                          "bonus_tokens": {
                            "type": "number",
                            "description": "Bonus tokens to award"
                          },
                          "discount_percentage": {
                            "type": "number",
                            "description": "Discount percentage (0-100)"
                          },
                          "valid_days": {
                            "type": "number",
                            "description": "How many days the offer is valid (default: 7)"
                          }
                        },
                        "required": [
                          "token_address",
                          "customer_address",
                          "title"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "create_personalized_offer",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "customer_address": "0x0000000000000000000000000000000000000002",
                    "title": "10% off your next visit"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "customer_address": "0x0000000000000000000000000000000000000002",
            "title": "10% off your next visit"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/update_reward_status": {
      "post": {
        "operationId": "mcp_update_reward_status",
        "summary": "MCP tool: update_reward_status",
        "description": "Activate/deactivate reward. Body: JSON-RPC 2.0 tools/call named update_reward_status, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "update_reward_status",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "reward_id": {
                "type": "string",
                "format": "uuid",
                "description": "Reward UUID."
              },
              "is_active": {
                "type": "boolean",
                "description": "True to show reward; false to hide."
              }
            },
            "required": [
              "reward_id",
              "is_active"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "update_reward_status"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "reward_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Reward UUID."
                          },
                          "is_active": {
                            "type": "boolean",
                            "description": "True to show reward; false to hide."
                          }
                        },
                        "required": [
                          "reward_id",
                          "is_active"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "update_reward_status",
                  "arguments": {
                    "reward_id": "00000000-0000-4000-8000-000000000001",
                    "is_active": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "reward_id": "00000000-0000-4000-8000-000000000001",
            "is_active": true
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/send_report": {
      "post": {
        "operationId": "mcp_send_report",
        "summary": "MCP tool: send_report",
        "description": "Submit agent report to merchant dashboard. Body: JSON-RPC 2.0 tools/call named send_report, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "send_report",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "agent_role": {
                "type": "string",
                "description": "Agent persona label (e.g. analyst, support)."
              },
              "report_type": {
                "type": "string",
                "enum": [
                  "seo_audit",
                  "audit",
                  "growth_idea",
                  "data_report",
                  "anomaly",
                  "task",
                  "recommendation",
                  "weekly_report"
                ],
                "description": "Report category; other values get a 400 listing the allowed ones (not charged)."
              },
              "title": {
                "type": "string",
                "description": "Short report headline."
              },
              "content": {
                "type": "string",
                "description": "Markdown or plain-text report body."
              },
              "priority": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ],
                "description": "Merchant inbox priority."
              },
              "action_items": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Suggested follow-up tasks."
              }
            },
            "required": [
              "agent_role",
              "report_type",
              "title",
              "content"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "send_report"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "agent_role": {
                            "type": "string",
                            "description": "Agent persona label (e.g. analyst, support)."
                          },
                          "report_type": {
                            "type": "string",
                            "enum": [
                              "seo_audit",
                              "audit",
                              "growth_idea",
                              "data_report",
                              "anomaly",
                              "task",
                              "recommendation",
                              "weekly_report"
                            ],
                            "description": "Report category; other values get a 400 listing the allowed ones (not charged)."
                          },
                          "title": {
                            "type": "string",
                            "description": "Short report headline."
                          },
                          "content": {
                            "type": "string",
                            "description": "Markdown or plain-text report body."
                          },
                          "priority": {
                            "type": "string",
                            "enum": [
                              "low",
                              "medium",
                              "high"
                            ],
                            "description": "Merchant inbox priority."
                          },
                          "action_items": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Suggested follow-up tasks."
                          }
                        },
                        "required": [
                          "agent_role",
                          "report_type",
                          "title",
                          "content"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "send_report",
                  "arguments": {
                    "agent_role": "growth",
                    "report_type": "seo_audit",
                    "title": "Weekly loyalty summary",
                    "content": "Weekly summary: 12 new members, 3 redemptions."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "agent_role": "growth",
            "report_type": "seo_audit",
            "title": "Weekly loyalty summary",
            "content": "Weekly summary: 12 new members, 3 redemptions."
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/list_my_reports": {
      "post": {
        "operationId": "mcp_list_my_reports",
        "summary": "MCP tool: list_my_reports",
        "description": "List agent reports. Body: JSON-RPC 2.0 tools/call named list_my_reports, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "list_my_reports",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "description": "Filter by status: new, reviewed, done (optional)"
              },
              "limit": {
                "type": "number",
                "description": "Max results 1-50 (default: 20)"
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_my_reports"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "description": "Filter by status: new, reviewed, done (optional)"
                          },
                          "limit": {
                            "type": "number",
                            "description": "Max results 1-50 (default: 20)"
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_my_reports",
                  "arguments": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {}
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/update_report_status": {
      "post": {
        "operationId": "mcp_update_report_status",
        "summary": "MCP tool: update_report_status",
        "description": "Update report status. Body: JSON-RPC 2.0 tools/call named update_report_status, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "update_report_status",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "report_id": {
                "type": "string",
                "format": "uuid",
                "description": "Report UUID."
              },
              "status": {
                "type": "string",
                "description": "New status value."
              }
            },
            "required": [
              "report_id",
              "status"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "update_report_status"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "report_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Report UUID."
                          },
                          "status": {
                            "type": "string",
                            "description": "New status value."
                          }
                        },
                        "required": [
                          "report_id",
                          "status"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "update_report_status",
                  "arguments": {
                    "report_id": "00000000-0000-4000-8000-000000000001",
                    "status": "reviewed"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "report_id": "00000000-0000-4000-8000-000000000001",
            "status": "reviewed"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/delete_report": {
      "post": {
        "operationId": "mcp_delete_report",
        "summary": "MCP tool: delete_report",
        "description": "Delete a report. Body: JSON-RPC 2.0 tools/call named delete_report, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "delete_report",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "report_id": {
                "type": "string",
                "format": "uuid",
                "description": "Report UUID."
              }
            },
            "required": [
              "report_id"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "delete_report"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "report_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Report UUID."
                          }
                        },
                        "required": [
                          "report_id"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "delete_report",
                  "arguments": {
                    "report_id": "00000000-0000-4000-8000-000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "report_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/export_customers": {
      "post": {
        "operationId": "mcp_export_customers",
        "summary": "MCP tool: export_customers",
        "description": "Export customers for a program. Body: JSON-RPC 2.0 tools/call named export_customers, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "export_customers",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "token_address"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "export_customers"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "token_address"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "export_customers",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/create_gift_certificate": {
      "post": {
        "operationId": "mcp_create_gift_certificate",
        "summary": "MCP tool: create_gift_certificate",
        "description": "Create gift / welcome certificate (LOYAL-XXXXXX); single or batch up to 100. Body: JSON-RPC 2.0 tools/call named create_gift_certificate, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "create_gift_certificate",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract."
              },
              "usd_amount": {
                "type": "number",
                "description": "Face value in USD for the certificate."
              },
              "points_per_dollar": {
                "type": "number",
                "description": "Conversion rate when minting tokens."
              },
              "max_redemption_percent": {
                "type": "number",
                "description": "Max % of order payable with certificate."
              },
              "title": {
                "type": "string",
                "description": "Certificate title for UI."
              },
              "description": {
                "type": "string",
                "description": "Certificate description for UI."
              },
              "expires_in_days": {
                "type": "number",
                "description": "Validity period from creation."
              },
              "image_url": {
                "type": "string",
                "description": "Optional image URL for wallet / email."
              },
              "quantity": {
                "type": "number",
                "description": "Batch size (1–100, default 1)."
              }
            },
            "required": [
              "token_address",
              "usd_amount"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "create_gift_certificate"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract."
                          },
                          "usd_amount": {
                            "type": "number",
                            "description": "Face value in USD for the certificate."
                          },
                          "points_per_dollar": {
                            "type": "number",
                            "description": "Conversion rate when minting tokens."
                          },
                          "max_redemption_percent": {
                            "type": "number",
                            "description": "Max % of order payable with certificate."
                          },
                          "title": {
                            "type": "string",
                            "description": "Certificate title for UI."
                          },
                          "description": {
                            "type": "string",
                            "description": "Certificate description for UI."
                          },
                          "expires_in_days": {
                            "type": "number",
                            "description": "Validity period from creation."
                          },
                          "image_url": {
                            "type": "string",
                            "description": "Optional image URL for wallet / email."
                          },
                          "quantity": {
                            "type": "number",
                            "description": "Batch size (1–100, default 1)."
                          }
                        },
                        "required": [
                          "token_address",
                          "usd_amount"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "create_gift_certificate",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "usd_amount": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "usd_amount": 10
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/list_gift_certificates": {
      "post": {
        "operationId": "mcp_list_gift_certificates",
        "summary": "MCP tool: list_gift_certificates",
        "description": "List gift certificates issued by your merchant. Body: JSON-RPC 2.0 tools/call named list_gift_certificates, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "list_gift_certificates",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Filter by program token."
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "pending_mint",
                  "redeemed",
                  "revoked",
                  "expired"
                ],
                "description": "Filter by certificate lifecycle status."
              },
              "limit": {
                "type": "number",
                "description": "Max rows to return (default 50)."
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_gift_certificates"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Filter by program token."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "pending_mint",
                              "redeemed",
                              "revoked",
                              "expired"
                            ],
                            "description": "Filter by certificate lifecycle status."
                          },
                          "limit": {
                            "type": "number",
                            "description": "Max rows to return (default 50)."
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_gift_certificates",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/revoke_gift_certificate": {
      "post": {
        "operationId": "mcp_revoke_gift_certificate",
        "summary": "MCP tool: revoke_gift_certificate",
        "description": "Revoke an active gift certificate (active -> revoked). Body: JSON-RPC 2.0 tools/call named revoke_gift_certificate, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "revoke_gift_certificate",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "certificate_id": {
                "type": "string",
                "format": "uuid",
                "description": "Gift certificate UUID."
              }
            },
            "required": [
              "certificate_id"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "revoke_gift_certificate"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "certificate_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Gift certificate UUID."
                          }
                        },
                        "required": [
                          "certificate_id"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "revoke_gift_certificate",
                  "arguments": {
                    "certificate_id": "00000000-0000-4000-8000-000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "certificate_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/mark_gift_certificate_minted": {
      "post": {
        "operationId": "mcp_mark_gift_certificate_minted",
        "summary": "MCP tool: mark_gift_certificate_minted",
        "description": "Mark claimed certificate as minted with on-chain mint tx hash (pending_mint -> redeemed). Body: JSON-RPC 2.0 tools/call named mark_gift_certificate_minted, or just the tool arguments as the JSON body. Send x-api-key: lsk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "lsk_"
        },
        "x-mcp": {
          "tool": "mark_gift_certificate_minted",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "certificate_id": {
                "type": "string",
                "format": "uuid",
                "description": "Gift certificate UUID."
              },
              "transaction_hash": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{64}$",
                "description": "On-chain mint transaction hash."
              }
            },
            "required": [
              "certificate_id",
              "transaction_hash"
            ]
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "mark_gift_certificate_minted"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "certificate_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Gift certificate UUID."
                          },
                          "transaction_hash": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{64}$",
                            "description": "On-chain mint transaction hash."
                          }
                        },
                        "required": [
                          "certificate_id",
                          "transaction_hash"
                        ]
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "mark_gift_certificate_minted",
                  "arguments": {
                    "certificate_id": "00000000-0000-4000-8000-000000000001",
                    "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: mint_not_verified: the transaction does not send token_amount of the certificate token to redeemed_by. Mint that amount to the claimer, then pass that hash.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "404": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: tx_pending: the mint transaction is not confirmed yet (retryable:true). Retry after retry_after_ms (3000).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "certificate_id": "00000000-0000-4000-8000-000000000001",
            "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
          }
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "lsk_...",
          "alternative": "Authorization: Bearer lsk_...",
          "how_to_get": "Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe.",
          "get_key_url": "https://api.loyalspark.online/x402-gateway/register-agent"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "lsk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a merchant lsk_ key: POST https://api.loyalspark.online/x402-gateway/register-agent ($0.01 USDC, Free plan) or SIWE then POST https://api.loyalspark.online/agent-register-siwe."
          }
        ]
      }
    },
    "/x402-gateway/mcp-tools/generate_program_defaults": {
      "post": {
        "operationId": "mcp_generate_program_defaults",
        "summary": "MCP tool: generate_program_defaults",
        "description": "Propose program name/symbol/economics/starter rewards from business context. Body: JSON-RPC 2.0 tools/call named generate_program_defaults, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "generate_program_defaults",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "business_name": {
                "type": "string",
                "description": "Merchant brand or storefront name."
              },
              "category": {
                "type": "string",
                "description": "Business category (cafe, retail, beauty, fitness, etc.)."
              },
              "description": {
                "type": "string",
                "description": "Short description of what the business sells."
              },
              "locale": {
                "type": "string",
                "description": "Optional BCP-47 locale hint (e.g. en-US)."
              },
              "preferred_style": {
                "type": "string",
                "description": "Optional tone hint: modern, classic, playful."
              },
              "target_audience": {
                "type": "string",
                "description": "Optional audience descriptor."
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "generate_program_defaults"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "business_name": {
                            "type": "string",
                            "description": "Merchant brand or storefront name."
                          },
                          "category": {
                            "type": "string",
                            "description": "Business category (cafe, retail, beauty, fitness, etc.)."
                          },
                          "description": {
                            "type": "string",
                            "description": "Short description of what the business sells."
                          },
                          "locale": {
                            "type": "string",
                            "description": "Optional BCP-47 locale hint (e.g. en-US)."
                          },
                          "preferred_style": {
                            "type": "string",
                            "description": "Optional tone hint: modern, classic, playful."
                          },
                          "target_audience": {
                            "type": "string",
                            "description": "Optional audience descriptor."
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "generate_program_defaults",
                  "arguments": {
                    "business_name": "Demo Cafe",
                    "category": "cafe"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "business_name": "Demo Cafe",
            "category": "cafe"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/mcp-tools/get_program_workflow_status": {
      "post": {
        "operationId": "mcp_get_program_workflow_status",
        "summary": "MCP tool: get_program_workflow_status",
        "description": "Program lifecycle step + next_actions[] for autonomous orchestration. Body: JSON-RPC 2.0 tools/call named get_program_workflow_status, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Merchant MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "lsk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "get_program_workflow_status",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Optional loyalty token address. When omitted, uses the most recent program owned by the agent."
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "get_program_workflow_status"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Optional loyalty token address. When omitted, uses the most recent program owned by the agent."
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "get_program_workflow_status",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/get_recipient_profile": {
      "post": {
        "operationId": "mcp_recipient_get_recipient_profile",
        "summary": "MCP tool: get_recipient_profile",
        "description": "Recipient agent profile (rwk_ bound wallet). Body: JSON-RPC 2.0 tools/call named get_recipient_profile, or just the tool arguments as the JSON body. Send x-api-key: rwk_... with the payment (without it the call is not charged and fails).",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "apiKey",
          "header": "x-api-key",
          "prefix": "rwk_"
        },
        "x-mcp": {
          "tool": "get_recipient_profile",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {}
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "get_recipient_profile"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "get_recipient_profile",
                  "arguments": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {}
        },
        "x-api-key-required": {
          "header": "x-api-key",
          "required": true,
          "format": "rwk_...",
          "alternative": "Authorization: Bearer rwk_...",
          "how_to_get": "Get a holder rwk_ key (free): POST https://api.loyalspark.online/siwe-nonce, sign SIWE on chain 8453, then POST https://api.loyalspark.online/recipient-api/register.",
          "get_key_url": "https://api.loyalspark.online/recipient-api/register"
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "rwk_...",
            "description": "Required even with payment (paying without it is not charged but fails). Get a holder rwk_ key (free): POST https://api.loyalspark.online/siwe-nonce, sign SIWE on chain 8453, then POST https://api.loyalspark.online/recipient-api/register."
          }
        ]
      }
    },
    "/x402-gateway/recipient-mcp-tools/list_my_loyalty_balances": {
      "post": {
        "operationId": "mcp_recipient_list_my_loyalty_balances",
        "summary": "MCP tool: list_my_loyalty_balances",
        "description": "All loyalty tier balances for your wallet. Body: JSON-RPC 2.0 tools/call named list_my_loyalty_balances, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "list_my_loyalty_balances",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {}
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_my_loyalty_balances"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_my_loyalty_balances",
                  "arguments": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {}
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/get_my_loyalty_balance": {
      "post": {
        "operationId": "mcp_recipient_get_my_loyalty_balance",
        "summary": "MCP tool: get_my_loyalty_balance",
        "description": "Balance and tier for one loyalty token. Body: JSON-RPC 2.0 tools/call named get_my_loyalty_balance, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "get_my_loyalty_balance",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program B20/ERC-20 contract on Base. Defaults to the demo LSCSC token when the call has no input."
              }
            },
            "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
            "x-bare-call-default": "inject"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "get_my_loyalty_balance"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program B20/ERC-20 contract on Base. Defaults to the demo LSCSC token when the call has no input."
                          }
                        },
                        "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
                        "x-bare-call-default": "inject"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "get_my_loyalty_balance",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/prepare_loyalty_token_transfer": {
      "post": {
        "operationId": "mcp_recipient_prepare_loyalty_token_transfer",
        "summary": "MCP tool: prepare_loyalty_token_transfer",
        "description": "B20/ERC-20 transfer calldata for the holder. Body: JSON-RPC 2.0 tools/call named prepare_loyalty_token_transfer, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "prepare_loyalty_token_transfer",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
              },
              "to": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Recipient wallet address."
              },
              "to_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Alias for to (same as REST to_address)."
              },
              "amount": {
                "type": "number",
                "description": "Whole-token amount to transfer."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "token_address",
                  "amount"
                ],
                "anyOf": [
                  {
                    "required": [
                      "to"
                    ]
                  },
                  {
                    "required": [
                      "to_address"
                    ]
                  }
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "prepare_loyalty_token_transfer"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
                          },
                          "to": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Recipient wallet address."
                          },
                          "to_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Alias for to (same as REST to_address)."
                          },
                          "amount": {
                            "type": "number",
                            "description": "Whole-token amount to transfer."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "token_address",
                              "amount"
                            ],
                            "anyOf": [
                              {
                                "required": [
                                  "to"
                                ]
                              },
                              {
                                "required": [
                                  "to_address"
                                ]
                              }
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "prepare_loyalty_token_transfer",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "amount": 10,
                    "to": "0x0000000000000000000000000000000000000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "amount": 10,
            "to": "0x0000000000000000000000000000000000000002"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/list_rewards_for_program": {
      "post": {
        "operationId": "mcp_recipient_list_rewards_for_program",
        "summary": "MCP tool: list_rewards_for_program",
        "description": "Redeemable rewards for a program you have activity on. Body: JSON-RPC 2.0 tools/call named list_rewards_for_program, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "list_rewards_for_program",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
              }
            },
            "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
            "x-bare-call-default": "inject"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_rewards_for_program"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
                          }
                        },
                        "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
                        "x-bare-call-default": "inject"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_rewards_for_program",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/list_my_vouchers": {
      "post": {
        "operationId": "mcp_recipient_list_my_vouchers",
        "summary": "MCP tool: list_my_vouchers",
        "description": "Vouchers for your wallet. Body: JSON-RPC 2.0 tools/call named list_my_vouchers, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "list_my_vouchers",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {}
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_my_vouchers"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_my_vouchers",
                  "arguments": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {}
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/redeem_my_reward": {
      "post": {
        "operationId": "mcp_recipient_redeem_my_reward",
        "summary": "MCP tool: redeem_my_reward",
        "description": "Redeem reward with transfer tx hash. Body: JSON-RPC 2.0 tools/call named redeem_my_reward, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "redeem_my_reward",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "reward_id": {
                "type": "string",
                "format": "uuid",
                "description": "Reward UUID from list_rewards_for_program."
              },
              "transaction_hash": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{64}$",
                "description": "On-chain transfer tx paying the reward token cost."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "reward_id",
                  "transaction_hash"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "redeem_my_reward"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "reward_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Reward UUID from list_rewards_for_program."
                          },
                          "transaction_hash": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{64}$",
                            "description": "On-chain transfer tx paying the reward token cost."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "reward_id",
                              "transaction_hash"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "redeem_my_reward",
                  "arguments": {
                    "reward_id": "00000000-0000-4000-8000-000000000001",
                    "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "404": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "reward_id": "00000000-0000-4000-8000-000000000001",
            "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/list_p2p_offers": {
      "post": {
        "operationId": "mcp_recipient_list_p2p_offers",
        "summary": "MCP tool: list_p2p_offers",
        "description": "List P2P offers. Body: JSON-RPC 2.0 tools/call named list_p2p_offers, or just the tool arguments as the JSON body. Payment alone gives access; do not send an API key.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "none",
          "note": "Payment alone gives access; do not send an API key."
        },
        "x-mcp": {
          "tool": "list_p2p_offers",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Optional filter: offers involving this token."
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_p2p_offers"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Optional filter: offers involving this token."
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_p2p_offers",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/create_p2p_offer": {
      "post": {
        "operationId": "mcp_recipient_create_p2p_offer",
        "summary": "MCP tool: create_p2p_offer",
        "description": "Create P2P swap intent for B20/ERC-20 loyalty tokens. Body: JSON-RPC 2.0 tools/call named create_p2p_offer, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "create_p2p_offer",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "offer_token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Token you are offering. Defaults to the demo LSCSC token when the call has no input."
              },
              "offer_amount": {
                "type": "number",
                "description": "Amount of offer token (whole units)."
              },
              "request_token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Token you want in return. Defaults to the demo LSCSC token when the call has no input."
              },
              "request_amount": {
                "type": "number",
                "description": "Amount of request token (whole units)."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "offer_token_address",
                  "offer_amount",
                  "request_token_address",
                  "request_amount"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "create_p2p_offer"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "offer_token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Token you are offering. Defaults to the demo LSCSC token when the call has no input."
                          },
                          "offer_amount": {
                            "type": "number",
                            "description": "Amount of offer token (whole units)."
                          },
                          "request_token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Token you want in return. Defaults to the demo LSCSC token when the call has no input."
                          },
                          "request_amount": {
                            "type": "number",
                            "description": "Amount of request token (whole units)."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "offer_token_address",
                              "offer_amount",
                              "request_token_address",
                              "request_amount"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "create_p2p_offer",
                  "arguments": {
                    "offer_token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
                    "offer_amount": 10,
                    "request_token_address": "0xb2000000000000000000002a96dcb4274f5493fe",
                    "request_amount": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_amount: a present amount is 0, negative or not a number (field, min_exclusive:0). Send a positive number. insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "offer_token_address": "0xb2000000000000000000008ce542828ec5f09bb7",
            "offer_amount": 10,
            "request_token_address": "0xb2000000000000000000002a96dcb4274f5493fe",
            "request_amount": 10
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/accept_p2p_offer": {
      "post": {
        "operationId": "mcp_recipient_accept_p2p_offer",
        "summary": "MCP tool: accept_p2p_offer",
        "description": "Accept a P2P offer. Body: JSON-RPC 2.0 tools/call named accept_p2p_offer, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "accept_p2p_offer",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "offer_id": {
                "type": "string",
                "format": "uuid",
                "description": "P2P offer UUID from list_p2p_offers."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "offer_id"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "accept_p2p_offer"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "offer_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "P2P offer UUID from list_p2p_offers."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "offer_id"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "accept_p2p_offer",
                  "arguments": {
                    "offer_id": "00000000-0000-4000-8000-000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved. onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "404": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: offer_reserved: another wallet holds the 30-minute reservation. Retry after reserved_until, or pick another offer from GET /offers. onchain_offer_unlinked: the order-book row has no escrow offerId yet, so it cannot be reserved. Pass onchain_offer_id or create_tx_hash, or pick another offer. Nothing was reserved. onchain_offer_inactive: the escrow offer is already filled or cancelled on-chain, so fillOffer would revert. Pick another offer. onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "offer_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/cancel_p2p_offer": {
      "post": {
        "operationId": "mcp_recipient_cancel_p2p_offer",
        "summary": "MCP tool: cancel_p2p_offer",
        "description": "Cancel your P2P offer. Body: JSON-RPC 2.0 tools/call named cancel_p2p_offer, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "cancel_p2p_offer",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "offer_id": {
                "type": "string",
                "format": "uuid",
                "description": "P2P offer UUID to cancel."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "offer_id"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "cancel_p2p_offer"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "offer_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "P2P offer UUID to cancel."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "offer_id"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "cancel_p2p_offer",
                  "arguments": {
                    "offer_id": "00000000-0000-4000-8000-000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]. If the escrow offer is already inactive on-chain (onchain_offer_inactive), cancel still closes the order-book row: 200 {status:\"cancelled\", onchain_active:false} with no cancelOffer calldata. The creator can cancel while another wallet holds a reservation: 200 with reservation_released:true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash. payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "offer_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/lookup_gift_certificate": {
      "post": {
        "operationId": "mcp_recipient_lookup_gift_certificate",
        "summary": "MCP tool: lookup_gift_certificate",
        "description": "Preview a gift certificate by code (LOYAL-XXXXXX) without claiming. Body: JSON-RPC 2.0 tools/call named lookup_gift_certificate, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "lookup_gift_certificate",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Gift certificate code (LOYAL-XXXX-XXXX)."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "code"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "lookup_gift_certificate"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Gift certificate code (LOYAL-XXXX-XXXX)."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "code"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "lookup_gift_certificate",
                  "arguments": {
                    "code": "LS-DEMO-0001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "code": "LS-DEMO-0001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/claim_gift_certificate": {
      "post": {
        "operationId": "mcp_recipient_claim_gift_certificate",
        "summary": "MCP tool: claim_gift_certificate",
        "description": "Claim an active gift certificate by code (binds it to your wallet). Body: JSON-RPC 2.0 tools/call named claim_gift_certificate, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "claim_gift_certificate",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Gift certificate code to claim."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "code"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "claim_gift_certificate"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Gift certificate code to claim."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "code"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "claim_gift_certificate",
                  "arguments": {
                    "code": "LS-DEMO-0001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "code": "LS-DEMO-0001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/list_my_gift_certificates": {
      "post": {
        "operationId": "mcp_recipient_list_my_gift_certificates",
        "summary": "MCP tool: list_my_gift_certificates",
        "description": "List gift certificates claimed by your wallet. Body: JSON-RPC 2.0 tools/call named list_my_gift_certificates, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "list_my_gift_certificates",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "pending_mint",
                  "redeemed",
                  "revoked",
                  "expired"
                ],
                "description": "Filter by certificate lifecycle status."
              },
              "limit": {
                "type": "number",
                "description": "Max rows to return (default 50)."
              }
            }
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "list_my_gift_certificates"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "pending_mint",
                              "redeemed",
                              "revoked",
                              "expired"
                            ],
                            "description": "Filter by certificate lifecycle status."
                          },
                          "limit": {
                            "type": "number",
                            "description": "Max rows to return (default 50)."
                          }
                        }
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "list_my_gift_certificates",
                  "arguments": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {}
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/get_reward_workflow_status": {
      "post": {
        "operationId": "mcp_recipient_get_reward_workflow_status",
        "summary": "MCP tool: get_reward_workflow_status",
        "description": "Reward redemption step + next_actions[] for the holder. Body: JSON-RPC 2.0 tools/call named get_reward_workflow_status, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "get_reward_workflow_status",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "token_address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$",
                "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
              },
              "reward_id": {
                "type": "string",
                "format": "uuid",
                "description": "Optional specific reward UUID to focus the plan on."
              }
            },
            "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
            "x-bare-call-default": "inject"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "get_reward_workflow_status"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "token_address": {
                            "type": "string",
                            "pattern": "^0x[a-fA-F0-9]{40}$",
                            "description": "Loyalty program token contract. Defaults to the demo LSCSC token when the call has no input."
                          },
                          "reward_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Optional specific reward UUID to focus the plan on."
                          }
                        },
                        "description": "A call with no input is answered for the demo program LSCSC (0xb2000000000000000000008ce542828ec5f09bb7). Pass your own token_address for your own result.",
                        "x-bare-call-default": "inject"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "get_reward_workflow_status",
                  "arguments": {
                    "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "token_address": "0xb2000000000000000000008ce542828ec5f09bb7"
          }
        },
        "x-api-key-required": false
      }
    },
    "/x402-gateway/recipient-mcp-tools/prepare_reward_redemption": {
      "post": {
        "operationId": "mcp_recipient_prepare_reward_redemption",
        "summary": "MCP tool: prepare_reward_redemption",
        "description": "Prepare B20/ERC-20 transfer calldata + redemption workflow for a reward. Body: JSON-RPC 2.0 tools/call named prepare_reward_redemption, or just the tool arguments as the JSON body. Payment alone works (the paying wallet is the caller); x-api-key is optional.",
        "tags": [
          "Recipient MCP"
        ],
        "x-auth": {
          "type": "payer-or-apiKey",
          "header": "x-api-key",
          "prefix": "rwk_",
          "note": "Payment alone works: the paying wallet is the caller. An x-api-key is optional."
        },
        "x-mcp": {
          "tool": "prepare_reward_redemption",
          "transport": "streamable-http",
          "server": "https://api.loyalspark.online/recipient-loyalty-mcp",
          "inputSchema": {
            "type": "object",
            "properties": {
              "reward_id": {
                "type": "string",
                "format": "uuid",
                "description": "Reward UUID from list_rewards_for_program."
              }
            },
            "anyOf": [
              {
                "maxProperties": 0
              },
              {
                "required": [
                  "reward_id"
                ]
              }
            ],
            "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
            "x-bare-call-default": "view"
          }
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {
                "method": "USDC",
                "intent": "pay-per-call",
                "currency": "USD"
              }
            }
          ]
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string",
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "const": "prepare_reward_redemption"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "reward_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Reward UUID from list_rewards_for_program."
                          }
                        },
                        "anyOf": [
                          {
                            "maxProperties": 0
                          },
                          {
                            "required": [
                              "reward_id"
                            ]
                          }
                        ],
                        "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                        "x-bare-call-default": "view"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "jsonrpc",
                  "method",
                  "params"
                ]
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/call",
                "params": {
                  "name": "prepare_reward_redemption",
                  "arguments": {
                    "reward_id": "00000000-0000-4000-8000-000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response with result.content[]",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — returns x402 challenge with `accepts[]`"
          },
          "409": {
            "description": "Paid MCP tool error (JSON-RPC result isError:true, HTTP status from error_code, not charged). error_code: payment_already_used: this x402 PAYMENT-SIGNATURE already paid for a call (replay guard on paid writes). charged:false. Sign a new payment for each call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-example-input": {
          "kind": "arguments",
          "value": {
            "reward_id": "00000000-0000-4000-8000-000000000001"
          }
        },
        "x-api-key-required": false
      }
    },
    "/agent-api/me": {
      "get": {
        "operationId": "direct_get_agent_api_me",
        "summary": "Get agent profile, scopes, plan and wallet",
        "description": "Returns the merchant agent's profile (owner address, plan, API scopes, wallet metadata). Free: identity-only. Direct /agent-api/me on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "agent"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "agent": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "owner_address": {
                          "type": "string"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": []
      }
    },
    "/agent-api/programs": {
      "get": {
        "operationId": "direct_get_agent_api_programs",
        "summary": "List loyalty programs",
        "description": "Lists all loyalty programs owned by the authenticated merchant agent (active + expired). Direct /agent-api/programs on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "programs"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "programs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": []
      },
      "post": {
        "operationId": "direct_post_agent_api_programs",
        "summary": "Get calldata to deploy a loyalty token",
        "description": "Default: B20 factory calldata (createB20 on 0xB20f…, one tx, active after register). Legacy: set token_standard erc20 for LoyaltyTokenFactory 0x5F3DdB… + activation. Agent broadcasts with its wallet (or /agent-wallet), then POST /register-program. The response keeps contract_call and adds tx {to, data, value: 0x0, chainId: 8453}. deploy_validity.unsigned_tx_expires_at is null: salt includes Date.now(), so each prepare is a new token address and the unsigned payload does not expire. program_expires_at is the loyalty program lifetime applied at register. Direct /agent-api/programs on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "contract_call": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "tx": {
                      "type": "object",
                      "required": [
                        "to",
                        "data",
                        "value",
                        "chainId"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string",
                          "example": "0x0"
                        },
                        "chainId": {
                          "type": "integer",
                          "example": 8453,
                          "description": "Base mainnet. A number, not the string \"8453\"."
                        }
                      }
                    },
                    "token_address": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "symbol"
                ],
                "additionalProperties": true,
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 50,
                    "description": "Loyalty program name."
                  },
                  "symbol": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 5,
                    "description": "Token symbol (2-5 chars)."
                  },
                  "expiration_days": {
                    "type": "number",
                    "minimum": 1,
                    "description": "Program lifetime in days (default 365)."
                  },
                  "token_standard": {
                    "type": "string",
                    "enum": [
                      "b20",
                      "erc20"
                    ],
                    "default": "b20",
                    "description": "b20 (default): Base-native B20, single tx. erc20: legacy factory, needs activate-program."
                  },
                  "agent_wallet_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "(B20) Extra wallet granted MINT_ROLE in the deploy tx."
                  },
                  "extra_minters": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^0x[a-fA-F0-9]{40}$",
                      "description": "EVM address on Base (eip155:8453)."
                    },
                    "description": "(B20) More addresses granted MINT_ROLE in the same deploy tx."
                  },
                  "use_agent_wallet": {
                    "type": "boolean",
                    "description": "Deploy as the agent's CDP MPC wallet instead of the owner address."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/rewards": {
      "get": {
        "operationId": "direct_get_agent_api_rewards",
        "summary": "List rewards for a program",
        "description": "Returns the reward catalog for a given loyalty token (token_address required as query). Direct /agent-api/rewards on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rewards"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "rewards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
          },
          {
            "name": "all",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Send all=true instead of token_address to list the rewards of every program you own."
          }
        ]
      },
      "post": {
        "operationId": "direct_post_agent_api_rewards",
        "summary": "Create a redeemable reward",
        "description": "Creates a reward in the merchant catalog (name, description, cost in points, optional stock and validity). Direct /agent-api/rewards on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "reward": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: invalid_amount: a present amount is 0, negative or not a number (field, min_exclusive:0). Send a positive number.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "cost",
                  "token_address"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "cost": {
                    "type": "number",
                    "minimum": 1,
                    "description": "Loyalty-token cost to redeem."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/balance": {
      "get": {
        "operationId": "direct_get_agent_api_balance",
        "summary": "Get on-chain token balance, off-chain ledger, virtual pending points, and tier",
        "description": "current_balance / current is the live on-chain balanceOf on Base. onchain_balance repeats it (null if the chain read failed, then current_balance falls back to the ledger and balance_basis is offchain_ledger). offchain_ledger_balance is customer_tier_status, written when POST /mint/confirm verifies the recipient Transfer or a CDP server mint settles, so it can lag the chain. Also returns tokens_earned_total, tier, and unminted virtual points from store_points_ledger. Query customer_address (0x Base wallet or customer email), or the aliases customer_email, recipient_email, email, address, and wallet_address. If the customer email has not signed in to create a Base wallet yet, returns status virtual_pending_signup and virtual_pending_balance. For an email lookup the wallet is shown in full when the customer already has a record with your programs, otherwise masked (customer_wallet_masked). A missing query param is HTTP 400 missing_fields with example and next_action. Direct /agent-api/balance on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "balance"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "balance": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "current_balance": {
                          "type": "number"
                        },
                        "current": {
                          "type": "number"
                        },
                        "onchain_balance": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "offchain_ledger_balance": {
                          "type": "number"
                        },
                        "balance_basis": {
                          "type": "string"
                        },
                        "tokens_earned_total": {
                          "type": "number"
                        },
                        "total_earned": {
                          "type": "number"
                        },
                        "virtual_pending_balance": {
                          "type": "number"
                        },
                        "tier": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true
                        },
                        "token_address": {
                          "type": "string"
                        },
                        "customer_address": {
                          "type": "string"
                        }
                      }
                    },
                    "balance_source": {
                      "type": "string"
                    },
                    "balance_source_note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
          },
          {
            "name": "customer_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453)."
          }
        ]
      }
    },
    "/agent-api/customers": {
      "get": {
        "operationId": "direct_get_agent_api_customers",
        "summary": "List customers for a program",
        "description": "Union of voucher holders, customer_tier_status rows, and completed mint recipients for the token. The platform fee wallet is excluded. total / total_customers is the same count analytics and MCP export_customers report; email-only store customers are listed separately in store_customers. Wallets are shown in full (these are your customers). Owner only: token_address must be a program your wallet (key owner or keyless x402 payer) owns; otherwise 404 program_not_found and nothing is charged. Direct /agent-api/customers on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "customers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "total": {
                      "type": "number"
                    },
                    "total_customers": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
          }
        ]
      }
    },
    "/agent-api/mints": {
      "get": {
        "operationId": "direct_get_agent_api_mints",
        "summary": "List mint intents",
        "description": "Mint intents for this key's merchant wallets. Query token_address optional, status pending (transaction_hash null) or completed. Pending rows include next_action POST /mint/confirm. Not on x402 or MPP. Direct /agent-api/mints on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "mints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": []
      }
    },
    "/agent-api/fee-obligations": {
      "get": {
        "operationId": "direct_get_agent_api_fee_obligations",
        "summary": "List protocol-fee obligations",
        "description": "Obligations for this API key. Query status=unpaid (alias of pending), pending, settled, or failed. Each unpaid row includes next_action with the POST /mint/confirm fields. A settled row whose mint intent is still pending returns customer_ledger pending_recipient_tx and next_action POST /mint/confirm with recipient_tx_hash. Not on x402 or MPP. Direct /agent-api/fee-obligations on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "obligations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": []
      }
    },
    "/agent-api/vouchers": {
      "get": {
        "operationId": "direct_get_agent_api_vouchers",
        "summary": "List vouchers issued by the merchant",
        "description": "Returns vouchers issued by the authenticated merchant; filterable by customer_address. Direct /agent-api/vouchers on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "vouchers"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "vouchers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453)."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "used",
                "expired",
                "cancelled"
              ]
            },
            "description": "active, used, or expired. Any other value is HTTP 400."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/agent-api/vouchers/status": {
      "get": {
        "tags": [
          "Merchant REST"
        ],
        "operationId": "get_agent_api_vouchers_status",
        "summary": "Public voucher verification",
        "description": "Public endpoint: check whether a voucher code or id is valid, used or expired. No API key required. Anonymous callers are limited to 30 checks per minute per IPv4 /24 or IPv6 /48 (HTTP 429 error_code rate_limited). A live lsk_ key bypasses that anonymous limit. Keyed calls can also use MCP check_voucher_status.",
        "security": [],
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Voucher code. One of code or voucher_id."
          },
          {
            "name": "voucher_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Voucher UUID. One of code or voucher_id."
          }
        ],
        "responses": {
          "200": {
            "description": "Voucher status. Unknown codes are valid:false, not a route 404. RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset are set. A live lsk_ key is not counted against the anonymous limit.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "found": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing code and voucher_id. Body includes error, error_code, missing, example, docs, next_action."
          },
          "429": {
            "description": "Anonymous limit: 30 checks per 60s per IPv4 /24 or IPv6 /48. Keyed lsk_ calls are not subject to this limit. The error field is error_code, never code (code is the voucher code). next_action.url includes the original query, for example ?code=LOYAL-...",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code",
                    "retry_after_s",
                    "limit",
                    "window",
                    "scope",
                    "how_to_avoid",
                    "get_key",
                    "docs",
                    "next_action"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "enum": [
                        "rate_limited"
                      ]
                    },
                    "retry_after_s": {
                      "type": "integer",
                      "example": 60
                    },
                    "limit": {
                      "type": "integer",
                      "example": 30
                    },
                    "window": {
                      "type": "string",
                      "example": "60s"
                    },
                    "scope": {
                      "type": "string",
                      "example": "ipv4 /24 or ipv6 /48"
                    },
                    "how_to_avoid": {
                      "type": "string",
                      "example": "send x-api-key: lsk_... (keyed calls are not subject to this limit) or use MCP check_voucher_status"
                    },
                    "get_key": {
                      "type": "string"
                    },
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/analytics": {
      "get": {
        "operationId": "direct_get_agent_api_analytics",
        "summary": "Program analytics",
        "description": "One row per program you own: total_customers (the same set GET /customers counts), voucher_customers, active customers (30d/7d), vouchers issued and redeemed, tokens spent. Optional query token_address narrows to one program; a program you do not own returns 404 program_not_found and nothing is charged. Direct /agent-api/analytics on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "analytics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "Optional: one of your programs. A program you do not own returns 404 program_not_found (not charged)."
          }
        ]
      }
    },
    "/agent-api/offers": {
      "get": {
        "operationId": "direct_get_agent_api_offers",
        "summary": "List P2P marketplace offers",
        "description": "Returns active P2P swap offers across loyalty tokens (filterable by token_address). Payment alone gives access; do not send an API key. Direct /agent-api/offers on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "offers"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453)."
          }
        ]
      },
      "post": {
        "operationId": "direct_post_agent_api_offers",
        "summary": "Create a P2P swap offer",
        "description": "Creates a P2P swap offer between two loyalty tokens (offer_token / offer_amount ↔ request_token / request_amount). Direct /agent-api/offers on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_amount: a present amount is 0, negative or not a number (field, min_exclusive:0). Send a positive number. insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer_token_address",
                  "offer_amount",
                  "request_token_address",
                  "request_amount"
                ],
                "additionalProperties": true,
                "properties": {
                  "offer_token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "offer_amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "request_token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "request_amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/tx-receipt": {
      "get": {
        "operationId": "direct_get_agent_api_tx_receipt",
        "summary": "Fetch transaction receipt",
        "description": "Fetches a Base L2 transaction receipt by hash. Free helper for agents tracking on-chain confirmations. Direct /agent-api/tx-receipt on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "receipt": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "token_address": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "tx_hash",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{64}$"
            },
            "description": "Base mainnet transaction hash (32-byte hex)."
          },
          {
            "name": "hash",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of tx_hash."
          }
        ]
      }
    },
    "/agent-api/merchant-profile": {
      "get": {
        "operationId": "direct_get_agent_api_merchant_profile",
        "summary": "Read merchant profile",
        "description": "Returns the merchant public profile (name, logo, description) for the authenticated agent owner. Direct /agent-api/merchant-profile on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "profile": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "business_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "use_agent_wallet",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ]
      },
      "post": {
        "operationId": "direct_post_agent_api_merchant_profile",
        "summary": "Create merchant profile",
        "description": "Creates or replaces the merchant public profile for the authenticated agent owner. business_name is always required, also when a profile already exists (400 missing_fields, uncharged on x402); use PUT /merchant-profile for a partial update. Direct /agent-api/merchant-profile on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "profile": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "business_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_url: website or logo_url is not an absolute https:// or http:// URL (javascript:, data: and relative values are rejected). field names the value.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "business_name"
                ],
                "additionalProperties": true,
                "properties": {
                  "business_name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "cafe",
                      "restaurant",
                      "retail",
                      "beauty",
                      "fitness",
                      "grocery",
                      "pharmacy",
                      "entertainment",
                      "services",
                      "education",
                      "travel",
                      "other"
                    ]
                  },
                  "logo_url": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "direct_put_agent_api_merchant_profile",
        "summary": "Update merchant profile",
        "description": "Partial update of merchant profile fields for the authenticated agent owner: send at least one of business_name, category, logo_url, description, website, location, use_agent_wallet. business_name is required only when no profile exists yet (missing_business_name, uncharged on x402). Direct /agent-api/merchant-profile on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "profile": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "business_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_url: website or logo_url is not an absolute https:// or http:// URL (javascript:, data: and relative values are rejected). field names the value.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "minProperties": 1,
                "anyOf": [
                  {
                    "required": [
                      "business_name"
                    ]
                  },
                  {
                    "required": [
                      "category"
                    ]
                  },
                  {
                    "required": [
                      "logo_url"
                    ]
                  },
                  {
                    "required": [
                      "description"
                    ]
                  },
                  {
                    "required": [
                      "website"
                    ]
                  },
                  {
                    "required": [
                      "location"
                    ]
                  },
                  {
                    "required": [
                      "use_agent_wallet"
                    ]
                  }
                ],
                "properties": {
                  "business_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Required only to create a profile that does not exist yet."
                  },
                  "category": {
                    "type": "string"
                  },
                  "logo_url": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/workflow/program-status": {
      "get": {
        "operationId": "direct_get_agent_api_workflow_program_status",
        "summary": "Autonomous program workflow status",
        "description": "Returns the current merchant program lifecycle step and machine-readable next_actions[] for self-orchestration. Direct /agent-api/workflow/program-status on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "workflow"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "program": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    },
                    "examples": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "Optional program token; omit to plan from your first program."
          }
        ]
      }
    },
    "/agent-api/store/codes": {
      "get": {
        "operationId": "direct_get_agent_api_store_codes",
        "summary": "List Shopify discount codes",
        "description": "Shopify discount codes for this merchant. Optional query token_address. Not on x402 or MPP. Direct /agent-api/store/codes on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "codes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "direct_post_agent_api_store_codes",
        "summary": "Use or cancel a Shopify discount code",
        "description": "Body redemption_id and action use or cancel. Scope manage_rewards. Not on x402 or MPP. Direct /agent-api/store/codes on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "codes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/agent-api/store/channel": {
      "get": {
        "operationId": "direct_get_agent_api_store_channel",
        "summary": "Read the store spend channel",
        "description": "Returns channel online, offline, or both. Not on x402 or MPP. Direct /agent-api/store/channel on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "channel": {
                      "type": "string",
                      "enum": [
                        "online",
                        "offline",
                        "both"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": []
      },
      "post": {
        "operationId": "direct_post_agent_api_store_channel",
        "summary": "Set the store spend channel",
        "description": "Body channel online, offline, or both. Scope manage_rewards or mint. Not on x402 or MPP. Direct /agent-api/store/channel on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "channel": {
                      "type": "string",
                      "enum": [
                        "online",
                        "offline",
                        "both"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/agent-api/platform": {
      "get": {
        "operationId": "direct_get_agent_api_platform",
        "summary": "Public platform discovery and capabilities",
        "description": "Public endpoint (no API key, no payment): returns Loyal Spark protocol metadata, chain info, endpoints, pricing, and onboarding steps. Direct /agent-api/platform on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": "number"
                    },
                    "endpoints": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [],
        "parameters": []
      }
    },
    "/agent-api/info": {
      "get": {
        "operationId": "direct_get_agent_api_info",
        "summary": "Public platform discovery alias",
        "description": "Alias of GET /agent-api/platform. Returns public protocol metadata without an API key. Direct /agent-api/info on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": "number"
                    },
                    "endpoints": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [],
        "parameters": []
      }
    },
    "/agent-api/get_platform_info": {
      "get": {
        "operationId": "direct_get_agent_api_get_platform_info",
        "summary": "Public platform discovery alias (MCP tool name)",
        "description": "Alias of GET /agent-api/platform matching the MCP get_platform_info tool name. Direct /agent-api/get_platform_info on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": "number"
                    },
                    "endpoints": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [],
        "parameters": []
      }
    },
    "/agent-api/resolve-recipient": {
      "get": {
        "operationId": "direct_get_agent_api_resolve_recipient",
        "summary": "Resolve a customer email or identifier to a Base 0x wallet address",
        "description": "Resolves a customer email or 0x address to a Base wallet. Wallet: recipient_address (aliases address, wallet, wallet_address, customer_address, recipient). Email: recipient_email (aliases email, customer_email). Or identifier (email, 0x, @username). Scope read or mint. Privacy: the full wallet is returned only if you sent the 0x address or the customer has a record with one of your programs; else wallet_masked:true and 0x1234…abcd. /mint and /earn take the email directly. Direct /agent-api/resolve-recipient on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "wallet_address": {
                      "type": "string"
                    },
                    "wallet_masked": {
                      "type": "boolean"
                    },
                    "email": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "recipient_email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Customer email (aliases: email, customer_email)."
          },
          {
            "name": "recipient_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "Customer 0x wallet (aliases: address, wallet, wallet_address, customer_address)."
          },
          {
            "name": "identifier",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Email, 0x wallet, or @username."
          },
          {
            "name": "address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of recipient_address."
          },
          {
            "name": "wallet",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of recipient_address."
          },
          {
            "name": "wallet_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of recipient_address."
          },
          {
            "name": "customer_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of recipient_address."
          },
          {
            "name": "recipient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "0x wallet or email."
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of recipient_email."
          },
          {
            "name": "customer_email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias of recipient_email."
          }
        ]
      },
      "post": {
        "operationId": "direct_post_agent_api_resolve_recipient",
        "summary": "Resolve a customer email or identifier to a Base 0x wallet address",
        "description": "POST body, same fields as GET: recipient_address (aliases address, wallet, wallet_address, customer_address, recipient), recipient_email (aliases email, customer_email), or identifier (email, 0x, @username). Scope read or mint. Privacy: the full wallet is returned only if you sent the 0x address or the customer has a record with one of your programs; otherwise wallet_masked:true and 0x1234…abcd. /mint and /earn take the email directly. Direct /agent-api/resolve-recipient on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "wallet_address": {
                      "type": "string"
                    },
                    "wallet_masked": {
                      "type": "boolean"
                    },
                    "email": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "recipient_address": {
                    "type": "string",
                    "description": "0x Base wallet (canonical wallet field)."
                  },
                  "address": {
                    "type": "string",
                    "description": "Alias of recipient_address."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "Alias of recipient_address."
                  },
                  "wallet_address": {
                    "type": "string",
                    "description": "Alias of recipient_address."
                  },
                  "customer_address": {
                    "type": "string",
                    "description": "Alias of recipient_address."
                  },
                  "recipient": {
                    "type": "string",
                    "description": "0x wallet or email."
                  },
                  "recipient_email": {
                    "type": "string",
                    "description": "Customer email (canonical email field)."
                  },
                  "email": {
                    "type": "string",
                    "description": "Alias of recipient_email."
                  },
                  "customer_email": {
                    "type": "string",
                    "description": "Alias of recipient_email."
                  },
                  "identifier": {
                    "type": "string",
                    "description": "Email, 0x wallet, or @username."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/register-program": {
      "post": {
        "operationId": "direct_post_agent_api_register_program",
        "summary": "Register a deployed loyalty token in the database",
        "description": "Persists a deployed loyalty token (name, symbol, token_address, optional cashback_rate / points_per_dollar). deploy_tx_hash is documented in the field catalog and is not stored: pass that hash to GET /tx-receipt to read token_address, then send token_address here. Next step for B20 uses recipient_address. Direct /agent-api/register-program on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "program": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "token_address": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "symbol",
                  "token_address"
                ],
                "additionalProperties": true,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "expiration_days": {
                    "type": "number",
                    "minimum": 1
                  },
                  "cashback_rate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100,
                    "description": "Cashback % of purchase amount."
                  },
                  "points_per_dollar": {
                    "type": "number",
                    "minimum": 0
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/update-program-config": {
      "post": {
        "operationId": "direct_post_agent_api_update_program_config",
        "summary": "Update default cashback / points-per-dollar",
        "description": "Updates the loyalty program economics (cashback_rate 0-50%, points_per_dollar). Owner agent only. Direct /agent-api/update-program-config on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "program": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "cashback_rate": {
                      "type": "number"
                    },
                    "points_per_dollar": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "cashback_rate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "points_per_dollar": {
                    "type": "number",
                    "minimum": 0
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/activate-program": {
      "post": {
        "operationId": "direct_post_agent_api_activate_program",
        "summary": "Get activation calldata for an inactive program",
        "description": "Returns calldata to unpause a program and enable mint operations. Caller submits the on-chain tx. Each step keeps contract_call and adds tx. The response also includes calls [{to, data, value}] (ERC-5792). Direct /agent-api/activate-program on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "contract_call": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "tx": {
                      "type": "object",
                      "required": [
                        "to",
                        "data",
                        "value",
                        "chainId"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string",
                          "example": "0x0"
                        },
                        "chainId": {
                          "type": "integer",
                          "example": 8453,
                          "description": "Base mainnet. A number, not the string \"8453\"."
                        }
                      }
                    },
                    "calls": {
                      "type": "array",
                      "description": "ERC-5792 calls. Submit in order.",
                      "items": {
                        "type": "object",
                        "required": [
                          "to",
                          "data",
                          "value"
                        ],
                        "properties": {
                          "to": {
                            "type": "string"
                          },
                          "data": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string",
                            "example": "0x0"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/program-status": {
      "post": {
        "operationId": "direct_post_agent_api_program_status",
        "summary": "Set program status in the database",
        "description": "Sets the database status (active / paused / archived) of a loyalty program. Direct /agent-api/program-status on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "program": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "previous_status": {
                          "type": "string"
                        },
                        "new_status": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address",
                  "status"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "expired",
                      "cancelled"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/mint": {
      "post": {
        "operationId": "direct_post_agent_api_mint",
        "summary": "Mint loyalty tokens (fee-first calls[] or virtual points for unregistered email)",
        "description": "Accepts recipient_address as a 0x Base wallet address or customer email (or pass recipient_email to automatically resolve the customer's wallet). If the email is not registered yet, credits virtual loyalty points in store_points_ledger (status virtual_pending_signup, mint_status unminted, calls []) which automatically bind to the customer's Base wallet and convert to on-chain B20 tokens when they sign in. For registered wallets, returns a fee-first calls[] bundle (protocol fee mint first, then recipient; each call has to, data, value 0x0) plus fee_obligation_id, fee_amount_wei, execution (EIP-5792 atomic or EOA sequential), and next_actions. A single-call bundle also includes tx {to, data, value: 0x0, chainId: 8453}. Addresses in tx.to and calls[].to are EIP-55. The protocol fee is a decimal amount of the merchant's own loyalty token (18 decimals), not USDC. Confirm with POST /agent-api/mint/confirm { obligation_id, fee_tx_hash, recipient_tx_hash }; 5+ obligations unpaid for over 60 minutes block further mints with HTTP 402. Direct /agent-api/mint on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "mint": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "fee_percent": {
                      "type": "number"
                    },
                    "fee_amount": {
                      "type": "number"
                    },
                    "fee_amount_wei": {
                      "type": "string"
                    },
                    "fee_currency": {
                      "type": "string",
                      "example": "loyalty_tokens"
                    },
                    "fee_wallet": {
                      "type": "string"
                    },
                    "fee_obligation_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "calls": {
                      "type": "array",
                      "description": "ERC-5792 calls. Submit in order.",
                      "items": {
                        "type": "object",
                        "required": [
                          "to",
                          "data",
                          "value"
                        ],
                        "properties": {
                          "to": {
                            "type": "string"
                          },
                          "data": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string",
                            "example": "0x0"
                          }
                        }
                      }
                    },
                    "tx": {
                      "type": "object",
                      "required": [
                        "to",
                        "data",
                        "value",
                        "chainId"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string",
                          "example": "0x0"
                        },
                        "chainId": {
                          "type": "integer",
                          "example": 8453,
                          "description": "Base mainnet. A number, not the string \"8453\"."
                        }
                      }
                    },
                    "execution": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "next_actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address",
                  "amount"
                ],
                "additionalProperties": true,
                "anyOf": [
                  {
                    "required": [
                      "recipient_address"
                    ]
                  },
                  {
                    "required": [
                      "recipient_email"
                    ]
                  }
                ],
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "recipient_address": {
                    "type": "string",
                    "description": "Customer 0x wallet or email. Alias: recipient_email."
                  },
                  "recipient": {
                    "type": "string",
                    "description": "Legacy alias for recipient_address."
                  },
                  "recipient_email": {
                    "type": "string",
                    "description": "Customer email resolved to Base wallet."
                  },
                  "amount": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000000
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/earn": {
      "post": {
        "operationId": "direct_post_agent_api_earn",
        "summary": "Record an earn / cashback for a purchase (0x wallet or email)",
        "description": "Computes and mints loyalty points for a purchase (uses program's cashback_rate and points_per_dollar). Accepts customer_address (0x wallet or email) or customer_email. If the email is not registered yet, credits virtual loyalty points in store_points_ledger (status virtual_pending_signup, mint_status unminted, calls []) that automatically convert to B20 tokens on Base when the customer signs in. For registered wallets, uses the same fee-first calls[] plus confirm model as /mint. A single-call bundle also includes tx {to, data, value: 0x0, chainId: 8453}. Direct /agent-api/earn on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "calls": {
                      "type": "array",
                      "description": "ERC-5792 calls. Submit in order.",
                      "items": {
                        "type": "object",
                        "required": [
                          "to",
                          "data",
                          "value"
                        ],
                        "properties": {
                          "to": {
                            "type": "string"
                          },
                          "data": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string",
                            "example": "0x0"
                          }
                        }
                      }
                    },
                    "tx": {
                      "type": "object",
                      "required": [
                        "to",
                        "data",
                        "value",
                        "chainId"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string",
                          "example": "0x0"
                        },
                        "chainId": {
                          "type": "integer",
                          "example": 8453,
                          "description": "Base mainnet. A number, not the string \"8453\"."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address",
                  "customer_address",
                  "purchase_amount"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "customer_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "purchase_amount": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Purchase amount in fiat units (USD)."
                  },
                  "cashback_rate": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100,
                    "description": "Optional override of program cashback %."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/transfer": {
      "post": {
        "operationId": "direct_post_agent_api_transfer",
        "summary": "Get transfer calldata for loyalty tokens",
        "description": "Returns B20/ERC-20 transfer calldata for the merchant agent to move loyalty tokens. The response keeps contract_call and adds tx {to, data, value: 0x0, chainId: 8453}. Direct /agent-api/transfer on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "calls": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "tx": {
                      "type": "object",
                      "required": [
                        "to",
                        "data",
                        "value",
                        "chainId"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string",
                          "example": "0x0"
                        },
                        "chainId": {
                          "type": "integer",
                          "example": 8453,
                          "description": "Base mainnet. A number, not the string \"8453\"."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token_address",
                  "to_address",
                  "amount"
                ],
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "to_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "amount": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000000
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/redeem-reward": {
      "post": {
        "operationId": "direct_post_agent_api_redeem_reward",
        "summary": "Redeem a reward for a customer",
        "description": "Burns reward cost from customer balance and issues a voucher; returns voucher code and id. Direct /agent-api/redeem-reward on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "voucher": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "voucher_code": {
                      "type": "string"
                    },
                    "voucher_id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error. error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reward_id",
                  "customer_address",
                  "transaction_hash"
                ],
                "additionalProperties": true,
                "properties": {
                  "reward_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "customer_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "On-chain transfer tx hash used to verify the redemption."
                  },
                  "tx_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Alias of transaction_hash."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/vouchers/use": {
      "post": {
        "operationId": "direct_post_agent_api_vouchers_use",
        "summary": "Mark a voucher as used",
        "description": "Marks a previously-issued voucher as used (consumed at point-of-sale). Direct /agent-api/vouchers/use on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "voucher": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error. error_code: voucher_already_used: the voucher was already redeemed (used_at). Do not retry it; check status with GET /vouchers/status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Either voucher_code or voucher_id is required.",
                "properties": {
                  "voucher_code": {
                    "type": "string",
                    "description": "Voucher code (LOYAL-XXXX...)."
                  },
                  "code": {
                    "type": "string",
                    "description": "Alias of voucher_code."
                  },
                  "voucher_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/accept-offer": {
      "post": {
        "operationId": "direct_post_agent_api_accept_offer",
        "summary": "Accept a P2P swap offer (two-phase)",
        "description": "Phase 1 (no transaction_hash): reserves the offer for your wallet (active -> accepted) and returns approve + fillOffer escrow calldata. Phase 2: call again with transaction_hash of the confirmed LoyaltyTokenEscrow fillOffer tx; the API verifies it on Base and sets the offer to completed. Direct /agent-api/accept-offer on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved. onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error. error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error. error_code: offer_reserved: another wallet holds the 30-minute reservation. Retry after reserved_until, or pick another offer from GET /offers. onchain_offer_unlinked: the order-book row has no escrow offerId yet, so it cannot be reserved. Pass onchain_offer_id or create_tx_hash, or pick another offer. Nothing was reserved. onchain_offer_inactive: the escrow offer is already filled or cancelled on-chain, so fillOffer would revert. Pick another offer. onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer_id"
                ],
                "additionalProperties": true,
                "description": "Two-phase: omit transaction_hash to reserve the offer (active -> accepted) and get approve + fillOffer escrow calldata; send transaction_hash of the confirmed fillOffer tx to finalize (accepted -> completed).",
                "properties": {
                  "offer_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Marketplace offer id."
                  },
                  "onchain_offer_id": {
                    "type": "number",
                    "description": "On-chain escrow offer id (phase 1, when known)."
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Phase 2: hash of the confirmed escrow fillOffer transaction on Base."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/cancel-offer": {
      "post": {
        "operationId": "direct_post_agent_api_cancel_offer",
        "summary": "Cancel an own P2P swap offer",
        "description": "Cancels a P2P swap offer the caller created (status active only). Direct /agent-api/cancel-offer on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success. If the escrow offer is already inactive on-chain (onchain_offer_inactive), cancel still closes the order-book row: 200 {status:\"cancelled\", onchain_active:false} with no cancelOffer calldata. The creator can cancel while another wallet holds a reservation: 200 with reservation_released:true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error. error_code: onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer_id"
                ],
                "additionalProperties": true,
                "properties": {
                  "offer_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/workflow/generate-program-defaults": {
      "post": {
        "operationId": "direct_post_agent_api_workflow_generate_program_defaults",
        "summary": "Generate program defaults from business context",
        "description": "Autonomous planner: proposes program name, symbol, cashback economics, and starter rewards from merchant business context. Direct /agent-api/workflow/generate-program-defaults on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "field_catalog": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "next_actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "examples": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "business_name": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "locale": {
                    "type": "string"
                  },
                  "preferred_style": {
                    "type": "string"
                  },
                  "target_audience": {
                    "type": "string"
                  },
                  "use_agent_wallet": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-api/mint/confirm": {
      "post": {
        "operationId": "direct_post_agent_api_mint_confirm",
        "summary": "Settle a mint and credit the recipient",
        "description": "Body obligation_id, fee_tx_hash, and recipient_tx_hash. Verifies the protocol-fee mint and the recipient Transfer (mint of amount of token_address from 0x0 to the recipient) on Base, marks the mint intent completed, and adds the amount to customer_tier_status (GET /balance offchain_ledger_balance; current_balance is on-chain). The same hash may be sent for both fields when EIP-5792 batched the calls. Fee-only confirm still settles the obligation and returns next_actions until recipient_tx_hash is verified. A repeat confirm that was already recorded returns message 'Already confirmed earlier; no changes made.' Rejections use error_code (recipient_mint_not_found, tx_too_old, amount_mismatch, wrong_token) plus expected_tx and next_action GET /mints. Free with an lsk_ key. Not on x402 or MPP. Direct /agent-api/mint/confirm on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "confirmed": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "obligation_id": {
                      "type": "string"
                    },
                    "next_actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/agent-api/batch-mint": {
      "post": {
        "operationId": "direct_post_agent_api_batch_mint",
        "summary": "Batch-mint loyalty tokens to multiple recipients (0x wallet or email)",
        "description": "Accepts token_address and recipients[] (up to 50 items, each with amount and recipient_address, recipient_email, email, or recipient). Automatically resolves registered customer emails to Base 0x wallet addresses (recording protocol-fee obligations and returning a combined calls[] bundle) and credits unregistered customer emails as virtual points in store_points_ledger (status virtual_pending_signup, mint_status unminted) that convert to B20 tokens on Base when they sign in. Scope mint. Direct /agent-api/batch-mint on https://api.loyalspark.online.",
        "tags": [
          "Merchant REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "calls": {
                      "type": "array",
                      "description": "ERC-5792 calls. Submit in order.",
                      "items": {
                        "type": "object",
                        "required": [
                          "to",
                          "data",
                          "value"
                        ],
                        "properties": {
                          "to": {
                            "type": "string"
                          },
                          "data": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string",
                            "example": "0x0"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is POST /x402-gateway/register-agent (method POST, $0.01 Free-plan lsk_). siwe_register (and deprecated alias siwe_after_payment) is the optional SIWE path for wallets that already have a plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/recipient-api/me": {
      "get": {
        "operationId": "direct_get_recipient_api_me",
        "summary": "Get recipient agent profile",
        "description": "Returns the recipient (holder) agent profile bound to its wallet (rwk_ key). Direct /recipient-api/me on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "recipient_agent"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "recipient_agent": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "wallet_address": {
                          "type": "string"
                        },
                        "api_key_prefix": {
                          "type": "string"
                        },
                        "total_requests": {
                          "type": "number"
                        },
                        "created_at": {
                          "type": "string"
                        }
                      }
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": []
      }
    },
    "/recipient-api/balances": {
      "get": {
        "operationId": "direct_get_recipient_api_balances",
        "summary": "List all loyalty balances for the holder",
        "description": "Returns balances and tiers across every loyalty program the holder participates in. Direct /recipient-api/balances on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "balances"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "balances": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": []
      }
    },
    "/recipient-api/balance": {
      "get": {
        "operationId": "direct_get_recipient_api_balance",
        "summary": "Get balance for one loyalty token",
        "description": "Returns balance and tier for the holder for a single loyalty token. Direct /recipient-api/balance on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "balance"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "balance": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "current_balance": {
                          "type": "number"
                        },
                        "current": {
                          "type": "number"
                        },
                        "onchain_balance": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "offchain_ledger_balance": {
                          "type": "number"
                        },
                        "balance_basis": {
                          "type": "string"
                        },
                        "tokens_earned_total": {
                          "type": "number"
                        },
                        "total_earned": {
                          "type": "number"
                        },
                        "virtual_pending_balance": {
                          "type": "number"
                        },
                        "tier": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true
                        },
                        "token_address": {
                          "type": "string"
                        },
                        "customer_address": {
                          "type": "string"
                        }
                      }
                    },
                    "balance_source": {
                      "type": "string"
                    },
                    "balance_source_note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
          }
        ]
      }
    },
    "/recipient-api/rewards": {
      "get": {
        "operationId": "direct_get_recipient_api_rewards",
        "summary": "List rewards available to the holder",
        "description": "Lists redeemable rewards for a program. Response always includes has_engagement (boolean): false when the holder wallet has no activity on the program (active catalog only); true when the wallet already has loyalty engagement. Direct /recipient-api/rewards on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rewards",
                    "has_engagement"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "rewards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "has_engagement": {
                      "type": "boolean",
                      "description": "true when the holder wallet already has loyalty activity or balance on this program; false returns the active catalog only (no prior engagement)."
                    },
                    "note": {
                      "type": "string"
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
          }
        ]
      }
    },
    "/recipient-api/vouchers": {
      "get": {
        "operationId": "direct_get_recipient_api_vouchers",
        "summary": "List vouchers issued to the holder",
        "description": "Returns the holder's vouchers (redeemed rewards) with status. Direct /recipient-api/vouchers on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "vouchers"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "vouchers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453)."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "active, used, or expired. Any other value is HTTP 400."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          }
        ]
      }
    },
    "/recipient-api/offers": {
      "get": {
        "operationId": "direct_get_recipient_api_offers",
        "summary": "List P2P marketplace offers visible to the holder",
        "description": "Lists P2P swap offers the holder can accept (filterable by token_address). Payment alone gives access; do not send an API key. Direct /recipient-api/offers on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "offers"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453)."
          }
        ]
      },
      "post": {
        "operationId": "direct_post_recipient_api_offers",
        "summary": "Create P2P swap offer",
        "description": "Creates a P2P swap intent between two loyalty tokens. Direct /recipient-api/offers on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: missing_fields: required fields are absent (missing[]), or a PUT has no fields to change. invalid_amount: a present amount is 0, negative or not a number (field, min_exclusive:0). Send a positive number. insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "offer_token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
                  },
                  "offer_amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "request_token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
                  },
                  "request_amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "offer_token_address",
                      "offer_amount",
                      "request_token_address",
                      "request_amount"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              }
            }
          }
        }
      }
    },
    "/recipient-api/workflow/reward-status": {
      "get": {
        "operationId": "direct_get_recipient_api_workflow_reward_status",
        "summary": "Autonomous reward redemption status",
        "description": "Returns the current reward redemption step and machine-readable next_actions[] for the holder. Direct /recipient-api/workflow/reward-status on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "reward": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    },
                    "balance": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "token_address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
          },
          {
            "name": "reward_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/recipient-api/register": {
      "post": {
        "operationId": "direct_post_recipient_api_register",
        "summary": "Register / refresh the recipient profile",
        "description": "Idempotent: refreshes recipient profile metadata. Free. Direct /recipient-api/register on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "api_key": {
                      "type": "string"
                    },
                    "recipient_agent": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias. Also error_code: siwe_nonce_invalid: the SIWE nonce is unknown, expired or already used (replay guard). POST /siwe-nonce, sign a new message, and retry. siwe_message_expired: the signed SIWE message is past its Expiration Time. POST /siwe-nonce, sign a new message, and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message",
                  "signature"
                ],
                "additionalProperties": true,
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "SIWE message from POST /siwe-nonce, signed by the wallet."
                  },
                  "signature": {
                    "type": "string",
                    "description": "0x-prefixed wallet signature of message."
                  },
                  "agent_name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/recipient-api/prepare-transfer": {
      "post": {
        "operationId": "direct_post_recipient_api_prepare_transfer",
        "summary": "Prepare B20/ERC-20 transfer calldata",
        "description": "Returns B20/ERC-20 transfer calldata for the holder to send loyalty tokens to any address. Direct /recipient-api/prepare-transfer on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "note": {
                      "type": "string"
                    },
                    "from_wallet": {
                      "type": "string"
                    },
                    "program": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "contract_call": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "tx": {
                      "type": "object",
                      "required": [
                        "to",
                        "data",
                        "value",
                        "chainId"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string",
                          "example": "0x0"
                        },
                        "chainId": {
                          "type": "integer",
                          "example": 8453,
                          "description": "Base mainnet. A number, not the string \"8453\"."
                        }
                      }
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "token_address": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453). Defaults to the demo LSCSC token when the call has no input."
                  },
                  "to": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{40}$",
                    "description": "EVM address on Base (eip155:8453)."
                  },
                  "amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "token_address",
                      "to",
                      "amount"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              }
            }
          }
        }
      }
    },
    "/recipient-api/redeem-reward": {
      "post": {
        "operationId": "direct_post_recipient_api_redeem_reward",
        "summary": "Redeem a reward",
        "description": "Redeems a reward using a transfer tx hash; returns the issued voucher. Direct /recipient-api/redeem-reward on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "voucher": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "voucher_code": {
                      "type": "string"
                    },
                    "voucher_id": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error. error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "reward_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$"
                  },
                  "tx_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Alias of transaction_hash."
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "reward_id",
                      "transaction_hash"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              }
            }
          }
        }
      }
    },
    "/recipient-api/accept-offer": {
      "post": {
        "operationId": "direct_post_recipient_api_accept_offer",
        "summary": "Accept a P2P swap offer (two-phase)",
        "description": "Phase 1 (no transaction_hash): reserves the offer (active -> accepted) and returns approve + fillOffer escrow calldata. Phase 2: call again with transaction_hash of the confirmed fillOffer tx to finalize (accepted -> completed). Direct /recipient-api/accept-offer on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: insufficient_balance: create: your wallet holds less than offer_amount of the offer token; accept phase 1: less than request_amount of the request token (required_amount, onchain_balance). Nothing was stored or reserved. onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error. error_code: tx_not_found: Base does not know this transaction hash (typo or wrong network). Retrying the same hash will not help; send the hash of the transaction you broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error. error_code: offer_reserved: another wallet holds the 30-minute reservation. Retry after reserved_until, or pick another offer from GET /offers. onchain_offer_unlinked: the order-book row has no escrow offerId yet, so it cannot be reserved. Pass onchain_offer_id or create_tx_hash, or pick another offer. Nothing was reserved. onchain_offer_inactive: the escrow offer is already filled or cancelled on-chain, so fillOffer would revert. Pick another offer. onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer_id"
                ],
                "additionalProperties": true,
                "description": "Two-phase: omit transaction_hash to reserve the offer (active -> accepted) and get approve + fillOffer escrow calldata; send transaction_hash of the confirmed fillOffer tx to finalize (accepted -> completed).",
                "properties": {
                  "offer_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Marketplace offer id."
                  },
                  "onchain_offer_id": {
                    "type": "number",
                    "description": "On-chain escrow offer id (phase 1, when known)."
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "description": "Phase 2: hash of the confirmed escrow fillOffer transaction on Base."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/recipient-api/cancel-offer": {
      "post": {
        "operationId": "direct_post_recipient_api_cancel_offer",
        "summary": "Cancel own P2P swap offer",
        "description": "Cancels a P2P swap offer created by the holder. Direct /recipient-api/cancel-offer on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success. If the escrow offer is already inactive on-chain (onchain_offer_inactive), cancel still closes the order-book row: 200 {status:\"cancelled\", onchain_active:false} with no cancelOffer calldata. The creator can cancel while another wallet holds a reservation: 200 with reservation_released:true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "offer": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "tx": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action. Also error_code: onchain_offer_mismatch: the escrow offer's creator or tokens do not match this order-book row, or onchain_offer_id is malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error. error_code: onchain_offer_in_use: that onchain_offer_id is attached to another open offer. Pass this offer's own escrow id or its create_tx_hash.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "charged": {
                      "type": "boolean",
                      "description": "false: the payment was not settled."
                    },
                    "next_step": {
                      "type": "string"
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "retry_after_ms": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "offer_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "offer_id"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              }
            }
          }
        }
      }
    },
    "/recipient-api/workflow/prepare-reward-redemption": {
      "post": {
        "operationId": "direct_post_recipient_api_workflow_prepare_reward_redemption",
        "summary": "Prepare reward redemption plan + transfer calldata",
        "description": "One-shot planner: returns B20/ERC-20 transfer calldata for the reward cost plus workflow so the agent can broadcast then redeem. Direct /recipient-api/workflow/prepare-reward-redemption on https://api.loyalspark.online.",
        "tags": [
          "Recipient REST"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "reward": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "transfer_preparation": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "balance": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "workflow": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workflow": {
                          "type": "string"
                        },
                        "actor": {
                          "type": "string"
                        },
                        "current_step": {
                          "type": "string"
                        },
                        "completed_steps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "prerequisites": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        },
                        "blocking_reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input. Body has error, error_code, and when fields are missing: missing, example, docs, next_action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key. error_code is missing_key or invalid_key. The body does not repeat that value as code. next_action is free SIWE registration (POST /siwe-nonce, then POST /recipient-api/register). siwe_register holds the same step; siwe_after_payment is a deprecated alias.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Per-agent quota, or on GET /agent-api/vouchers/status the anonymous 30/60s limit per IPv4 /24 or IPv6 /48. next_action.url keeps the original query string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "reward_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Reward UUID from GET /recipient-api/rewards."
                  }
                },
                "anyOf": [
                  {
                    "maxProperties": 0
                  },
                  {
                    "required": [
                      "reward_id"
                    ]
                  }
                ],
                "description": "A call with no input returns a paid read-only demo view (demo program LSCSC, its rewards, the inputs to pass, next_steps). Send your own input to perform the call.",
                "x-bare-call-default": "view"
              }
            }
          }
        }
      }
    },
    "/siwe-nonce": {
      "post": {
        "tags": [
          "Identity"
        ],
        "operationId": "siweNonce",
        "summary": "Issue a one-time SIWE nonce",
        "description": "Public. POST https://api.loyalspark.online/siwe-nonce (no API key, no payment). Returns a nonce plus next_action: a ready EIP-4361 template for a merchant lsk_ key when the wallet has a Shopify Store Plan, a Paid Agent Plan (Pro/Enterprise), or an existing registered agent (otherwise HTTP 402 error_code payment_required, pointing to $0.01 POST /x402-gateway/register-agent for a full Free-plan lsk_ key) (domain loyalspark.online, URI https://loyalspark.online, Chain ID 8453, statement 'Register Loyal Spark merchant agent') and the POST target agent-register-siwe. Registering again with the same wallet and name rotates the key. The same nonce is consumed by siwe-verify, agent-register-siwe, and recipient-api/register. Domain must be an allowed host (loyalspark.online, www.loyalspark.online, loyaltyspark.lovable.app, loyalty-spark.lovable.app, this project's preview host, localhost, 127.0.0.1; no other *.lovable.app) and must match the URI hostname. Chain ID must be 8453.",
        "security": [],
        "responses": {
          "200": {
            "description": "Fresh nonce",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "nonce",
                    "next_action"
                  ],
                  "properties": {
                    "nonce": {
                      "type": "string",
                      "example": "0123456789abcdef0123456789abcdef"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant lsk_ key via SIWE for a wallet with a Shopify Store Plan, Paid Agent Plan (Pro/Enterprise), or existing registered agent (rotates key). Replace 0xYOUR_WALLET, sign the message, and POST body to url. With no plan or registered agent, the response is HTTP 402 error_code payment_required and next_action pay_x402 (pay $0.01 USDC at POST /x402-gateway/register-agent for a full Free-plan lsk_ key).",
                      "properties": {
                        "type": {
                          "type": "string",
                          "example": "sign_siwe_and_register"
                        },
                        "method": {
                          "type": "string",
                          "example": "POST"
                        },
                        "url": {
                          "type": "string",
                          "example": "https://api.loyalspark.online/agent-register-siwe"
                        },
                        "body": {
                          "type": "object"
                        },
                        "siwe": {
                          "type": "object",
                          "properties": {
                            "domain": {
                              "type": "string",
                              "example": "loyalspark.online"
                            },
                            "uri": {
                              "type": "string",
                              "example": "https://loyalspark.online"
                            },
                            "chainId": {
                              "type": "integer",
                              "example": 8453
                            },
                            "version": {
                              "type": "string",
                              "example": "1"
                            },
                            "statement": {
                              "type": "string"
                            },
                            "nonce": {
                              "type": "string"
                            },
                            "issuedAt": {
                              "type": "string"
                            },
                            "expirationTime": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Autonomous x402 registration ($0.01 USDC on Base at POST /x402-gateway/register-agent). Issues a full Free-plan lsk_ key (1 agent, 200 calls/mo, 1,000 mint tokens/mo, 1.25% fee, all 5 scopes: read, create_program, mint, trade, manage_rewards) when the wallet has no Store/Agent plan, or a plan-scoped lsk_ key if on a Store/Agent plan. api_key is shown once; recover it free via SIWE rotation."
                    },
                    "read_only_option": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of free_plan_option (same content; the key is NOT read-only). Autonomous x402 registration ($0.01 USDC on Base at POST /x402-gateway/register-agent). Issues a full Free-plan lsk_ key (1 agent, 200 calls/mo, 1,000 mint tokens/mo, 1.25% fee, all 5 scopes) when the wallet has no Store/Agent plan, or a plan-scoped lsk_ key if on a Store/Agent plan."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/verify-agent-plan-payment": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "verifyAgentPlanPayment",
        "summary": "Agent/merchant plan payment info and USDC verify",
        "description": "POST https://api.loyalspark.online/verify-agent-plan-payment. Actions: get_payment_info (treasury, per-plan limits, annual prices, required_sender_rule, steps) and verify_payment (after a plain USDC transfer on Base). Auth: x-api-key lsk_ (owner_address is the required Transfer from) or Supabase JWT with linked wallet. product agent|merchant; plan_slug pro|enterprise (agent) or starter|growth|scale (merchant); billing_cycle monthly|annual. Transfer from must equal the authenticated wallet (403 payer_mismatch otherwise). Not an x402 resource.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "get_payment_info",
                      "verify_payment",
                      "retry_verification",
                      "admin_verify"
                    ]
                  },
                  "product": {
                    "type": "string",
                    "enum": [
                      "agent",
                      "merchant"
                    ],
                    "default": "agent"
                  },
                  "plan_slug": {
                    "type": "string",
                    "enum": [
                      "pro",
                      "enterprise",
                      "starter",
                      "growth",
                      "scale"
                    ]
                  },
                  "billing_cycle": {
                    "type": "string",
                    "enum": [
                      "monthly",
                      "annual"
                    ],
                    "default": "monthly"
                  },
                  "transaction_hash": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$"
                  },
                  "subscription_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              },
              "examples": {
                "get_payment_info": {
                  "value": {
                    "action": "get_payment_info",
                    "product": "agent"
                  }
                },
                "verify_payment": {
                  "value": {
                    "action": "verify_payment",
                    "product": "agent",
                    "plan_slug": "pro",
                    "billing_cycle": "monthly",
                    "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000001"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment info or verified subscription",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "product": {
                      "type": "string"
                    },
                    "subscription_wallet": {
                      "type": "string"
                    },
                    "usdc_contract": {
                      "type": "string"
                    },
                    "chain_id": {
                      "type": "integer"
                    },
                    "required_sender_rule": {
                      "type": "string"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "plans": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "price_usdc_monthly": {
                            "type": "number"
                          },
                          "annual_price_usdc": {
                            "type": "number"
                          },
                          "max_api_calls_monthly": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "max_mint_amount_monthly": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "max_agents": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "transaction_fee_percent": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "limits": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        }
                      }
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "plan_effective": {
                      "type": "boolean"
                    },
                    "effective_limits": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "next_steps": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json / missing_fields / payment_unverified",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing_auth",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "payer_mismatch — Transfer from ≠ registered wallet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "tx_already_used / shopify_billed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "error_code"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "description": "Stable machine code. 401 bodies use error_code and do not also send code."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {},
                    "docs": {
                      "type": "string"
                    },
                    "next_action": {
                      "type": "object",
                      "description": "Merchant (lsk_): POST /x402-gateway/register-agent ($0.01, method+url+body). Holder (rwk_): free SIWE registration (first_step POST /siwe-nonce, then POST /recipient-api/register)."
                    },
                    "next_steps": {
                      "type": "object",
                      "description": "Machine-readable first step matching next_action (register-agent for lsk_; siwe-nonce for rwk_)."
                    },
                    "siwe_register": {
                      "type": "object",
                      "description": "SIWE registration template (merchant or holder). Prefer this over siwe_after_payment."
                    },
                    "siwe_after_payment": {
                      "type": "object",
                      "deprecated": true,
                      "description": "Deprecated alias of siwe_register. SIWE is free and comes first; it is not after payment."
                    },
                    "free_plan_option": {
                      "type": "object",
                      "description": "Merchant only: $0.01 POST /x402-gateway/register-agent Free-plan lsk_ option."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent-register-siwe": {
      "post": {
        "tags": [
          "Identity"
        ],
        "operationId": "agentRegisterSiwe",
        "summary": "Register a merchant agent API key with SIWE",
        "description": "Public. POST https://api.loyalspark.online/agent-register-siwe. No API key. The signed EIP-4361 message must contain the exact statement 'Register Loyal Spark merchant agent', Chain ID 8453, a nonce from POST https://api.loyalspark.online/siwe-nonce, and a domain/URI on the allowlist (production: domain loyalspark.online and URI https://loyalspark.online). Write scopes (create_program, mint, manage_rewards, trade) are stored with read included. The lsk_ key is returned once. Send agent_name (alias name). Registering again with the same wallet and the same name rotates and recovers the key (HTTP 200, rotated true) and keeps the stored name; the previous key stops working.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message",
                  "signature"
                ],
                "anyOf": [
                  {
                    "required": [
                      "agent_name"
                    ]
                  },
                  {
                    "required": [
                      "name"
                    ]
                  }
                ],
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "Complete EIP-4361 message. Replace Nonce and Issued At before signing.",
                    "example": "loyalspark.online wants you to sign in with your Ethereum account:\n0x0000000000000000000000000000000000000001\n\n${MERCHANT_SIWE_STATEMENT}\n\nURI: https://loyalspark.online\nVersion: 1\nChain ID: 8453\nNonce: 0123456789abcdef0123456789abcdef\nIssued At: 2026-10-21T18:00:00.000Z"
                  },
                  "signature": {
                    "type": "string",
                    "description": "Hex signature of message by the address line."
                  },
                  "agent_name": {
                    "type": "string",
                    "maxLength": 64,
                    "example": "Cafe agent",
                    "description": "Agent name (trimmed, control/markup characters removed, max 64). Same wallet + same name rotates that agent's key; a rotation never renames."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Alias of agent_name (agent_name wins when both are sent)."
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "read",
                        "create_program",
                        "mint",
                        "trade",
                        "manage_rewards"
                      ]
                    },
                    "example": [
                      "create_program",
                      "mint",
                      "manage_rewards"
                    ],
                    "description": "Requested scopes. Any write scope also persists read. Empty or omitted becomes [read]."
                  }
                }
              },
              "example": {
                "message": "loyalspark.online wants you to sign in with your Ethereum account:\n0x0000000000000000000000000000000000000001\n\n${MERCHANT_SIWE_STATEMENT}\n\nURI: https://loyalspark.online\nVersion: 1\nChain ID: 8453\nNonce: 0123456789abcdef0123456789abcdef\nIssued At: 2026-10-21T18:00:00.000Z",
                "signature": "0x",
                "agent_name": "Cafe agent",
                "scopes": [
                  "create_program",
                  "mint",
                  "manage_rewards"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Same wallet and name: the key was rotated. api_key is the new key and the previous key stops working. rotated is true."
          },
          "201": {
            "description": "Agent created. api_key is shown once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key": {
                      "type": "string",
                      "example": "lsk_...",
                      "description": "Shown once. Save it now."
                    },
                    "warning": {
                      "type": "string"
                    },
                    "agent": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing fields, or SIWE domain, URI, or chain ID rejected."
          },
          "401": {
            "description": "Invalid signature, expired message, or used nonce. error_code: siwe_message_expired or siwe_nonce_invalid; next_steps: POST /siwe-nonce, sign a new message, POST agent-register-siwe again."
          }
        }
      }
    }
  }
}
