{
  "openapi": "3.1.0",
  "info": {
    "title": "Zinvyl Marketplace Agent Gateway",
    "version": "1.7.2",
    "description": "Funding-safe routes for authorized humans and software agents. A successful API response never proves payment unless the response explicitly reports a Zinvyl paid-order ledger record.",
    "x-guidance": "Discover the eleven fixed-price purchase options across ten product families in agent-commerce.json. Use MCP buy_matching_service for an allowlisted sanitized need, buy_service when the exact offer is already known, or POST /api/agent-payment-route for the compatible HTTPS flow. Use funding_method auto for adaptive Stripe-hosted checkout without prior Zinvyl customer payment-method enrollment; explicitly select MPP or delegated card only when the client supports that rail. Only a verified receipt and paid-order ledger record authorize fulfillment.",
    "contact": {
      "email": "gabriel@zinvyl.com",
      "url": "https://zinvyl.com/inquiry/"
    }
  },
  "servers": [{ "url": "https://zinvyl.com/marketplace" }],
  "x-service-info": {
    "categories": ["workflow-automation", "api-integration", "freight-document", "data-operations", "quality-assurance"],
    "docs": {
      "homepage": "https://zinvyl.com/marketplace/agents",
      "apiReference": "https://zinvyl.com/marketplace/openapi.yaml",
      "llms": "https://zinvyl.com/marketplace/llms.txt"
    }
  },
  "paths": {
    "/api/agent-machine-payment": {
      "post": {
        "summary": "Fund a previously bound fixed-scope purchase through Stripe MPP",
        "description": "Returns an MPP 402 challenge for an eligible bound purchase intent. The route is available only while Zinvyl's production MPP gate, Stripe profile, bounded capacity, and authoritative ledger remain ready; otherwise it fails closed without claiming payment.",
        "x-payment-info": {
          "offers": [
            { "amount": "4900", "currency": "usd", "description": "Workflow Health Check (zinvyl.api.failure-triage.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "9900", "currency": "usd", "description": "Workflow Reliability Care — 30-Day Cycle (zinvyl.api.workflow-reliability-care.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "10000", "currency": "usd", "description": "Venture Evidence Brief (zinvyl.venture.evidence-brief.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "10000", "currency": "usd", "description": "Prototype Scope Blueprint (zinvyl.venture.prototype-scope.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "14900", "currency": "usd", "description": "Workflow Rescue (zinvyl.api.workflow-failure-rescue.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "19900", "currency": "usd", "description": "Founding freight workflow evidence check (zinvyl.freight.workflow-audit.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "49900", "currency": "usd", "description": "Full freight workflow audit and implementation-ready remediation plan (zinvyl.freight.full-workflow-audit.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "180000", "currency": "usd", "description": "AI Marketing Content Pilot (zinvyl.content.ai-marketing-pilot.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "3900", "currency": "usd", "description": "CSV Cleanup and Validation — Starter (zinvyl.data.csv-cleanup-starter.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "7900", "currency": "usd", "description": "CSV Cleanup and Validation — Complete (zinvyl.data.csv-cleanup-complete.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "49900", "currency": "usd", "description": "Operations BI Dashboard (zinvyl.analytics.operations-bi-dashboard.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "29500", "currency": "usd", "description": "AI Workflow Failure-Mode Audit (zinvyl.quality.ai-workflow-failure-audit.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "7900", "currency": "usd", "description": "Single Automation Blueprint (zinvyl.factory.workflow-single-automation-blueprint.v1)", "intent": "charge", "method": "stripe" },
            { "amount": "24900", "currency": "usd", "description": "MCP Server Starter (zinvyl.factory.development-mcp-server-starter.v1)", "intent": "charge", "method": "stripe" }
          ],
          "price": { "mode": "dynamic", "currency": "USD", "min": "39.00", "max": "1800.00" },
          "protocols": [
            { "mpp": { "method": "stripe", "intent": "charge", "currency": "usd" } }
          ],
          "x-zinvyl-offer-catalog": "https://zinvyl.com/marketplace/agent-commerce.json"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["intent_id", "billing_address"],
                "properties": {
                  "intent_id": { "type": "string", "minLength": 8, "maxLength": 128 },
                  "billing_address": {
                    "type": "object",
                    "required": ["line1", "city", "state", "postal_code", "country"],
                    "properties": {
                      "line1": { "type": "string" },
                      "line2": { "type": "string" },
                      "city": { "type": "string" },
                      "state": { "type": "string" },
                      "postal_code": { "type": "string" },
                      "country": { "type": "string", "const": "US" }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stripe payment verified, one paid order recorded, and a one-time scoped order bearer token issued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["order_id", "intent_id", "offer_id", "funding_state"],
                  "properties": {
                    "order_id": { "type": "string" },
                    "intent_id": { "type": "string" },
                    "offer_id": { "type": "string" },
                    "funding_state": { "const": "verified" }
                  }
                }
              }
            }
          },
          "400": { "description": "Malformed or ineligible purchase request." },
          "402": { "description": "Payment Required; contains the signed MPP payment challenge." },
          "409": { "description": "Intent, quote, or payment credential conflicts with an existing record." },
          "503": { "description": "The MPP rail or authoritative ledger is unavailable." }
        }
      }
    },
    "/api/agent-payment-route": {
      "post": {
        "summary": "Reserve bounded capacity for an authorized fixed-scope purchase intent",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "https://zinvyl.com/marketplace/purchase-intent.schema.json" }
            }
          }
        },
        "responses": {
          "200": { "description": "Intent is bound and ready for external funding." },
          "400": { "description": "Invalid request." },
          "429": { "description": "Automated purchase capacity is full; no additional supply is promised." },
          "409": { "description": "Intent conflict." }
        }
      }
    },
    "/api/network/request": {
      "post": {
        "summary": "Submit a sanitized bounded outcome for private review",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["request_id", "buyer", "task_summary"],
                "properties": {
                  "request_id": { "type": "string" },
                  "buyer": { "type": "object" },
                  "task_summary": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "201": { "description": "Unfunded request received for private review." },
          "400": { "description": "Invalid request." }
        }
      }
    },
    "/api/order-status": {
      "get": {
        "summary": "Read payment and fulfillment state from the Zinvyl ledger",
        "security": [{ "orderBearer": [] }],
        "parameters": [
          { "name": "session_id", "in": "query", "required": true, "schema": { "type": "string" } },
          { "name": "Authorization", "in": "header", "required": false, "description": "Bearer order token returned once with a verified machine-payment receipt. Human buyers may instead use their claimed signed-in order session.", "schema": { "type": "string" } }
        ],
        "responses": {
          "200": { "description": "Order record available." },
          "202": { "description": "Payment confirmation is still pending." }
        }
      }
    },
    "/api/order-files": {
      "post": {
        "summary": "List order files with JSON or upload one bounded input with multipart form data",
        "description": "Requires the scoped order bearer token for machine-paid orders or an authorized signed-in human order claim.",
        "security": [{ "orderBearer": [] }],
        "responses": {
          "200": { "description": "Existing order-file metadata." },
          "201": { "description": "One bounded buyer input was stored privately." },
          "403": { "description": "Scoped order access is missing or invalid." }
        }
      }
    },
    "/api/order-file": {
      "post": {
        "summary": "Download one available delivery file",
        "security": [{ "orderBearer": [] }],
        "responses": {
          "200": { "description": "Requested delivery as a sandboxed attachment." },
          "403": { "description": "Scoped order access is missing or invalid." },
          "404": { "description": "Delivery file is unavailable." }
        }
      }
    },
    "/api/order-acceptance": {
      "post": {
        "summary": "Accept a delivered order or request a bounded revision",
        "description": "Requires the scoped order bearer token for machine-paid orders or an authorized signed-in human order claim.",
        "security": [{ "orderBearer": [] }],
        "responses": {
          "200": { "description": "Acceptance state was updated." },
          "403": { "description": "Scoped order access is missing or invalid." },
          "409": { "description": "The order is not in a permitted delivery state." }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "orderBearer": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Bearer followed by the one-time scoped Zinvyl order token."
      }
    }
  }
}
