{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/invoicecraftly/main/json-schema/invoicecraftly-public-structured-artifact-request-v1-schema.json", "title": "PublicStructuredArtifactRequestV1", "x-generated": "2026-09-25", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/invoicecraftly-openapi.json#/components/schemas/PublicStructuredArtifactRequestV1", "type": "object", "additionalProperties": false, "required": [ "document" ], "properties": { "document": { "$ref": "#/$defs/PublicDocumentV1" }, "supplement": { "$ref": "#/$defs/ComplianceSupplementV1" } }, "$defs": { "Branding": { "type": "object", "additionalProperties": false, "properties": { "accentColor": { "type": "string", "pattern": "^#[0-9a-fA-F]{3,8}$" }, "stampStyle": { "type": "string", "enum": [ "round", "square", "none" ] }, "logo": { "$ref": "#/$defs/Logo" } } }, "ComplianceLine": { "type": "object", "required": [ "sourceIndex" ], "properties": { "sourceIndex": { "type": "integer", "minimum": 0 }, "unitCode": { "type": "string", "maxLength": 8 }, "vatCategoryCode": { "type": "string", "enum": [ "AE", "B", "E", "G", "K", "L", "M", "O", "S", "Z" ] }, "vatExemptionReason": { "type": "string", "maxLength": 256 }, "vatExemptionReasonCode": { "type": "string", "maxLength": 64 } } }, "ComplianceParty": { "type": "object", "properties": { "postalAddress": { "$ref": "#/$defs/PostalAddress" }, "electronicAddressSchemeId": { "type": "string" }, "taxId": { "$ref": "#/$defs/TaxIdMetadata" }, "vatIdentifier": { "type": "string", "maxLength": 256 }, "taxRegistrationIdentifier": { "$ref": "#/$defs/TaxRegistrationIdentifier" } } }, "ComplianceSupplementV1": { "type": "object", "description": "Optional EN16931-core metadata. Unknown nested fields are ignored by the current normalizer; listed fields are the supported public surface.", "properties": { "version": { "type": "integer", "enum": [ 1 ] }, "buyerReference": { "type": "string", "maxLength": 256 }, "seller": { "$ref": "#/$defs/ComplianceParty" }, "buyer": { "$ref": "#/$defs/ComplianceParty" }, "lines": { "type": "array", "maxItems": 250, "items": { "$ref": "#/$defs/ComplianceLine" } } } }, "LineItem": { "type": "object", "additionalProperties": false, "required": [ "description", "quantity", "unitPrice", "taxRate" ], "properties": { "description": { "type": "string", "minLength": 1 }, "quantity": { "type": "number", "exclusiveMinimum": 0 }, "unitPrice": { "type": "number", "minimum": 0 }, "taxRate": { "type": "number", "minimum": 0, "maximum": 100 }, "taxLabel": { "type": "string" } } }, "Logo": { "type": "object", "additionalProperties": false, "required": [ "data", "mimeType" ], "properties": { "data": { "type": "string", "contentEncoding": "base64", "description": "Base64 image data. Decoded size is limited to 512 KiB." }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg" ] } } }, "Party": { "type": "object", "additionalProperties": false, "required": [ "name", "addressLines" ], "properties": { "name": { "type": "string", "minLength": 1 }, "addressLines": { "type": "array", "items": { "type": "string" } } } }, "Payment": { "type": "object", "additionalProperties": false, "properties": { "bankName": { "type": "string" }, "iban": { "type": "string" }, "bic": { "type": "string" }, "accountNumber": { "type": "string" }, "routingNumber": { "type": "string" }, "reference": { "type": "string" }, "poNumber": { "type": "string" }, "terms": { "type": "string" }, "dueText": { "type": "string" }, "qrMode": { "type": "string", "enum": [ "", "contact", "epc", "paymentLink" ] } } }, "PostalAddress": { "type": "object", "properties": { "countryCode": { "type": "string", "pattern": "^[A-Za-z]{2}$" }, "city": { "type": "string", "maxLength": 128 }, "postalCode": { "type": "string", "maxLength": 128 }, "region": { "type": "string", "maxLength": 128 } } }, "PublicDocumentV1": { "type": "object", "additionalProperties": false, "required": [ "type", "issueDate", "currency", "seller", "buyer", "items" ], "properties": { "type": { "type": "string", "enum": [ "invoice" ], "description": "Only invoice is currently supported." }, "number": { "type": "string" }, "issueDate": { "type": "string", "format": "date" }, "dueDate": { "type": "string", "format": "date" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, "locale": { "type": "string" }, "template": { "type": "string", "enum": [ "ledger" ], "description": "Only Ledger is currently supported." }, "seller": { "$ref": "#/$defs/Party" }, "buyer": { "$ref": "#/$defs/Party" }, "items": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/LineItem" } }, "payment": { "$ref": "#/$defs/Payment" }, "notes": { "type": "string" }, "branding": { "$ref": "#/$defs/Branding" } } }, "TaxIdMetadata": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "seller-id", "legal-registration", "tax-registration", "vat" ] }, "schemeId": { "type": "string", "maxLength": 32 }, "taxSchemeId": { "type": "string", "maxLength": 32 } } }, "TaxRegistrationIdentifier": { "type": "object", "properties": { "value": { "type": "string", "maxLength": 256 }, "taxSchemeId": { "type": "string", "maxLength": 32 } } } } }