From 7ec8b5a225d9a3327be3f2ca8b83f22f0b071d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6rd=C5=91s=20Andr=C3=A1s?= Date: Thu, 17 Oct 2024 18:22:27 +0200 Subject: [PATCH 1/2] init Tax ID Pro --- .../Tax ID Pro/apiDefinition.swagger.json | 276 ++++++++++++++++++ .../Tax ID Pro/apiProperties.json | 24 ++ .../Tax ID Pro/readme.md | 24 ++ .../Tax ID Pro/script.csx | 21 ++ 4 files changed, 345 insertions(+) create mode 100644 independent-publisher-connectors/Tax ID Pro/apiDefinition.swagger.json create mode 100644 independent-publisher-connectors/Tax ID Pro/apiProperties.json create mode 100644 independent-publisher-connectors/Tax ID Pro/readme.md create mode 100644 independent-publisher-connectors/Tax ID Pro/script.csx diff --git a/independent-publisher-connectors/Tax ID Pro/apiDefinition.swagger.json b/independent-publisher-connectors/Tax ID Pro/apiDefinition.swagger.json new file mode 100644 index 0000000000..00ec401f62 --- /dev/null +++ b/independent-publisher-connectors/Tax ID Pro/apiDefinition.swagger.json @@ -0,0 +1,276 @@ +{ + "swagger": "2.0", + "info": { + "title": "Tax ID Pro", + "description": "Tax ID Pro makes it easy to validate over 200 different tax ID formats for over 100+ countries.", + "version": "1.0", + "contact": { + "name": "Fördős András", + "email": "fordosa90+ipc_tip@gmail.com" + } + }, + "host": "v3.api.taxid.pro", + "basePath": "/", + "schemes": [ + "https" + ], + "consumes": [], + "produces": [], + "paths": { + "/validate": { + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "properties": { + "is_valid": { + "type": "boolean", + "description": "Defines, whether the tax number is valid or not.", + "title": "Is valid?" + }, + "message": { + "type": "string", + "description": "If the tax number is invalid, this property provides further guidance.", + "title": "Message" + }, + "tin_compact": { + "type": "string", + "description": "Compact format of the tax number.", + "title": "TIN compact" + }, + "tin_standard": { + "type": "string", + "description": "Tax number in its standard format.", + "title": "TIN standard" + }, + "country_name": { + "type": "string", + "description": "Name of the identified country to where the tax number belongs.", + "title": "Country name" + }, + "format_name": { + "type": "string", + "description": "Name of the tax number format.", + "title": "Format name" + } + } + } + } + }, + "summary": "Tax ID Validation", + "operationId": "Validate", + "description": "The Tax ID Pro API makes it easy to validate tax ID numbers for over 100 countries.", + "parameters": [ + { + "name": "country", + "in": "query", + "required": true, + "type": "string", + "x-ms-summary": "Country", + "description": "A two-letter country code, as defined in the ISO standard. If you need to use IRS country codes, see the is_irs query parameter" + }, + { + "name": "tin", + "in": "query", + "required": true, + "type": "string", + "x-ms-summary": "TIN", + "description": "The tax ID Number. It may contain numbers, letters (uppercase or lowercase), dots, dashes, or slashes." + }, + { + "name": "type", + "in": "query", + "required": false, + "type": "string", + "description": "Specify type of tax number. Exclude this parameter to test all available types for a given country.", + "x-ms-summary": "Type", + "enum": [ + "individual", + "entity", + "vat" + ] + }, + { + "name": "locale", + "in": "query", + "required": false, + "type": "string", + "x-ms-summary": "Locale", + "description": "Determines the language of the message property in the response. Messages are in English by default.", + "enum": [ + "auto", + "nl", + "en", + "fr", + "de", + "it", + "jp", + "ru", + "es" + ] + }, + { + "name": "is_irs", + "in": "query", + "required": false, + "type": "boolean", + "description": "If you are using IRS country codes instead of ISO country codes, set is_irs to true", + "x-ms-summary": "Is IRS" + } + ] + } + }, + "/lookup": { + "get": { + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object", + "properties": { + "is_valid": { + "type": "boolean", + "description": "Defines, whether the tax number is valid or not.", + "title": "Is valid?" + }, + "message": { + "type": "string", + "description": "If the tax number is invalid, this property provides further guidance.", + "title": "Message" + }, + "tin_compact": { + "type": "string", + "description": "Compact format of the tax number.", + "title": "TIN compact" + }, + "tin_standard": { + "type": "string", + "description": "Tax number in its standard format.", + "title": "TIN standard" + }, + "country_name": { + "type": "string", + "description": "Name of the identified country to where the tax number belongs.", + "title": "Country name" + }, + "format_name": { + "type": "string", + "description": "Name of the tax number format.", + "title": "Format name" + }, + "lookup_data": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Associated name.", + "title": "Name" + }, + "address": { + "type": "string", + "description": "Associated address.", + "title": "Address" + } + } + } + } + } + } + }, + "summary": "Tax ID Lookup", + "operationId": "Lookup", + "description": "The lookup endpoint first validates the tax number, then enriches the response with additional data.", + "parameters": [ + { + "name": "country", + "in": "query", + "required": true, + "type": "string", + "x-ms-summary": "Country", + "description": "A two-letter country code, as defined in the ISO standard. If you need to use IRS country codes, see the is_irs query parameter" + }, + { + "name": "tin", + "in": "query", + "required": true, + "type": "string", + "x-ms-summary": "TIN", + "description": "The tax ID Number. It may contain numbers, letters (uppercase or lowercase), dots, dashes, or slashes." + }, + { + "name": "type", + "in": "query", + "required": false, + "type": "string", + "description": "Specify type of tax number. Exclude this parameter to test all available types for a given country.", + "x-ms-summary": "Type", + "enum": [ + "individual", + "entity", + "vat" + ] + }, + { + "name": "locale", + "in": "query", + "required": false, + "type": "string", + "x-ms-summary": "Locale", + "description": "Determines the language of the message property in the response. Messages are in English by default.", + "enum": [ + "auto", + "nl", + "en", + "fr", + "de", + "it", + "jp", + "ru", + "es" + ] + }, + { + "name": "is_irs", + "in": "query", + "required": false, + "type": "boolean", + "description": "If you are using IRS country codes instead of ISO country codes, set is_irs to true", + "x-ms-summary": "Is IRS" + } + ] + } + } + }, + "definitions": {}, + "parameters": {}, + "responses": {}, + "securityDefinitions": { + "API Key": { + "type": "apiKey", + "in": "header", + "name": "api_key" + } + }, + "security": [ + { + "API Key": [] + } + ], + "tags": [], + "x-ms-connector-metadata": [ + { + "propertyName": "Website", + "propertyValue": "https://taxid.pro/" + }, + { + "propertyName": "Privacy policy", + "propertyValue": "https://taxid.pro/docs/privacy-policy" + }, + { + "propertyName": "Categories", + "propertyValue": "Data" + } + ] +} \ No newline at end of file diff --git a/independent-publisher-connectors/Tax ID Pro/apiProperties.json b/independent-publisher-connectors/Tax ID Pro/apiProperties.json new file mode 100644 index 0000000000..3f05e9e063 --- /dev/null +++ b/independent-publisher-connectors/Tax ID Pro/apiProperties.json @@ -0,0 +1,24 @@ +{ + "properties": { + "connectionParameters": { + "api_key": { + "type": "securestring", + "uiDefinition": { + "displayName": "API Key", + "description": "The API Key for this api", + "tooltip": "Provide your API Key", + "constraints": { + "tabIndex": 2, + "clearText": false, + "required": "true" + } + } + } + }, + "iconBrandColor": "#da3b01", + "capabilities": [], + "policyTemplateInstances": [], + "publisher": "Fördős András", + "stackOwner": "Balancer Services LLC" + } +} \ No newline at end of file diff --git a/independent-publisher-connectors/Tax ID Pro/readme.md b/independent-publisher-connectors/Tax ID Pro/readme.md new file mode 100644 index 0000000000..aace9fbca2 --- /dev/null +++ b/independent-publisher-connectors/Tax ID Pro/readme.md @@ -0,0 +1,24 @@ +# Tax ID Pro +Tax ID Pro makes it easy to validate over 200 different tax ID formats for over 100+ countries. + +## Publisher: Fördős András + +## Prerequisites +There are no prerequisites needed for this connector. + +## Obtaining Credentials +You need to have an API key, for which you must sign for the service. There is a free plan available, follow the instructions here: [https://taxid.pro/docs/getting-started](https://taxid.pro/docs/getting-started) + +## Supported Operations +### Validate +The Tax ID Pro API makes it easy to validate tax ID numbers for over 100 countries. +### Lookup +The lookup endpoint first validates the tax number, then enriches the response with additional data. + +## Known Issues and Limitations +There are no known issues at this time. + +The connector does not implement the batch endpoint from the udnerlying service, while there might be missing parameters and properties too. If you miss anything, get in touch and let's figure out together how to bring in the missing pie + +Additionally, there might be limits applied by the underlying service based on your subscription plan. + diff --git a/independent-publisher-connectors/Tax ID Pro/script.csx b/independent-publisher-connectors/Tax ID Pro/script.csx new file mode 100644 index 0000000000..479564d845 --- /dev/null +++ b/independent-publisher-connectors/Tax ID Pro/script.csx @@ -0,0 +1,21 @@ +public class Script : ScriptBase +{ + public override async Task ExecuteAsync() + { + addBearerPrefix(); + + var response = await Context.SendAsync(Context.Request, CancellationToken) + .ConfigureAwait(continueOnCapturedContext: false); + + return response; + } + + private void addBearerPrefix() { + var headerValuesToken = Context.Request.Headers.GetValues("api_key"); + var apikey = headerValuesToken.FirstOrDefault(); + + Context.Request.Headers.Remove("api_key"); + Context.Request.Headers.Remove("Authorization"); + Context.Request.Headers.TryAddWithoutValidation("Authorization", "Bearer " + apikey); + } +} From eac6b45eb89700391d7c6d7f76386100ae32bfc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=B6rd=C5=91s=20Andr=C3=A1s?= Date: Tue, 5 Nov 2024 19:34:45 +0100 Subject: [PATCH 2/2] resolve review --- independent-publisher-connectors/Tax ID Pro/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/independent-publisher-connectors/Tax ID Pro/readme.md b/independent-publisher-connectors/Tax ID Pro/readme.md index aace9fbca2..4eae3b810b 100644 --- a/independent-publisher-connectors/Tax ID Pro/readme.md +++ b/independent-publisher-connectors/Tax ID Pro/readme.md @@ -18,7 +18,7 @@ The lookup endpoint first validates the tax number, then enriches the response w ## Known Issues and Limitations There are no known issues at this time. -The connector does not implement the batch endpoint from the udnerlying service, while there might be missing parameters and properties too. If you miss anything, get in touch and let's figure out together how to bring in the missing pie +The connector does not implement the batch endpoint from the underlying service, while there might be missing parameters and properties too. If you miss anything, get in touch and let's figure out together how to bring in the needed functionality. Additionally, there might be limits applied by the underlying service based on your subscription plan.