{
  "openapi": "3.0.3",
  "info": {
    "title": "FutureScope Distributor Purchase API",
    "version": "v1",
    "description": "Production-ready foundation for distributor-led ordering, attribution, activation, invoice, and license fulfillment."
  },
  "paths": {
    "/api/v1/health": {
      "get": {
        "summary": "Health check"
      }
    },
    "/api/v1/purchase": {
      "post": {
        "summary": "Create purchase order",
        "parameters": [
          {
            "name": "X-API-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Purchase created"
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Invalid API key"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/api/v1/orders/{purchaseCode}": {
      "get": {
        "summary": "Get order status",
        "parameters": [
          {
            "name": "purchaseCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order status"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/webhooks/test": {
      "post": {
        "summary": "Queue webhook test event"
      }
    }
  }
}