{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/merchantflow-ai/json-schema/merchantflow-ai-profitability-day-schema.json",
  "title": "ProfitabilityDay",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/merchantflow-ai-openapi.json#/components/schemas/ProfitabilityDay",
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "description": "YYYY-MM-DD in the store timezone."
    },
    "currency": {
      "type": "string"
    },
    "gross_revenue": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "refunds": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "net_revenue": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "shipping_revenue": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "discounts": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "cogs": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "product_cost_only": {
      "type": "number",
      "description": "COGS excluding handling cost."
    },
    "ad_spend": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "payment_fees": {
      "type": "number",
      "description": "Includes fees estimated from the merchant's payment fee rules for orders whose platform reported no fee. The per-order split is available as payment_fee_source on /orders."
    },
    "shipping_cost": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "fulfillment_cost": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "tax": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "variable_costs": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "opex": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "amortised_expenses": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "interest_expense": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "product_margin_cm1": {
      "type": "number",
      "description": "net_revenue - product_cost_only."
    },
    "gross_profit_cm2": {
      "type": "number",
      "description": "net_revenue - cogs."
    },
    "contribution_margin_cm3": {
      "type": "number",
      "description": "gross_profit_cm2 - shipping - fulfilment - payment fees - ad spend."
    },
    "ebitda": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "net_profit": {
      "type": "number",
      "description": "Amount in the order currency."
    },
    "cogs_coverage_pct": {
      "type": [
        "number",
        "null"
      ]
    }
  }
}