{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/api-evangelist/simplelegal/refs/heads/main/json-schema/simplelegal-invoice-schema.json", "title": "SimpleLegal Invoice", "description": "Schema representing a legal invoice in the SimpleLegal eBilling platform.", "type": "object", "properties": { "id": { "type": "string", "description": "Unique invoice identifier." }, "invoice_number": { "type": "string", "description": "Vendor-assigned invoice reference number." }, "matter_id": { "type": "string", "description": "ID of the matter this invoice is associated with." }, "vendor_id": { "type": "string", "description": "ID of the vendor submitting the invoice." }, "status": { "type": "string", "description": "Current invoice processing status.", "enum": ["pending", "approved", "rejected", "paid", "disputed", "hold"] }, "invoice_date": { "type": "string", "format": "date", "description": "Date the invoice was issued." }, "due_date": { "type": "string", "format": "date", "description": "Payment due date." }, "currency": { "type": "string", "description": "ISO 4217 currency code (e.g., USD, EUR, GBP).", "pattern": "^[A-Z]{3}$" }, "total_amount": { "type": "number", "format": "float", "description": "Total invoice amount before adjustments." }, "approved_amount": { "type": "number", "format": "float", "description": "Amount approved for payment after review." }, "line_items": { "type": "array", "description": "Individual billable time and expense line items.", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": ["fee", "expense", "tax", "discount"] }, "description": { "type": "string" }, "timekeeper": { "type": "string" }, "hours": { "type": "number", "format": "float" }, "rate": { "type": "number", "format": "float" }, "amount": { "type": "number", "format": "float" }, "task_code": { "type": "string" }, "activity_code": { "type": "string" } } } }, "created_at": { "type": "string", "format": "date-time", "description": "Timestamp when the invoice was received." }, "updated_at": { "type": "string", "format": "date-time", "description": "Timestamp when the invoice was last updated." } }, "required": ["invoice_number", "matter_id", "vendor_id", "total_amount"] }