{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assetlab-ca/json-schema/assetlab-ca-asset-cost-create-schema.json",
  "title": "AssetCostCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assetlab-ca-asset-costs-api-openapi.yml#/components/schemas/AssetCostCreate",
  "type": "object",
  "required": [
    "asset_id",
    "amount"
  ],
  "properties": {
    "asset_id": {
      "type": "string",
      "format": "uuid"
    },
    "site_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "building_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "category": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "Acquisition",
        "Repair",
        "PM",
        "Operation",
        "Replacement",
        "Decommission",
        "Other"
      ]
    },
    "amount": {
      "type": "number",
      "description": "Money in the organization's currency - GET /v1/organization-settings for currency_code"
    },
    "cost_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "invoice_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "po_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "purchase_order_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Purchase order (see /purchase-orders) that paid this cost. Counts against the order's remaining balance unless the cost belongs to a work order, whose own purchase_order_id counts it; null clears it. po_number stays for order numbers typed as free text."
    },
    "vendor_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Vendor (see /vendors) this cost was paid to; null clears it."
    },
    "work_order_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "work_order_number": {
      "type": [
        "integer",
        "null"
      ]
    }
  }
}