{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fusehealth-com/json-schema/fusehealth-com-program-order-quote-schema.json",
  "title": "ProgramOrderQuote",
  "description": "The checkout's own quote for one order, with the brand's waterfall.",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fusehealth-com-openapi.json#/components/schemas/ProgramOrderQuote",
  "type": "object",
  "properties": {
    "programId": {
      "type": "string"
    },
    "productId": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "months": {
      "type": "integer"
    },
    "isPrepay": {
      "type": "boolean"
    },
    "customerPays": {
      "type": "number",
      "description": "What the customer is charged for this order, after the coupon."
    },
    "subtotal": {
      "type": "number",
      "description": "Before the coupon."
    },
    "programFee": {
      "type": "number"
    },
    "fees": {
      "type": "object",
      "properties": {
        "stripeFee": {
          "type": "number"
        },
        "doctorFee": {
          "type": "number"
        },
        "productCosts": {
          "type": "number",
          "description": "Pharmacy and FUSE product costs as one number."
        },
        "fuseMerchantServiceFee": {
          "type": "number"
        }
      }
    },
    "rollingReserve": {
      "type": "number",
      "description": "Held from the brand's margin and released on the reserve schedule."
    },
    "brandMarginBeforeCoupon": {
      "type": "number"
    },
    "brandMargin": {
      "type": "number",
      "description": "The brand's margin after the coupon (negative books as brand debt)."
    },
    "coupon": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "outcome": {
          "type": "string",
          "enum": [
            "applied",
            "capped",
            "absorbed",
            "rejected"
          ]
        },
        "discount": {
          "type": "number"
        },
        "brandAbsorbed": {
          "type": "number"
        },
        "policy": {
          "type": [
            "string",
            "null"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}