{
  "openapi": "3.0.0",
  "info": {
    "title": "NovaRewards API",
    "version": "1.0.0",
    "description": "REST API for the Nova Rewards blockchain loyalty platform. All protected endpoints require a Bearer JWT obtained from `POST /auth/login`. Merchant endpoints require an `x-api-key` header instead.",
    "contact": {
      "name": "Nova Rewards Team"
    },
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "url": "http://localhost:3001/api",
      "description": "Local development"
    },
    {
      "url": "https://api.novarewards.io/api",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT access token obtained from `POST /auth/login`."
      },
      "merchantApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Merchant API key returned on registration (shown once)."
      }
    },
    "schemas": {
      "User": {
        "type": "object",
        "properties": {
          "id": { "type": "integer", "example": 42 },
          "email": { "type": "string", "format": "email", "example": "alice@example.com" },
          "first_name": { "type": "string", "example": "Alice" },
          "last_name": { "type": "string", "example": "Smith" },
          "role": { "type": "string", "enum": ["user", "admin"], "example": "user" },
          "created_at": { "type": "string", "format": "date-time", "example": "2025-01-15T10:30:00Z" }
        }
      }
    }
  },
  "paths": {}
}