{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/affinityrx-com/json-schema/affinityrx-com-fill-schema.json",
  "title": "Fill",
  "description": "What the pharmacy dispenses for one price. A quantity counts `unit`, not fills, and is a whole number of fills: for a fill of 30 tablets, quantity 60 is two fills and costs twice the price. For a vial product, one fill is one vial and quantity counts vials.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/affinityrx-com-openapi.json#/components/schemas/Fill",
  "type": "object",
  "properties": {
    "amount": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991,
      "description": "How much one fill holds, in `unit`."
    },
    "container": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "What holds one fill, such as `vial`. Null when the pharmacy does not say."
    },
    "ingredients": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "The amount in the specified unit."
          },
          "name": {
            "type": "string",
            "description": "The name."
          },
          "unit": {
            "type": "string",
            "description": "The unit used to measure the amount."
          }
        },
        "required": [
          "amount",
          "name",
          "unit"
        ],
        "additionalProperties": {
          "description": "A field that this API version can add. Ignore fields that you do not know."
        }
      },
      "description": "Each active ingredient's total in one fill: a 2 mL vial of 30 mg/mL is 60 mg."
    },
    "unit": {
      "type": "string",
      "description": "The unit of `amount`, the same as `quantityUnit`: `vial` for a vial product."
    },
    "volume": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "amount": {
              "type": "number",
              "description": "The amount in the specified unit."
            },
            "unit": {
              "type": "string",
              "description": "The unit used to measure the amount."
            }
          },
          "required": [
            "amount",
            "unit"
          ],
          "additionalProperties": {
            "description": "A field that this API version can add. Ignore fields that you do not know."
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "What one vial holds, such as 2 mL. Null for a product that is not a vial."
    }
  },
  "required": [
    "amount",
    "container",
    "ingredients",
    "unit",
    "volume"
  ],
  "additionalProperties": {
    "description": "A field that this API version can add. Ignore fields that you do not know."
  }
}