{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/merchantflow-ai/json-schema/merchantflow-ai-profitability-summary-schema.json",
  "title": "ProfitabilitySummary",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/merchantflow-ai-openapi.json#/components/schemas/ProfitabilitySummary",
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "properties": {
        "start": {
          "type": [
            "string",
            "null"
          ]
        },
        "end": {
          "type": [
            "string",
            "null"
          ]
        },
        "days": {
          "type": "integer"
        }
      }
    },
    "currency": {
      "type": "string"
    },
    "cogs_coverage_pct": {
      "type": [
        "number",
        "null"
      ]
    },
    "basis": {
      "type": "object",
      "description": "How these figures were computed. Compare only against figures on the same basis.",
      "properties": {
        "refund_recognition": {
          "type": "string",
          "const": "sale_date",
          "description": "A refunded order's costs are recognised on the date the order was placed, matching its revenue."
        },
        "tax_treated_as_cost": {
          "type": "boolean",
          "description": "Follows the merchant's own setting, so these figures match their dashboard."
        },
        "ad_spend": {
          "type": "string",
          "const": "blended_daily_allocation"
        }
      }
    },
    "totals": {
      "type": "object",
      "additionalProperties": {
        "type": "number"
      }
    }
  }
}