{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cavuno-com/json-schema/cavuno-com-company-plan-invoice-schema.json",
  "title": "CompanyPlanInvoice",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cavuno-com-companies-api-openapi.yml#/components/schemas/CompanyPlanInvoice",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The plan invoice ID."
    },
    "object": {
      "type": "string",
      "enum": [
        "company_plan_invoice"
      ]
    },
    "companyId": {
      "type": "string"
    },
    "planId": {
      "type": "string"
    },
    "planName": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "issued",
        "paid",
        "canceled",
        "uncollectible"
      ],
      "description": "`issued`: awaiting payment. `paid`: paid, and the plan was assigned to the company. `canceled`: canceled before payment. `uncollectible`: marked uncollectible in Stripe."
    },
    "amountCents": {
      "type": "integer",
      "description": "Amount per invoice, in currency minor units."
    },
    "currency": {
      "type": "string",
      "description": "Lowercase ISO 4217 currency code."
    },
    "billingInterval": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "month",
        "year",
        null
      ],
      "description": "Null for a one-off invoice; otherwise how often it recurs."
    },
    "billingIntervalCount": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of intervals between invoices (3 months = quarterly)."
    },
    "contactEmail": {
      "type": "string",
      "description": "The billing email the invoice is for."
    },
    "hostedInvoiceUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment page for the employer. Cavuno does not send the invoice itself; share this link with them."
    },
    "dueAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO-8601 due date (30 days after issue)."
    },
    "assignmentId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The plan assignment created when the invoice was paid; null until then."
    },
    "createdAt": {
      "type": "string",
      "description": "ISO-8601 creation time."
    },
    "updatedAt": {
      "type": "string",
      "description": "ISO-8601 time of the last change."
    }
  },
  "required": [
    "id",
    "object",
    "companyId",
    "planId",
    "planName",
    "status",
    "amountCents",
    "currency",
    "billingInterval",
    "billingIntervalCount",
    "contactEmail",
    "hostedInvoiceUrl",
    "dueAt",
    "assignmentId",
    "createdAt",
    "updatedAt"
  ]
}