{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sherweb-com/json-schema/sherweb-com-receivable-charges-schema.json",
  "title": "ReceivableCharges",
  "description": "All charges to pay for a billing period.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sherweb-com-service-provider-api-beta-api-openapi.yml#/components/schemas/ReceivableCharges",
  "required": [
    "charges",
    "periodFrom",
    "periodTo"
  ],
  "type": "object",
  "properties": {
    "periodFrom": {
      "type": "string",
      "format": "date"
    },
    "periodTo": {
      "type": "string",
      "format": "date"
    },
    "charges": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Charge"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "Charge": {
      "required": [
        "chargeName",
        "chargeType",
        "costPrice",
        "costPriceProrated",
        "currency",
        "isProratable",
        "periodFrom",
        "periodTo",
        "productName",
        "quantity",
        "sku"
      ],
      "type": "object",
      "properties": {
        "productName": {
          "minLength": 1,
          "type": "string"
        },
        "sku": {
          "minLength": 1,
          "type": "string"
        },
        "chargeId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "chargeName": {
          "minLength": 1,
          "type": "string"
        },
        "chargeType": {
          "$ref": "#/$defs/ChargeType"
        },
        "billingCycleType": {
          "$ref": "#/$defs/ReceivableBillingCycleType"
        },
        "periodFrom": {
          "type": "string",
          "format": "date"
        },
        "periodTo": {
          "type": "string",
          "format": "date"
        },
        "quantity": {
          "type": "number",
          "format": "double"
        },
        "costPrice": {
          "type": "number",
          "description": "Price paid per unit.",
          "format": "double"
        },
        "costPriceProrated": {
          "type": "number",
          "description": "Prorated price paid per unit.",
          "format": "double"
        },
        "currency": {
          "minLength": 1,
          "type": "string"
        },
        "isProratable": {
          "type": "boolean",
          "description": "Indicates whether or not the price of the charge is proratable."
        }
      },
      "additionalProperties": false,
      "description": "A product is constituted of one or multiple charges."
    },
    "ChargeType": {
      "enum": [
        "Setup",
        "Recurring",
        "Usage",
        "Unknown"
      ],
      "type": "string",
      "description": "Setup (occurs only once and can be used for activation, cancellation or setup fees),\r\nRecurring (invoiced on a monthly or yearly basis),\r\nUsage (varies based on the quantity of the product or service consumed by the customer),\r\nUnknown (charge type not found. This may happen when querying data from older invoices)."
    },
    "ReceivableBillingCycleType": {
      "enum": [
        "OneTime",
        "Monthly",
        "Yearly"
      ],
      "type": "string",
      "description": "OneTime (charged once, with no recurrence),\r\nMonthly (charged monthly),\r\nYearly (charged yearly)."
    }
  }
}