{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zywave/json-schema/zywave-commission-billing-schema.json",
  "title": "CommissionBilling",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zywave-commissionbillings-api-openapi.yml#/components/schemas/CommissionBilling",
  "allOf": [
    {
      "$ref": "#/$defs/CommissionBillingInfo"
    },
    {
      "type": "object",
      "description": " ",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer",
          "description": "The unique Zywave identifier for the commission billing.",
          "format": "int32"
        },
        "updatedDateTimeOffSet": {
          "type": "string",
          "description": "The record of when the commission billing was last updated.",
          "format": "date-time"
        },
        "updatedUserProfileId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The unique Zywave identifier for the user that last updated the commission billing."
        },
        "updatedUserProfileTypeCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "The Zywave identifier for the user type that last updated the commission billing."
        },
        "billingVendorId": {
          "type": [
            "integer",
            "null"
          ],
          "readOnly": true,
          "description": "Denotes the Zywave ID of the billing vendor.",
          "format": "int32"
        }
      }
    }
  ],
  "$defs": {
    "CommissionBillingBaseInfo": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "billingCarrierCompanyId",
        "commissionType",
        "annualPremium"
      ],
      "properties": {
        "billingCarrierCompanyId": {
          "type": "integer",
          "description": "The identifier for the carrier company that is being billed. Has a dependency on a carrier company.  Please use the Carrier API for reference.",
          "format": "int32",
          "maximum": 2147483647.0,
          "minimum": -1.0
        },
        "commissionType": {
          "description": "The type of commission. Ex. Annual",
          "oneOf": [
            {
              "$ref": "#/$defs/CommissionTypeOption"
            }
          ]
        },
        "annualPremium": {
          "type": "number",
          "description": "The annual premium for the commission billing.",
          "format": "decimal",
          "maximum": 999999999999.99,
          "minimum": 0.0,
          "pattern": "^\\d+\\.?\\d{0,2}$"
        },
        "insuredPaymentScheduleId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The identifier for the insured payment schedule of the commission billing. Has a dependency on an insured payment schedule.  Please use the insured payment schedule endpoint for reference.",
          "format": "int32",
          "maximum": 2147483647.0,
          "minimum": 1.0
        },
        "billingModeId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The identifier for the billing mode of the commission billing.  Has a dependency on a billing mode item.  Please use the billing mode endpoint for reference.",
          "format": "int32",
          "maximum": 2147483647.0,
          "minimum": 1.0
        },
        "currentSubscriberCount": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The amount of subscribers for the policy tied to the commission billing.",
          "format": "int32"
        },
        "commissionProducerId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The identifier for the producer responsible for the commission.",
          "format": "int32",
          "maximum": 2147483647.0,
          "minimum": 1.0
        },
        "commissionRate": {
          "type": [
            "number",
            "null"
          ],
          "description": "The rate of the commission.",
          "format": "decimal",
          "maximum": 999.99,
          "minimum": 0.0,
          "pattern": "^\\d+\\.?\\d{0,2}$"
        },
        "annualCommission": {
          "type": [
            "number",
            "null"
          ],
          "description": "The total annual commission for the policy.",
          "format": "decimal",
          "maximum": 999999999999.99,
          "minimum": 0.0,
          "pattern": "^\\d+\\.?\\d{0,2}$"
        },
        "isPremiumCalculated": {
          "type": "boolean",
          "description": "The flag to toggle calculated premium"
        },
        "billingVendorSourceId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Denotes the source ID of the billing vendor (requires BillingCarrierCompanyId to be -1).",
          "maxLength": 36
        },
        "billingVendorSourceType": {
          "type": [
            "string",
            "null"
          ],
          "description": "Denotes the source type of the billing vendor (requires BillingCarrierCompanyId to be -1).",
          "maxLength": 32
        },
        "billingVendorSourceEntityName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Denotes the source entity name of the billing vendor (requires BillingCarrierCompanyId to be -1).",
          "maxLength": 32
        }
      }
    },
    "CommissionBillingInfo": {
      "allOf": [
        {
          "$ref": "#/$defs/CommissionBillingBaseInfo"
        },
        {
          "type": "object",
          "description": " ",
          "additionalProperties": false,
          "required": [
            "policyId"
          ],
          "properties": {
            "policyId": {
              "type": "integer",
              "description": "The identifier for the policy that is tied to the commission billing record. Has a dependency on a policy item.  Please use the policy endpoint for reference.",
              "format": "int32",
              "maximum": 2147483647.0,
              "minimum": 1.0
            }
          }
        }
      ]
    },
    "CommissionTypeOption": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Annual",
        "Unspecified"
      ],
      "enum": [
        "Annual",
        "Unspecified"
      ]
    }
  }
}