{"id":21179142,"url":"https://github.com/avadev/avatax-rest-v2-jre-sdk","last_synced_at":"2025-07-09T22:32:10.596Z","repository":{"id":14446501,"uuid":"76078766","full_name":"avadev/AvaTax-REST-V2-JRE-SDK","owner":"avadev","description":"AvaTax v2 SDK for languages using the JRE","archived":false,"fork":false,"pushed_at":"2024-11-12T20:50:52.000Z","size":4654,"stargazers_count":12,"open_issues_count":6,"forks_count":25,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-12T21:33:52.170Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avadev.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-09T23:44:37.000Z","updated_at":"2024-11-12T20:50:36.000Z","dependencies_parsed_at":"2024-04-23T18:40:15.343Z","dependency_job_id":"c9634604-0d49-4f73-84bb-dd1573a7af97","html_url":"https://github.com/avadev/AvaTax-REST-V2-JRE-SDK","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avadev%2FAvaTax-REST-V2-JRE-SDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avadev%2FAvaTax-REST-V2-JRE-SDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avadev%2FAvaTax-REST-V2-JRE-SDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avadev%2FAvaTax-REST-V2-JRE-SDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avadev","download_url":"https://codeload.github.com/avadev/AvaTax-REST-V2-JRE-SDK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225600917,"owners_count":17494727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-20T17:28:56.649Z","updated_at":"2024-11-20T17:28:57.250Z","avatar_url":"https://github.com/avadev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AvaTax-REST-V2-JRE-SDK\nThis GitHub repository is the Java Runtime Environment SDK for Avalara's world-class tax service, AvaTax. It uses the AvaTax REST v2 API, which is a fully REST implementation and provides a single client for all AvaTax functionality. For more information about AvaTax REST v2, please visit [Avalara's Developer Network](https://developer.avalara.com) or view the [online Swagger documentation](https://sandbox-rest.avatax.com/swagger/ui/index.html).\n\n# Build Status\n\nMaven Central\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.avalara.avatax/avatax-rest-v2-api-java_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.avalara.avatax/avatax-rest-v2-api-java_2.11)\n\nTravis-CI\n\n[![Travis](https://api.travis-ci.org/avadev/AvaTax-REST-V2-JRE-SDK.svg?branch=master\u0026style=plastic)](https://travis-ci.org/avadev/AvaTax-REST-V2-JRE-SDK)\n\n# Installing the JRE SDK\n\nThe AvaTax JRE SDK is available for download on [Maven](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22net.avalara.avatax%22).\n\nFor the AvaTax JRE SDK, there are four different files available to download:\n* **pom** : This Project Object Model is an XML file that contains information about the project and configuration details used by Maven to build the project. This file is not needed in order to run the AvaTax JRE SDK. \n* **jar** : This is what file you will use to import into your project in order to access AvaTax. This file is needed in order to run the AvaTax JRE SDK. \n* **javadoc.jar** : This file is documentation generated from the source code in the jar file. This file is not needed in order to run the AvaTax JRE SDK.\n* **sources.jar** : This file contains the source code for the jar file. This file is not needed in order to run the AvaTax JRE SDK, but it is helpful to use in order to view the code within the jar file in the editor. In order to view the code, download this file and attach it as a source to the jar file. \n\nOnce you have the jar file downloaded, import it into your editor as an external jar file. \n\n# Using the JRE SDK\n\nThe JRE SDK uses a fluent interface to define a connection to AvaTax and to make API calls to calculate tax on transactions. Here's an example of how to connect to AvaTax in Java:\n\n```java\nimport java.math.BigDecimal;\nimport net.avalara.avatax.rest.client.AvaTaxClient;\nimport net.avalara.avatax.rest.client.TransactionBuilder;\nimport net.avalara.avatax.rest.client.enums.AvaTaxEnvironment;\nimport net.avalara.avatax.rest.client.enums.DocumentType;\nimport net.avalara.avatax.rest.client.enums.TransactionAddressType;\nimport net.avalara.avatax.rest.client.models.PingResultModel;\nimport net.avalara.avatax.rest.client.models.TransactionModel;\n\npublic class Program {\n\tpublic static void main(String[] args) {\n\t\t//creates our AvaTaxClient\n\t\tAvaTaxClient client = new AvaTaxClient(\"Test\", \"1.0\", \"localhost\", AvaTaxEnvironment.Sandbox)\n\t\t\t\t.withSecurity(\"MyUsername\", \"MyPassword\"); //replace with your username and password\n\t\t\n\t\ttry {\n\t\t\t//verify that we can ping successfully\n\t\t\tPingResultModel ping = client.ping();\n\t\t\tif(ping.getAuthenticated()) {\n\t\t\t\tSystem.out.print(\"Successfully created a client!\");\n\t\t\t}\n\t\t} catch (Exception e) {}\t\t\n\t\t\n\t\t//builds the Transaction and creates the TransactionModel\n\t\ttry {\n\t\t\tTransactionModel transaction = new TransactionBuilder(client, \"DEFAULT\", DocumentType.SalesInvoice, \"ABC\")\n\t\t\t.withAddress(TransactionAddressType.SingleLocation, \"123 Main Street\", null, null, \"Irvine\", \"CA\", \"92615\", \"US\")\n\t\t\t.withLine( new BigDecimal(100.0), new BigDecimal(1), \"P0000000\")\n            .Create();\n\t\t} catch (Exception e) {}\n\t\t\n\t}\n\n}\n```\n# Updates\n\nTwo functions have been updated in 19.9.1\n\n```java\n\tdownloadTaxRatesByZipCodeAsync(Date date, String region)\n\tdownloadTaxRatesByZipCodeAsync(Date date, String region)\n```\nhave been changed to \n```java\n\tdownloadTaxRatesByZipCodeAsync(String date, String region)\n\tdownloadTaxRatesByZipCodeAsync(String date, String region)\n```\n\n# How to enable logging in SDK\n* SLF4J The Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction for various logging frameworks.\n* Client would need to implement the slf4j provider (or binding) on their end like Log4J, Logback etc to enable logging.\n* By default there is no logging enabled.\n* All the attributes which are part of log message are in **LogObject.java**\n* To enable or disable logging of request and response object, there is a boolean variable **shouldLogRequestAndResponse** in AvataxConstants. Default is set to **FALSE**\n* Output of logging is in **JSON** format.\n\nFollowing example shows how logging could be enabled on client side using Log4J.\n* In build.sbt or pom.xml we would add the following changes:\n```java\n// build.sbt\n\"org.slf4j\" % \"slf4j-log4j12\" % \"2.0.1\"\n\n//pom.xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.slf4j\u003c/groupId\u003e\n    \u003cartifactId\u003eslf4j-log4j12\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n* Make sure to refresh the project to get the latest dependencies\n* Under src - \u003e main - \u003e resources folder create log4j.properties file and add the configurations which would cater your needs. One such example is below\n```java\nlog4j.rootLogger=INFO, STDOUT\nlog4j.appender.STDOUT=org.apache.log4j.ConsoleAppender\nlog4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout\nlog4j.appender.STDOUT.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n\n```\nPlease note that log4j.properties(or any other configuration) file could contain a variety of configurations such as adding logs to a log file, how to construct the log file name etc.\nCurrent example only shows the configuration to display logs at console only.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favadev%2Favatax-rest-v2-jre-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favadev%2Favatax-rest-v2-jre-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favadev%2Favatax-rest-v2-jre-sdk/lists"}