Skip to content

A sample Appliication which connects Tax Jar API for Taxation

Notifications You must be signed in to change notification settings

jdvemulakonda/Juniper.Taxation

Repository files navigation

TaxApi

TaxApi API endpoints provide detailed sales tax rates and calculations. Currently this Api supports below two methods

  1. GET /v1/tax/rate : Gets the Tax rates for a given location
  2. POST /v1/tax/ordersaletax : Calculates the taxes for an order

Api Specifications:

Getting Started

These instructions will help you to get a copy of this project up and running on your local machine for development and testing purposes.

Prerequisites

Required software instalations

  1. Coding Platform : .Net Core v3.1
  2. Testing Tool (Optional) : Postman
  3. Code Editors : Visual Studio 2022 / Visual Studio Code

Code Structure

As per the Screenshot there are 6 projects in the solution

  1. Juniper.TaxApi :WebApi Starting point of the project with all the dependency injections and settings required to start the solution.This Also contains middleware and extensions which are required
  2. Juniper.TaxApi.Core.Application : This is the heart of the business logic layer.It interacts with the Entities project This Project has the following directories.
    1. Exceptions : Different kind of exception thrown by the project.
    2. Interfaces :(This can be seperated out to a different project all together) This contains the interface definitions for all the infrastructure services and any other interfaces required for communicating with webapi.
    3. Models : Contains all the Request and response objects for the webapi.
    4. Wrappers : Implementations for any wrapper required for Entities or response objects.
  3. Juniper.TaxApi.Core.Domain : This contains all the domain entities and core objects required for the business layer. This should be independent from any other external serivces or influences.This could also encompass relations between entitiesa and other pure business validations.
  4. Juniper.TaxApi.Tests : Unit test project for for Juniper.TaxApi project
  5. Juniper.Taxation.Infrastructure.Providers : Any external apis/providers which are required for accomplishing the work required by the business layer. For example Taxjar is the provider now, but it could have some more provider in the future 6.. Juniper.Taxation.Infrastructure.ExternalCommunicationService : This project contains all the external communication methods like HttpClient, Wcf services, Socker Communication etc.

image

ApiConsumer Configuration

The Actions require a consumer key for the provide ( Taxjar in this case). The provider configurations are stored here appSettings.json "ConsumerKeyProviderConfiguration": { "ProviderConfigurations": [ { "ProviderKey": "Juniper", "ProviderBaseEndPoint": "https://api.taxjar.com/", "AuthToken": "5da2f821eee4035db4771edab942a4cc", "IsTokenAuthRequired": true }, { "ProviderKey": "Test", "ProviderBaseEndPoint": "https://sample.com", "AuthToken": "test_key", "IsTokenAuthRequired": false } ] }

Api Actions/Methods

  1. GET /v1/tax/rate : Gets the Tax rates for a given location

    image

  2. POST /v1/tax/ordersaletax : Calculates the taxes for an order

    image

Swagger Documentation

LaunchSetting.js has the swagger URL as the launch URL. Once the code is executed users will be able to see the SwaggerUI on their browsers as below.

image

About

A sample Appliication which connects Tax Jar API for Taxation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages