{"id":36501317,"url":"https://github.com/axenda/zatca","last_synced_at":"2026-01-12T02:21:52.014Z","repository":{"id":38008229,"uuid":"429544347","full_name":"axenda/zatca","owner":"axenda","description":"An unofficial package to help developers implement ZATCA (Fatoora) QR code easily which is required for e-invoicing in Saudi Arabia.","archived":false,"fork":false,"pushed_at":"2023-07-19T05:36:23.000Z","size":787,"stargazers_count":57,"open_issues_count":5,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-18T16:50:17.516Z","etag":null,"topics":["e-invoicing","fatoora","javascript","nodejs","npm","qr-code","qrcode","saudi-arabia","typescript","zatca"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axenda.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ihadabs"],"custom":["https://www.buymeacoffee.com/axenda"]}},"created_at":"2021-11-18T18:52:56.000Z","updated_at":"2025-06-19T17:38:56.000Z","dependencies_parsed_at":"2024-06-19T00:15:10.404Z","dependency_job_id":"6990aa6e-6ea1-4021-9efb-4e6cd7024a74","html_url":"https://github.com/axenda/zatca","commit_stats":{"total_commits":18,"total_committers":3,"mean_commits":6.0,"dds":"0.16666666666666663","last_synced_commit":"0aadfdeca9333787a7424763aad1cb541e61ac89"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/axenda/zatca","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axenda%2Fzatca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axenda%2Fzatca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axenda%2Fzatca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axenda%2Fzatca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axenda","download_url":"https://codeload.github.com/axenda/zatca/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axenda%2Fzatca/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["e-invoicing","fatoora","javascript","nodejs","npm","qr-code","qrcode","saudi-arabia","typescript","zatca"],"created_at":"2026-01-12T02:21:51.208Z","updated_at":"2026-01-12T02:21:52.002Z","avatar_url":"https://github.com/axenda.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ihadabs","https://www.buymeacoffee.com/axenda"],"categories":[],"sub_categories":[],"readme":"# ZATCA (Fatoorah) QR-Code Implementation\n\n[![NPM](https://nodei.co/npm/@axenda/zatca.png?mini=true)](https://npmjs.org/package/@axenda/zatca)\n\n![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/axenda/zatca/Running%20Code%20Coverage/main)\n[![codecov](https://codecov.io/gh/axenda/zatca/branch/main/graph/badge.svg?token=T52NJXGE0O)](https://codecov.io/gh/axenda/zatca)\n[![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/user/project/master/LICENSE)\n\nAn unofficial package to help developers implement ZATCA (Fatoora) QR code easily which is required for e-invoicing in\nSaudi Arabia.\n\n\u003e ✨ You could use it in both frontend and backend Nodejs projects.\n\n\u003e ✅ Validated to have the same output as ZATCA's SDK as of 18 November 2021.\n\n## Installation\n\nTo get started, install the package:\n\n```bash\nnpm i --save @axenda/zatca\n```\n\n## Usage\n\n### Summary\n\nSimple, all you need to generate a QR code is:\n\n```typescript\nimport { Invoice } from '@axenda/zatca';\n\nconst invoice = new Invoice({\n\tsellerName: 'Axenda',\n\tvatRegistrationNumber: '1234567891',\n\tinvoiceTimestamp: '2021-12-04T00:00:00Z',\n\tinvoiceTotal: '100.00',\n\tinvoiceVatTotal: '15.00',\n});\n\nconst imageData = await invoice.render();\n\n// Read the following sections for more details.\n```\n\n### Import\n\nFirst, import Invoice class or Tag class to represent an invoice QR code:\n\n```typescript\nimport { Invoice } from '@axenda/zatca';\n// or\nimport { Tag } from '@axenda/zatca';\n```\n\n### Representing an invoice QR code\n\nSecond, create an instance of Invoice or an array of Tag class:\n\n```typescript\nconst invoice = new Invoice({\n\tsellerName: 'Axenda',\n\tvatRegistrationNumber: '1234567891',\n\tinvoiceTimestamp: '2021-12-04T00:00:00Z',\n\tinvoiceTotal: '100.00',\n\tinvoiceVatTotal: '15.00',\n});\n// or\nconst tags: Tag[] = [\n\tnew Tag(1, 'Axenda'),\n\tnew Tag(2, '1234567891'),\n\tnew Tag(3, '2021-12-04T00:00:00Z'),\n\tnew Tag(4, '100.00'),\n\tnew Tag(5, '15.00'),\n];\n```\n\n### Generate TLV\n\nNow you can generate TLV string from the invoice or from the tags array:\n\n```typescript\ninvoice.toTlv();\n\n// or using tags array\n\nimport { toTlv } from '@axenda/zatca';\n\ntoTlv(tags)\n```\n\n### Generate Base64\n\nYou cloud generate Base64 string from the invoice or from the tags array:\n\n```typescript\ninvoice.toBase64();\n\n// or using tags array\n\nimport { tagsToBase64 } from '@axenda/zatca';\n\ntagsToBase64(tags);\n```\n\n### Render QR code\n\nYou can generate image data (png) from base64 string and render it in browser:\n\n```typescript\nawait invoice.render();\n\n// or using tags array\n\nimport { renderTags } from '@axenda/zatca';\n\nawait renderTags(tags);\n```\n\n### Use QR code image data\n\nUse the image data to display the QR code in browser:\n\n```html\n\u003c!-- For React --\u003e\n\u003cimg src={imageData} alt=\"Invoice QR Code\"\u003e\n\u003c!-- For Angular --\u003e\n\u003cimg [src]=\"imageData\"/\u003e\n\u003c!-- Just use the imageData variable no matter what framework you use  --\u003e\n```\n\n## Tests\n\nTo run test suites, first install dependencies, then run `npm test`:\n\n```bash\nnpm install\nnpm test\n```\n\n## Package roadmap\n\n- [x] Support ZATCA invoice QR code phase 1\n- [ ] Review package API consistency\n- [ ] Support ZATCA invoice QR code phase 2\n\n## Contributing\n\nWe welcome [contributions](https://github.com/axenda/zatca/graphs/contributors) of all kinds from anyone. Please take a\nmoment to review the [guidelines for contributing](CONTRIBUTING.md).\n\n* [Bug reports](https://github.com/axenda/zatca/issues/new)\n* [Feature requests](CONTRIBUTING.md#-feature-requests)\n* [Pull requests](CONTRIBUTING.md#-pull-requests)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxenda%2Fzatca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxenda%2Fzatca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxenda%2Fzatca/lists"}