{"id":19622171,"url":"https://github.com/commercetools/connect-tax-integration-template","last_synced_at":"2026-06-25T13:31:45.839Z","repository":{"id":217651421,"uuid":"700829199","full_name":"commercetools/connect-tax-integration-template","owner":"commercetools","description":"About Toolkit for developing a Tax integration with commercetools","archived":false,"fork":false,"pushed_at":"2026-02-11T10:36:33.000Z","size":2101,"stargazers_count":1,"open_issues_count":22,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-15T00:03:31.107Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/commercetools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"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}},"created_at":"2023-10-05T11:32:24.000Z","updated_at":"2026-02-11T10:36:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0e40f87-2096-4545-a18e-327239474e1f","html_url":"https://github.com/commercetools/connect-tax-integration-template","commit_stats":null,"previous_names":["commercetools/connect-tax-integration-template"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/commercetools/connect-tax-integration-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-tax-integration-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-tax-integration-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-tax-integration-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-tax-integration-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/connect-tax-integration-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-tax-integration-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34778079,"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-25T02:00:05.521Z","response_time":101,"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":[],"created_at":"2024-11-11T11:26:26.233Z","updated_at":"2026-06-25T13:31:45.808Z","avatar_url":"https://github.com/commercetools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# connect-tax-integration-template\nThis repository provides a [connect](https://docs.commercetools.com/connect) template for a tax integration connector for tax amount calculation performed by external tax provider with cart/order data from composable commerce. This boilerplate code acts as a starting point for such integration.\n\nThis template uses the [Cart](https://docs.commercetools.com/api/projects/carts),  [Order](https://docs.commercetools.com/api/projects/orders), [API Extension](https://docs.commercetools.com/api/projects/api-extensions), data models from commercetools composable commerce which can be used for querying store-specific product data to sync into external systems. Template is based on asynchronous [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions) to keep the external systems up to date.\n\n## Template Features\n- NodeJS supported.\n- Uses Express as web server framework.\n- Uses [commercetools SDK](https://docs.commercetools.com/sdk/js-sdk-getting-started) for the commercetools-specific communication.\n- Includes local development utilities in npm commands to build, start, test, lint \u0026 prettify code.\n- Uses JSON formatted logger with log levels\n- Setup sample unit and integration tests with [sinon](https://sinonjs.org/), [Jest](https://jestjs.io/) and [supertest](https://github.com/ladjs/supertest#readme)\n\n## Prerequisite\n#### 1. commercetools composable commerce API client\nUsers are expected to create API client responsible for API extension creation as well as fetching cart and order details from composable commerce project, API client should have enough scope to be able to do so. These API client details are taken as input as an environment variable/ configuration for connect. Details of composable commerce project can be provided as environment variables (configuration for connect) `CTP_PROJECT_KEY` , `CTP_CLIENT_ID`, `CTP_CLIENT_SECRET`, `CTP_SCOPE`, `CTP_REGION`. For details, please read [Deployment Configuration](./README.md#deployment-configuration).\n\n#### 2. External tax provider\nUsers are expected to create api clients/ keys in external tax provider. Those details are taken as input as an environment variable / configuration for connect. API token to external tax provider can be provided as environment variables (configuration for connect) `TAX_PROVIDER_API_TOKEN`. For details, please read [Deployment Configuration](./README.md#deployment-configuration).\n \n## Getting started\nThe template contains two separated modules:\n- Tax Calculator: Provides a REST-API to users to calculate tax amount through external tax provider by inputting cart details. It is triggered automatically by API extension when cart(should be in frozen state and with tax mode as ExternalAmount) is updated.  \n- Order Syncer: Receives message from commercetools project once there is an order created in commercetools store. The order and its corresponding cart details are then synchronized to the external tax provider for accounting and compliance purposes in addition to filing tax returns with tax authorities.\n\nRegarding the development of both modules, please refer to the following documentations:\n- [Development of Tax Calculator](tax-calculator/README.md)\n- [Development of Order Syncer](order-syncer/README.md)\n\n#### 1. Develop your specific needs \nTo calculate tax amount by cart details and synchronize order details to external tax provider, users need to extend this connector with the following tasks\n- Data Persistence: Implementation to communicate between this connector application and the external system using libraries provided by external tax provider. Please remember that the product data might not be saved into the external system in a single attempt, it should have needed retry and recovery mechanism.\n\n#### 2. Register as connector in commercetools Connect\nFollow guidelines [here](https://docs.commercetools.com/connect/getting-started) to register the connector for public/private use.\n\n## Deployment Configuration\nIn order to deploy your customized connector application on commercetools Connect, it needs to be published. For details, please refer to [documentation about commercetools Connect](https://docs.commercetools.com/connect/concepts)\nIn addition, in order to support connect, the tax integration connector template has a folder structure as listed below\n```\n├── tax-calculator\n│   ├── src\n│   ├── test\n│   └── package.json\n├── order-syncer\n│   ├── src\n│   ├── test\n│   └── package.json\n└── connect.yaml\n```\n\nConnect deployment configuration is specified in `connect.yaml` which is required information needed for publishing of the application. Following is the deployment configuration used by tax calculator and order syncer modules\n```\ndeployAs:\n  - name: tax-calculator\n    applicationType: service\n    endpoint: /taxCalculator\n    scripts:\n      postDeploy: npm install \u0026\u0026 npm run connector:post-deploy\n      preUndeploy: npm install \u0026\u0026 npm run connector:pre-undeploy\n    configuration:\n      standardConfiguration:\n        - key: CTP_REGION\n          description: region of commercetools composable commerce project\n      securedConfiguration:\n        - key: CTP_PROJECT_KEY\n          description: commercetools composable commerce project key\n        - key: CTP_CLIENT_ID\n          description: commercetools composable commerce client ID\n        - key: CTP_CLIENT_SECRET\n          description: commercetools composable commerce client secret\n        - key: CTP_SCOPE\n          description: commercetools composable commerce client scope\n        - key: TAX_PROVIDER_API_TOKEN\n          description: API Token for communication between the connector and tax provider\n  - name: order-syncer\n    applicationType: event\n    endpoint: /orderSyncer\n    scripts:\n      postDeploy: npm install \u0026\u0026 npm run connector:post-deploy\n      preUndeploy: npm install \u0026\u0026 npm run connector:pre-undeploy\n    configuration:\n      standardConfiguration:\n        - key: CTP_REGION\n          description: region of commercetools composable commerce project\n      securedConfiguration:\n        - key: CTP_PROJECT_KEY\n          description: commercetools project key\n        - key: CTP_CLIENT_ID\n          description: commercetools client ID\n        - key: CTP_CLIENT_SECRET\n          description: commercetools client secreet\n        - key: CTP_SCOPE\n          description: commercetools client scope\n        - key: TAX_PROVIDER_API_TOKEN\n          description: API Token for communication between the connector and tax provider\n```\n\nHere you can see the details about various variables in configuration\n- CTP_PROJECT_KEY: The key of commercetools composable commerce project.\n- CTP_CLIENT_ID: The client ID of your commercetools composable commerce user account. It is used in commercetools client to communicate with commercetools composable commerce via SDK.\n- CTP_CLIENT_SECRET: The client secret of commercetools composable commerce user account. It is used in commercetools client to communicate with commercetools composable commerce via SDK.\n- CTP_SCOPE: The scope constrains the endpoints to which the commercetools client has access, as well as the read/write access right to an endpoint.\n- CTP_REGION: As the commercetools composable commerce APIs are provided in six different region, it defines the region which your commercetools composable commerce user account belongs to.\n- TAX_PROVIDER_API_TOKEN: It defines the API token provided by the external system, which is used to access their API from the connector application.\n\n## Recommendations\n#### Implement your own test cases\nWe have provided sample unit and integration test cases with [sinon](https://sinonjs.org/), [Jest](https://jestjs.io/) and [supertest](https://github.com/ladjs/supertest#readme). The implementation is under `test` folder in both `tax-calculator` and `order-syncer` modules. It is recommended to implement further test cases based on your own needs to test your development. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-tax-integration-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Fconnect-tax-integration-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-tax-integration-template/lists"}