{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sherweb-com/json-schema/sherweb-com-payable-charges-schema.json",
  "title": "PayableCharges",
  "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-distributor-api-openapi.yml#/components/schemas/PayableCharges",
  "type": "object",
  "properties": {
    "periodFrom": {
      "type": "string",
      "format": "date"
    },
    "periodTo": {
      "type": "string",
      "format": "date"
    },
    "charges": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/Charge"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "BillingCycleType": {
      "enum": [
        "OneTime",
        "Monthly",
        "Yearly"
      ],
      "type": "string",
      "description": "OneTime (charged once, with no recurrence),\r\nMonthly (charged monthly),\r\nYearly (charged yearly)."
    },
    "Charge": {
      "type": "object",
      "properties": {
        "productId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "productName": {
          "type": [
            "string",
            "null"
          ]
        },
        "sku": {
          "type": [
            "string",
            "null"
          ]
        },
        "chargeId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "chargeName": {
          "type": [
            "string",
            "null"
          ]
        },
        "chargeType": {
          "$ref": "#/$defs/ChargeType"
        },
        "billingCycleType": {
          "$ref": "#/$defs/BillingCycleType"
        },
        "periodFrom": {
          "type": "string",
          "format": "date"
        },
        "periodTo": {
          "type": "string",
          "format": "date"
        },
        "quantity": {
          "type": "number",
          "format": "double"
        },
        "listPrice": {
          "type": "number",
          "description": "Price before deduction(s).",
          "format": "double"
        },
        "netPrice": {
          "type": "number",
          "description": "ListPrice - deduction(s) - fee(s).",
          "format": "double"
        },
        "netPriceProrated": {
          "type": "number",
          "format": "double"
        },
        "subTotal": {
          "type": "number",
          "description": "Quantity * netPriceProrated.",
          "format": "double"
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "isBilled": {
          "type": "boolean",
          "description": "Indicates whether or not a charge has been billed."
        },
        "isProratable": {
          "type": "boolean",
          "description": "Indicates whether or not the price of a charge is proratable."
        },
        "deductions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Deduction"
          }
        },
        "fees": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Fee"
          }
        },
        "invoice": {
          "$ref": "#/$defs/Invoice"
        },
        "taxes": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Tax"
          }
        },
        "tags": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/Tag"
          }
        }
      },
      "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)."
    },
    "Deduction": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "deductionType": {
          "$ref": "#/$defs/DeductionType"
        },
        "value": {
          "type": "number",
          "format": "double"
        },
        "unitValue": {
          "type": "number",
          "description": "Deduction value prorated per unit.",
          "format": "double"
        },
        "totalValue": {
          "type": "number",
          "description": "Deduction value for line (unitValue * quantity).",
          "format": "double"
        }
      },
      "additionalProperties": false,
      "description": "Deduction applied to a charge."
    },
    "DeductionType": {
      "enum": [
        "PromotionalMoney",
        "PromotionalPercentage",
        "PerformancePercentage"
      ],
      "type": "string",
      "description": "PromotionalMoney (fixed price promotional discount),\r\nPromotionalPercentage (promotional percentage discount),\r\nPerformancePercentage (deduction linked to performance tier)."
    },
    "Fee": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "unitValue": {
          "type": "number",
          "format": "double"
        },
        "totalValue": {
          "type": "number",
          "format": "double"
        },
        "isTaxable": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "description": "Fee associated with a charge."
    },
    "Invoice": {
      "type": "object",
      "properties": {
        "number": {
          "type": [
            "string",
            "null"
          ]
        },
        "date": {
          "type": "string",
          "format": "date"
        },
        "periodFrom": {
          "type": "string",
          "format": "date"
        },
        "periodTo": {
          "type": "string",
          "format": "date"
        }
      },
      "additionalProperties": false,
      "description": "Information on the invoice where the charge was applied."
    },
    "Tag": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "value": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false,
      "description": "Additional information about the charge, including customer information."
    },
    "Tax": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "appliedRate": {
          "type": "number",
          "format": "double"
        }
      },
      "additionalProperties": false,
      "description": "Tax rate applied to a charge."
    }
  }
}