{"id":26664373,"url":"https://github.com/stacksjs/ts-vat","last_synced_at":"2026-06-29T15:31:29.001Z","repository":{"id":284260077,"uuid":"954354634","full_name":"stacksjs/ts-vat","owner":"stacksjs","description":"🇪🇺 Simply handle EU MOSS / VAT tax regulations \u0026 calculations.","archived":false,"fork":false,"pushed_at":"2026-06-27T08:54:39.000Z","size":562,"stargazers_count":4,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-27T09:06:44.062Z","etag":null,"topics":["calculator","commerce","european-union","library","moss","tax","typescript","vat"],"latest_commit_sha":null,"homepage":"https://ts-vat.netlify.app","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/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["stacksjs","chrisbbreuer"],"open_collective":"stacksjs"}},"created_at":"2025-03-25T00:37:58.000Z","updated_at":"2026-06-10T11:51:35.000Z","dependencies_parsed_at":"2026-06-05T18:01:49.906Z","dependency_job_id":null,"html_url":"https://github.com/stacksjs/ts-vat","commit_stats":null,"previous_names":["stacksjs/ts-vat"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stacksjs/ts-vat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-vat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-vat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-vat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-vat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/ts-vat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fts-vat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34933498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"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":["calculator","commerce","european-union","library","moss","tax","typescript","vat"],"created_at":"2025-03-25T16:28:02.766Z","updated_at":"2026-06-29T15:31:28.993Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/stacksjs","https://github.com/sponsors/chrisbbreuer","https://opencollective.com/stacksjs"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\".github/art/cover.jpg\" alt=\"Social Card of this repo\"\u003e\u003c/p\u003e\n\n[![npm version](https://img.shields.io/npm/v/ts-vat?style=flat-square)](https://npmjs.com/package/ts-vat)\n[![GitHub Actions](https://img.shields.io/github/actions/workflow/status/stacksjs/ts-vat/ci.yml?style=flat-square\u0026branch=main)](https://github.com/stacksjs/ts-vat/actions?query=workflow%3Aci)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\n# ts-vat\n\nA TypeScript VAT calculator for EU countries. This package helps you calculate VAT rates for different EU countries, validate VAT numbers, and handle special VAT rules and exceptions.\n\n## Features\n\n- Calculate VAT for all EU countries\n- Support for different VAT rates (standard, reduced, super-reduced)\n- VAT number validation through VIES\n- Special VAT zones and exceptions handling\n- B2B and B2C VAT calculations\n- TypeScript support with full type safety\n\n## Installation\n\n```bash\nnpm install ts-vat\n```\n\n## Usage\n\n### Basic VAT Calculation\n\n```typescript\nimport { VatCalculator } from 'ts-vat'\n\nconst calculator = new VatCalculator()\n\n// Calculate VAT for a net price\nconst result = calculator.calculate(100, 'DE') // Germany\nconsole.log(result)\n// {\n//   netPrice: 100,\n//   grossPrice: 119,\n//   vatAmount: 19,\n//   vatRate: 0.19,\n//   countryCode: 'DE',\n//   isCompany: false\n// }\n\n// Calculate net price from gross price\nconst netResult = calculator.calculateNet(119, 'DE')\nconsole.log(netResult.netPrice) // 100\n```\n\n### B2B Transactions\n\n```typescript\nconst calculator = new VatCalculator({\n  businessCountryCode: 'DE'\n})\n\n// B2B transaction within same country\nconst result = calculator.calculate(100, 'DE', undefined, true)\nconsole.log(result.vatRate) // 0\n\n// B2B transaction with different country\nconst result2 = calculator.calculate(100, 'FR', undefined, true)\nconsole.log(result2.vatRate) // 0.20\n```\n\n### VAT Number Validation\n\n```typescript\nconst calculator = new VatCalculator()\n\n// Check if VAT number is valid\nconst isValid = await calculator.isValidVatNumber('DE123456789')\nconsole.log(isValid)\n\n// Get detailed VAT number information\nconst details = await calculator.getVatDetails('DE123456789')\nconsole.log(details)\n// {\n//   isValid: true,\n//   name: 'Company Name',\n//   address: 'Company Address',\n//   countryCode: 'DE',\n//   vatNumber: '123456789'\n// }\n```\n\n### Special VAT Zones\n\n```typescript\nconst calculator = new VatCalculator()\n\n// Calculate VAT for Heligoland (Germany)\nconst result = calculator.calculate(100, 'DE', 'Heligoland')\nconsole.log(result.vatRate) // 0\n```\n\n## Configuration\n\nYou can configure the calculator with custom options:\n\n```typescript\nconst calculator = new VatCalculator({\n  businessCountryCode: 'DE',\n  forwardSoapFaults: true,\n  soapTimeout: 5000, // 5 seconds\n  rules: {\n    // Custom VAT rules...\n  }\n})\n```\n\n## Testing\n\n```bash\nbun test\n```\n\n## Changelog\n\nPlease see our [releases](https://github.com/stackjs/ts-vat/releases) page for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/ts-vat/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\nStacks OSS will always stay open-sourced, and we will always love to receive postcards from wherever Stacks is used! _And we also publish them on our website. Thank you, Spatie._\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## Credits\n\n- [`vat-calculator`](https://github.com/driesvints/vat-calculator) _for the original PHP implementation_\n- [Chris Breuer](https://github.com/chrisbbreuer)\n- [All Contributors](https://github.com/stacksjs/ts-vat/contributors)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.\n\nMade with 💙\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fts-vat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Fts-vat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fts-vat/lists"}