sign_invoice
Apply XAdES-BES digital signature to an unsigned ZATCA invoice XML using PEM certificate and private key, generating signed XML, invoice hash, QR code, and compliance status.
Instructions
Digitally sign a ZATCA invoice with XAdES-BES.
Takes an unsigned invoice XML and applies a digital signature using the provided certificate and private key. Produces a signed XML with embedded XAdES-BES signature in UBLExtensions, and rebuilds the QR code with Phase 2 tags (hash, signature, public key).
Args: invoice_xml: Unsigned UBL 2.1 XML invoice string certificate_pem: PEM-encoded X.509 certificate from ZATCA private_key_pem: PEM-encoded ECDSA private key
Returns: JSON with signed_xml, invoice_hash, qr_base64, and compliance status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoice_xml | Yes | ||
| certificate_pem | Yes | ||
| private_key_pem | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |