{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailinapp-com/json-schema/mailinapp-com-experiment-report-schema.json",
  "title": "ExperimentReport",
  "description": "The dashboard's report export (aggregates only, never a contact): pre-registration, sample design, delivery, the latest analysis snapshot with each arm's metrics, intervals and quality checks, the daily history and the decision. Fields not listed here may be added.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mailinapp-com-openapi.json#/components/schemas/ExperimentReport",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "experiment",
    "preRegistration",
    "arms",
    "results",
    "history",
    "decision",
    "journey",
    "concurrentExperiments",
    "generatedAt"
  ],
  "properties": {
    "experiment": {
      "type": "object"
    },
    "preRegistration": {
      "type": "object"
    },
    "arms": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "rewards": {
      "type": [
        "object",
        "null"
      ],
      "description": "Per-arm reward codes issued and failed; null without a rewarded arm or before the send.",
      "properties": {
        "arms": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "issued": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              }
            }
          }
        }
      }
    },
    "money": {
      "type": [
        "object",
        "null"
      ],
      "description": "Attributed revenue, AOV, promotional cost, refunds and code redemption per arm per currency; null before an analysis that has them.",
      "properties": {
        "currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "The experiment's currency; other currencies are listed apart and never added in."
        },
        "note": {
          "type": "string",
          "description": "Revenue excludes taxes and shipping; discounts are already reflected; not a profit calculation."
        },
        "arms": {
          "type": "array",
          "description": "One entry per arm per currency with orders (the experiment's currency always).",
          "items": {
            "type": "object",
            "properties": {
              "armKey": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "denominator": {
                "type": "integer",
                "description": "Delivered recipients (assigned for the holdout) that revenue per delivered divides by."
              },
              "purchasers": {
                "type": "integer",
                "description": "Recipients with at least one attributed order in the window."
              },
              "orders": {
                "type": "integer",
                "description": "Attributed orders in the window."
              },
              "grossRevenue": {
                "type": "number",
                "description": "Merchandise after discounts, without taxes and shipping, before refunds."
              },
              "refunds": {
                "type": "number",
                "description": "Merchandise refunded in the window, subtracted from revenue."
              },
              "refundedOrders": {
                "type": "integer",
                "description": "Orders with a refund in the window."
              },
              "revenue": {
                "type": "number",
                "description": "grossRevenue minus refunds."
              },
              "aov": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Average order value: grossRevenue / orders."
              },
              "revenuePerDelivered": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "revenue / denominator."
              },
              "discount": {
                "type": "number",
                "description": "The orders' discount-code amounts on the goods."
              },
              "freeShippingOrders": {
                "type": "integer",
                "description": "Orders that used a free-shipping code."
              },
              "shippingSubsidy": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "The arm reward's configured shipping subsidy estimate per order."
              },
              "promoCost": {
                "type": "number",
                "description": "Promotional cost granted: discount + shippingSubsidy × freeShippingOrders."
              }
            }
          }
        },
        "redemption": {
          "type": "array",
          "description": "Per rewarded arm, codes redeemed on an attributed order over codes issued.",
          "items": {
            "type": "object",
            "properties": {
              "armKey": {
                "type": "string"
              },
              "issued": {
                "type": "integer"
              },
              "redeemed": {
                "type": "integer"
              },
              "rate": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "redeemed / issued; null when none were issued."
              }
            }
          }
        }
      }
    },
    "results": {
      "type": [
        "object",
        "null"
      ],
      "description": "The latest analysis snapshot; null before the first.",
      "properties": {
        "orders": {
          "type": "object",
          "description": "Attributed orders in the window by attribution rule (discount_code, utm, checkout_token, email_match; email_match is probable) and those left out.",
          "properties": {
            "byRule": {
              "type": "object",
              "additionalProperties": {
                "type": "integer"
              }
            },
            "excluded": {
              "type": "object",
              "properties": {
                "otherCurrency": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "money": {
          "type": "object",
          "description": "The same money summary as the top-level money, without currency and note."
        }
      }
    },
    "history": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "decision": {
      "type": [
        "object",
        "null"
      ]
    },
    "journey": {
      "type": [
        "object",
        "null"
      ],
      "description": "A journey experiment's design and enrollment; null for a send experiment.",
      "required": [
        "journeyId",
        "deleted",
        "nodeId",
        "windowHours",
        "enrollmentEndsAt",
        "maturing",
        "assignedByDay",
        "edits"
      ],
      "properties": {
        "journeyId": {
          "type": "string"
        },
        "deleted": {
          "type": "boolean",
          "description": "The journey was deleted after the experiment ended; its results stay."
        },
        "nodeId": {
          "type": "string"
        },
        "windowHours": {
          "type": "integer"
        },
        "enrollmentEndsAt": {
          "type": [
            "integer",
            "null"
          ]
        },
        "maturing": {
          "type": "integer",
          "description": "Assigned contacts still inside their window, not yet counted."
        },
        "assignedByDay": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string"
              },
              "arms": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "edits": {
          "type": "array",
          "description": "Changes to the paths' steps saved while the experiment observed, oldest first.",
          "items": {
            "type": "object"
          }
        }
      }
    },
    "concurrentExperiments": {
      "type": "array",
      "description": "Other experiments the quality checks tested this one against for an interaction.",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "projectId",
          "journeyId"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "projectId": {
            "type": [
              "string",
              "null"
            ]
          },
          "journeyId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "generatedAt": {
      "type": "integer"
    }
  }
}