{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/unified-to/refs/heads/main/json-schema/unified-to-accounting-invoice-schema.json",
  "title": "AccountingInvoice",
  "description": "AccountingInvoice schema from Unified.to API",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "due_at": {
      "type": "string",
      "format": "date-time"
    },
    "paid_at": {
      "type": "string",
      "format": "date-time"
    },
    "refunded_at": {
      "type": "string",
      "format": "date-time"
    },
    "cancelled_at": {
      "type": "string",
      "format": "date-time"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "total_amount": {
      "type": "number"
    },
    "paid_amount": {
      "type": "number"
    },
    "refund_amount": {
      "type": "number"
    },
    "tax_amount": {
      "type": "number"
    },
    "discount_amount": {
      "type": "number"
    },
    "balance_amount": {
      "type": "number"
    },
    "invoice_number": {
      "type": "string"
    },
    "reference": {
      "type": "string"
    },
    "contact_id": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "refund_reason": {
      "type": "string"
    },
    "lineitems": {
      "$ref": "#/components/schemas/property_AccountingInvoice_lineitems"
    },
    "status": {
      "type": "string",
      "enum": [
        "DRAFT",
        "VOIDED",
        "AUTHORIZED",
        "PAID",
        "PARTIALLY_PAID",
        "PARTIALLY_REFUNDED",
        "REFUNDED",
        "SUBMITTED",
        "DELETED",
        "OVERDUE"
      ],
      "x-speakeasy-unknown-values": "allow"
    },
    "url": {
      "type": "string"
    },
    "payment_collection_method": {
      "type": "string",
      "enum": [
        "send_invoice",
        "charge_automatically"
      ],
      "x-speakeasy-unknown-values": "allow"
    },
    "type": {
      "type": "string",
      "enum": [
        "BILL",
        "INVOICE",
        "CREDITMEMO"
      ],
      "x-speakeasy-unknown-values": "allow"
    },
    "attachments": {
      "$ref": "#/components/schemas/property_AccountingInvoice_attachments"
    },
    "send": {
      "type": "boolean"
    },
    "organization_id": {
      "type": "string"
    },
    "raw": {
      "type": "object",
      "additionalProperties": true
    }
  }
}