diff --git a/spec/capabilities/einvoicing-provider.schema.json b/spec/capabilities/einvoicing-provider.schema.json new file mode 100644 index 0000000..a6b71e8 --- /dev/null +++ b/spec/capabilities/einvoicing-provider.schema.json @@ -0,0 +1,439 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$ref": "#/definitions/ProviderCapabilitySchema", + "definitions": { + "ProviderCapabilitySchema": { + "type": "object", + "description": "The main schema that defines the structure of both E-invoicing Provider's production and sandbox capabilities.", + "additionalProperties": false, + "properties": { + "prod": { + "$ref": "#/definitions/CapabilityBody" + }, + "sandbox": { + "$ref": "#/definitions/CapabilityBody" + } + }, + "required": [ + "prod", + "sandbox" + ], + "title": "ProviderCapabilitySchema" + }, + "CapabilityBody": { + "type": "object", + "description": "Specifies the capabilities and configurations of the E-invoicing Provider for a given environment (e.g., production or sandbox).", + "additionalProperties": false, + "properties": { + "identity_configuration": { + "$ref": "#/definitions/IdentityConfiguration", + "description": "Specifies Identity Configuration details of the E-invoicing provider such as Logo url, description, compliance related details." + }, + "api_configuration": { + "$ref": "#/definitions/APIConfiguration", + "description": "Specifies API configuration details of the E-invoicing provider including the base URL and any necessary credentials." + }, + "capabilities": { + "$ref": "#/definitions/Capabilities", + "description": "Specifies the capabilities supported by the E-invoicing provider with additional details such as supported countries and currencies." + }, + "supported_number_of_line_items": { + "type": "integer", + "description": "Specifies the supported number of line items in an invoice or a credit note.", + "examples": [ + 1200 + ] + } + }, + "required": [ + "api_configuration", + "capabilities", + "identity_configuration", + "supported_number_of_line_items" + ], + "title": "Prod" + }, + "APIConfiguration": { + "type": "object", + "description": "Specifies API configuration details of the E-invoicing provider including the base URL and any necessary credentials.", + "additionalProperties": false, + "properties": { + "api_base_url": { + "type": "string", + "description": "Specifies the E-invoicing provider's Base URL.", + "format": "uri", + "qt-uri-protocols": [ + "https" + ], + "examples": [ + "https://api.einvoice-provider.com/integrations/chargebee/api/v1" + ] + }, + "credential_configuration": { + "type": "array", + "description": "Specifies the list of parameters that the E-invoicing provider needs for authentication & authorization.", + "items": { + "$ref": "#/definitions/CredentialConfiguration" + } + } + }, + "required": [ + "api_base_url", + "credential_configuration" + ], + "examples": [ + { + "api_base_url": "https://api.avalara-einv.com/integrations/chargebee/api/v1", + "credential_configuration": [ + { + "id": "api_key", + "is_required": true, + "is_sensitive": true, + "name": "Avalara API Key", + "type": "text" + } + ] + } + ], + "title": "APIConfiguration" + }, + "CredentialConfiguration": { + "type": "object", + "description": "Specifies the list of parameters that the E-invoicing provider needs for authentication & authorization.", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "description": "Specifies the parameter name that the E-invoicing provider expects.", + "examples": [ + "api_key" + ] + }, + "name": { + "type": "string", + "description": "Specifies the name of parameter to be displayed in the E-invoicing provider app on Chargebee platform.", + "examples": [ + "E-invoicing Provider API Key" + ] + }, + "type": { + "type": "string", + "description": "Specifies the type of the parameter.", + "enum": [ + "text", + "password" + ] + }, + "is_sensitive": { + "type": "boolean", + "description": "Specifies the the case sensitivity of the parameter." + }, + "is_required": { + "type": "boolean", + "description": "Specifies if the E-invoicing provider expects this parameter mandatorily." + }, + "multi_entity_support": { + "type": "boolean", + "description": "Specifies if the parameter supports multiple values for different accounts of same merchant." + } + }, + "required": [ + "id", + "is_required", + "is_sensitive", + "name", + "type" + ], + "examples": [ + { + "id": "api_key", + "is_required": true, + "is_sensitive": true, + "name": "Avalara API Key", + "type": "text" + } + ], + "title": "CredentialConfiguration" + }, + "Capabilities": { + "type": "object", + "additionalProperties": false, + "properties": { + "supported_countries": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + "DE", "AT", "FR", "IT", "ES", "NL", "PL", "PT", "SE", "FI", "NO", "DK", "BE" + ], + "description": "Specifies the countries(ISO 3166 alpha-2 country code format) supported by the E-invoicing provider." + }, + "supported_currencies": { + "type": "array", + "description": "Specifies the supported currencies(ISO 4217 format) by the E-invoicing provider for the E-invoicing capability", + "items": { + "type": "string" + }, + "examples": [ + "USD", "EUR", "GBP", "AUD", "CAD", "JPY", "INR", "CNY", "BRL", "MXN" + ] + }, + "retrieve_activation_supported": { + "type": "boolean", + "description": "Specifies if retrieving merchant activation info from E-invoicing provider portal via Chargebee is supported." + }, + "retrieve_einvoice_status_supported": { + "type": "boolean", + "description": "Specifies if fetching e-invoice status for a given invoice is supported." + }, + "customer_identifiers": { + "$ref": "#/definitions/CustomerIdentifiers", + "description": "Specifies the customer identifiers required for E-invoicing in different countries." + } + }, + "required": [ + "supported_countries", + "supported_currencies", + "retrieve_activation_supported", + "retrieve_einvoice_status_supported", + "customer_identifiers" + ], + "examples": [ + { + "supported_countries": [ + "DE", "AT", "FR", "IT", "ES", "NL", "PL", "PT", "SE", "FI", "NO", "DK", "BE" + ], + "supported_currencies": [ + "USD", "EUR", "GBP", "AUD", "CAD", "JPY", "INR", "CNY", "BRL", "MXN" + ], + "retrieve_activation_supported": true, + "retrieve_einvoice_status_supported": true, + "customer_identifiers": [ + { + "external_id": "vat_number", + "display_name": "Vat Number", + "is_mandatory": true, + "is_default": false, + "field_type": "text", + "applicable_countries": [ + "DE", "AT", "FR", "IT", "ES" + ] + }, + { + "external_id": "gln_number", + "display_name": "GLN", + "is_mandatory": false, + "is_default": false, + "field_type": "text", + "applicable_countries": [ + "NL", "PL", "PT", "SE", "FI", "NO", "DK", "BE" + ] + } + ] + } + ], + "title": "Capabilities" + }, + "CustomerIdentifiers": { + "type": "array", + "description": "Specifies the customer identifiers required for E-invoicing in different countries.", + "items": { + "$ref": "#/definitions/CustomerIdentifier" + } + }, + "CustomerIdentifier": { + "type": "object", + "description": "Specifies the e-invoicing identifier for the customer and the countries where it is required.", + "additionalProperties": false, + "properties": { + "external_id": { + "type": "string", + "description": "Specifies the parameter name the E-invoicing provider expects.", + "examples": [ + "vat_number" + ] + }, + "display_name": { + "type": "string", + "description": "Specifies the name of the parameter to be displayed in Chargebee platform.", + "examples": [ + "Vat Number" + ] + }, + "is_mandatory": { + "type": "boolean", + "description": "Specifies if the parameter is mandatory." + }, + "is_default": { + "type": "boolean", + "deprecated": true, + "description": "Specifies if the parameter has a default value." + }, + "field_type": { + "type": "string" + }, + "applicable_countries": { + "type": "array", + "description": "Specifies the countries(ISO 3166 alpha-2 country code format) which require this identifier", + "items": { + "type": "string" + }, + "examples": [ + "DE" + ] + } + }, + "required": [ + "display_name", + "external_id", + "field_type", + "applicable_countries" + ], + "examples": [ + { + "external_id": "vat_number", + "display_name": "Vat Number", + "is_mandatory": true, + "is_default": false, + "field_type": "text", + "applicable_countries": [ + "DE", + "AT" + ] + } + ], + "title": "CustomerIdentifier" + }, + "IdentityConfiguration": { + "type": "object", + "description": "Specifies Identity Configuration details of the E-invoicing provider such as Logo url, description, compliance related details.", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "description": "Specifies the identifier of the E-invoicing provider" + }, + "type": { + "type": "array", + "description": "Specifies the list of the features that the E-invoicing provider supports. In the case of E-invoicing Integration this would be EINVOICING", + "items": { + "type": "string", + "enum": [ + "EINVOICING" + ] + } + }, + "display_name": { + "type": "string", + "description": "Specifies the display name of the E-invoicing provider in Chargebee platform.", + "examples": [ + "Avalara" + ] + }, + "logo_url": { + "type": "string", + "description": "Specifies the logo url of the E-invoicing provider to display in Chargebee platform.", + "format": "uri", + "qt-uri-protocols": [ + "https" + ], + "qt-uri-extensions": [ + ".png" + ] + }, + "primary_description": { + "type": "array", + "description": "Specifies the primary description of the E-invoicing provider.", + "items": { + "type": "string" + } + }, + "secondary_description": { + "type": "array", + "description": "Specifies the secondary description of the E-invoicing provider.", + "items": { + "type": "string" + } + }, + "signup_url": { + "type": "string", + "description": "Specifies the url for the merchant to sign up with the E-invoicing provider.", + "format": "uri", + "qt-uri-protocols": [ + "https" + ] + }, + "consent_policy_url": { + "type": "string", + "description": "Specifies the url about the consent related details of the E-invoicing provider for the merchant." + }, + "privacy_policy_url": { + "type": "string", + "description": "Specifies the url about the privacy related details of the E-invoicing provider for the merchant." + }, + "terms_of_service_url": { + "type": "string", + "description": "Specifies the url about the terms of services related details of the E-invoicing provider for the merchant.", + "format": "uri", + "qt-uri-protocols": [ + "https" + ] + }, + "documentation_url": { + "type": "string", + "description": "Specifies the url about the documentation details of the E-invoicing provider for the merchant.", + "format": "uri", + "qt-uri-protocols": [ + "https" + ], + "qt-uri-extensions": [ + ".html" + ] + }, + "support_email": { + "type": "string", + "description": "Specifies the support email of the E-invoicing provider to reach out to incase of queries or escalations.", + "format": "email" + } + }, + "required": [ + "consent_policy_url", + "display_name", + "documentation_url", + "id", + "type", + "logo_url", + "primary_description", + "privacy_policy_url", + "secondary_description", + "signup_url", + "support_email", + "terms_of_service_url" + ], + "examples": [ + { + "consent_policy_url": " https://www.avalara-einv.com/privacy-terms", + "display_name": "Avalara E-invoicing", + "documentation_url": "https://www.chargebee.com/docs/2.0/avalara.html", + "id": "avalara", + "type": [ + "EINVOICING" + ], + "logo_url": "https://cdn.prod.website-avalara_files.einv_logo.svg", + "primary_description": [ + "Avalara supports E-invoicing of your subscriptions to meet government mandates." + ], + "privacy_policy_url": " https://www.avalara-einv.com/privacy-terms", + "secondary_description": [ + "Make your invoices compliant." + ], + "signup_url": "https://avalara-einv.com/contact/request-demo", + "support_email": "support@avalara-einv.com", + "terms_of_service_url": "https://www.avalara-einv.com/privacy-terms" + } + ], + "title": "IdentityConfiguration" + } + } +} \ No newline at end of file diff --git a/spec/capabilities/tax-provider.schema.json b/spec/capabilities/tax-provider.schema.json index f37358d..413a43b 100644 --- a/spec/capabilities/tax-provider.schema.json +++ b/spec/capabilities/tax-provider.schema.json @@ -128,6 +128,10 @@ "is_required":{ "type":"boolean", "description":"Specifies if the Provider expects this parameter mandatorily." + }, + "multi_entity_support": { + "type": "boolean", + "description": "Specifies if the parameter supports multiple values for different accounts of same merchant." } }, "required":[ @@ -145,7 +149,7 @@ "properties":{ "supported_countries":{ "type":"array", - "description":"Specifies the supported countries(ISO 3166 alpha-2 country code format) by the Provider for all the capabilities such as Tax calculation, syncing invoices/credit notes, TRN validation. If supported countries are different for each capabilities, it shall be specified under the respective capability.", + "description":"Specifies the supported countries(ISO 3166 alpha-2 country code format) by the Provider for all the capabilities such as Tax calculation, syncing invoices/credit notes, Tax Registration Number validation. If supported countries are different for each capabilities, it shall be specified under the respective capability.", "items":{ "type":"string" }, @@ -209,16 +213,15 @@ "$ref":"#/definitions/SyncCapabilities", "description":"Specifies details on credit note sync capability." }, - "trn_validation_capabilities":{ - "$ref":"#/definitions/TrnValidationCapabilities", - "description":"Specifies details on TRN validation capability." + "tax_reg_number_validation_capabilities":{ + "$ref":"#/definitions/TaxRegNumValidationCapabilities", + "description":"Specifies details on Tax Registration Number validation capability." } }, "required":[ "can_have_customer_identifiers", "can_have_product_identifiers", "can_support_currency_inclusive_of_taxes", - "can_support_standalone_credit_notes", "can_sync_credit_notes", "can_sync_invoices", "can_validate_shipping_address", @@ -307,7 +310,7 @@ ], "title":"SyncCapabilities" }, - "TrnValidationCapabilities":{ + "TaxRegNumValidationCapabilities":{ "type":"object", "additionalProperties":false, "properties":{ @@ -315,9 +318,20 @@ "type":"boolean", "description":"Specifies if the capability is supported." }, + "async_configuration": { + "type": "object", + "properties": { + "is_supported": { + "type": "boolean" + } + }, + "required": [ + "is_supported" + ] + }, "batch_configuration":{ "type":"object", - "description": "Specifies batch TRN Validation related configurations.", + "description": "Specifies batch Tax Registration Number Validation related configurations.", "properties":{ "is_supported":{ "type":"boolean", @@ -342,7 +356,7 @@ "properties":{ "reference_number":{ "type":"object", - "description":"Specifies about reference number configuration. Reference number is the number that provider provides as a proof of the TRN Validation.", + "description":"Specifies about reference number configuration. Reference number is the number that provider provides as a proof of the Tax Registration Number Validation.", "properties":{ "is_supported":{ "type":"boolean", @@ -470,14 +484,14 @@ "type":"string", "description":"Specifies the identifier of the Provider" }, - "provider_type":{ + "type":{ "type":"array", "description":"Specifies the list of the features that the Provider supports. Provider may support Tax or Tax Registration Number(TRN) Validation capabilities or both.", "items":{ "type":"string", "enum":[ "TAX", - "TRN_VALIDATION" + "TAX_REG_NUMBER_VALIDATION" ] } },