Finance template

Saudi ZATCA Tax Invoice

ZATCA Phase 1 compliant bilingual tax invoice for Saudi businesses. VAT 15%, with QR code slot for the TLV-encoded payload.

Pro, Business & Scale plansCountry: SALanguage: ar+enKSA-ZATCA
slug: ksa-zatca-invoiceRendered with sample data
01

Quick start

Reference the template by its slug and pass your data. The same call works from any language; pick whichever fits your stack. Replace $KAMY_API_KEY with a key from the dashboard.

curl
curl https://kamy.dev/api/v1/render \
  -H "Authorization: Bearer $KAMY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "templateSlug": "ksa-zatca-invoice",
    "data": {
      "invoiceNumber": "INV-2026-1129",
      "issueDate": "2026-04-15",
      "issueTime": "14:32",
      "supplyDate": "2026-04-15",
      "invoiceType": "Standard",
      "currency": "SAR",
      "seller": {
        "name": "Atlas Cloud Services Co.",
        "vatNumber": "300123456700003",
        "crNumber": "1010234567",
        "address": [
          "King Fahd Road, Olaya District",
          "Riyadh 12333, Kingdom of Saudi Arabia"
        ],
        "email": "[email protected]",
        "iban": "SA03 8000 0000 6080 1016 7519"
      },
      "buyer": {
        "name": "Najm Insurance Services",
        "vatNumber": "300987654300001",
        "address": [
          "Al Olaya Tower, 7th Floor",
          "Riyadh 12244, KSA"
        ],
        "email": "[email protected]"
      },
      "lineItems": [
      // …
    }
  }'
node.js
import { Kamy } from "@kamydev/sdk";

const kamy = new Kamy({ apiKey: process.env.KAMY_API_KEY! });

const { url } = await kamy.render({
  templateSlug: "ksa-zatca-invoice",
  data: {
    "invoiceNumber": "INV-2026-1129",
    "issueDate": "2026-04-15",
    "issueTime": "14:32",
    "supplyDate": "2026-04-15",
    "invoiceType": "Standard",
    "currency": "SAR",
    "seller": {
      "name": "Atlas Cloud Services Co.",
      "vatNumber": "300123456700003",
      "crNumber": "1010234567",
      "address": [
        "King Fahd Road, Olaya District",
        "Riyadh 12333, Kingdom of Saudi Arabia"
      ],
      "email": "[email protected]",
      "iban": "SA03 8000 0000 6080 1016 7519"
    },
    "buyer": {
      "name": "Najm Insurance Services",
      "vatNumber": "300987654300001",
      "address": [
        "Al Olaya Tower, 7th Floor",
        "Riyadh 12244, KSA"
      ],
      "email": "[email protected]"
    },
    "lineItems": [
    // …
  },
});

console.log(url); // signed URL, valid for 1 hour
python
import os, requests

resp = requests.post(
    "https://kamy.dev/api/v1/render",
    headers={"Authorization": f"Bearer {os.environ['KAMY_API_KEY']}"},
    json={
        "templateSlug": "ksa-zatca-invoice",
        "data": {
          "invoiceNumber": "INV-2026-1129",
          "issueDate": "2026-04-15",
          "issueTime": "14:32",
          "supplyDate": "2026-04-15",
          "invoiceType": "Standard",
          "currency": "SAR",
          "seller": {
            "name": "Atlas Cloud Services Co.",
            "vatNumber": "300123456700003",
            "crNumber": "1010234567",
            "address": [
              "King Fahd Road, Olaya District",
              "Riyadh 12333, Kingdom of Saudi Arabia"
            ],
            "email": "[email protected]",
            "iban": "SA03 8000 0000 6080 1016 7519"
          },
          "buyer": {
            "name": "Najm Insurance Services",
            "vatNumber": "300987654300001",
            "address": [
              "Al Olaya Tower, 7th Floor",
              "Riyadh 12244, KSA"
            ],
            "email": "[email protected]"
          },
          "lineItems": [
          // …
        },
    },
)
resp.raise_for_status()
print(resp.json()["url"])
02

Sample payload

The full sample data the live preview above renders from. Use it as a starting point for your own integration — every field is optional except those marked required in the schema below.

json
{
  "invoiceNumber": "INV-2026-1129",
  "issueDate": "2026-04-15",
  "issueTime": "14:32",
  "supplyDate": "2026-04-15",
  "invoiceType": "Standard",
  "currency": "SAR",
  "seller": {
    "name": "Atlas Cloud Services Co.",
    "vatNumber": "300123456700003",
    "crNumber": "1010234567",
    "address": [
      "King Fahd Road, Olaya District",
      "Riyadh 12333, Kingdom of Saudi Arabia"
    ],
    "email": "[email protected]",
    "iban": "SA03 8000 0000 6080 1016 7519"
  },
  "buyer": {
    "name": "Najm Insurance Services",
    "vatNumber": "300987654300001",
    "address": [
      "Al Olaya Tower, 7th Floor",
      "Riyadh 12244, KSA"
    ],
    "email": "[email protected]"
  },
  "lineItems": [
    {
      "description": "Managed Kubernetes cluster — Q2 2026",
      "quantity": 3,
      "unitPrice": 8500,
      "netAmount": 25500,
      "vatRate": 15,
      "vatAmount": 3825,
      "lineTotal": 29325
    },
    {
      "description": "24/7 incident response retainer",
      "quantity": 1,
      "unitPrice": 14000,
      "netAmount": 14000,
      "vatRate": 15,
      "vatAmount": 2100,
      "lineTotal": 16100
    }
  ],
  "subtotal": 39500,
  "discountAmount": 0,
  "totalVat": 5925,
  "total": 45425,
  "paymentTerms": "Net 30 from issue date.",
  "notes": "Approved per SOW dated 2026-01-12."
}
03

JSON Schema

The render endpoint validates your payload against this JSON Schema before queuing the render. Validation errors come back with HTTP 400 and a VALIDATION_FAILED code listing every offending path.

json
{
  "type": "object",
  "required": [
    "invoiceNumber",
    "issueDate",
    "seller",
    "lineItems",
    "subtotal",
    "totalVat",
    "total"
  ],
  "properties": {
    "invoiceNumber": {
      "type": "string",
      "minLength": 1
    },
    "issueDate": {
      "type": "string"
    },
    "issueTime": {
      "type": "string"
    },
    "supplyDate": {
      "type": "string"
    },
    "invoiceType": {
      "type": "string",
      "enum": [
        "Standard",
        "Simplified"
      ]
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "qrCodeDataUrl": {
      "type": "string",
      "pattern": "^data:image/(png|svg\\+xml);base64,[A-Za-z0-9+/=]+$"
    },
    "seller": {
      "type": "object",
      "required": [
        "name",
        "vatNumber"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "vatNumber": {
          "type": "string",
          "pattern": "^[0-9]{15}$"
        },
        "crNumber": {
          "type": "string"
        },
        "address": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "iban": {
          "type": "string"
        }
      }
    },
    "buyer": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "vatNumber": {
          "type": "string",
          "pattern": "^[0-9]{15}$"
        },
        "address": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      }
    },
    "lineItems": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "description",
          "quantity",
          "unitPrice",
          "netAmount",
          "vatRate",
          "vatAmount",
          "lineTotal"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1
          },
          "quantity": {
            "type": "number",
            "minimum": 0
          },
          "unitPrice": {
            "type": "number"
          },
          "netAmount": {
            "type": "number"
          },
          "vatRate": {
            "type": "number",
            "minimum": 0
          },
          "vatAmount": {
            "type": "number",
            "minimum": 0
          },
          "lineTotal": {
            "type": "number"
          }
        }
      }
    },
    "subtotal": {
      "type": "number"
    },
    "discountAmount": {
      "type": "number"
    },
    "totalVat": {
      "type": "number"
    },
    "total": {
      "type": "number"
    },
    "notes": {
      "type": "string"
    },
    "paymentTerms": {
      "type": "string"
    }
  }
}
Saudi ZATCA Tax Invoice template — Kamy PDF API — Kamy