salestaxpal - rest api · directly from your applications or test the apis from google postman rest...

94
SalesTaxPAL, Inc. © SalesTaxPAL 2018 SalesTaxPAL (STP) - REST API USER GUIDE Fastest and easiest way to collect most accurate online e-commerce sales and use taxes. API Version 1.0 Table of Content SALESTAXPAL (STP) - REST API USER GUIDE ................................................................................................ 1 API VERSION.............................................................................................................................................................. 1 TABLE OF CONTENT ............................................................................................................................................... 1 MOBILE APP............................................................................................................................................................... 4 WEB APP...................................................................................................................................................................... 4 API LIST ....................................................................................................................................................................... 4 TENANT, PARTY AND USERS................................................................................................................................ 4 EXISTING USER......................................................................................................................................................... 5 NEW USER................................................................................................................................................................... 5 REGISTER ................................................................................................................................................................... 5 INSTALL MOBILE APP ............................................................................................................................................ 6 DOWNLOAD REST API SAMPLES ........................................................................................................................ 6 ABOUT DOWNLOADED API SAMPLES............................................................................................................... 6 HEADERS .................................................................................................................................................................... 7 APPLICATION SECRET................................................................................................................................................. 7 CHANGE APPLICATION SECRET.................................................................................................................................. 8 API ACCESS TOKEN GENERATION ............................................................................................................................. 8 API CALL USING ACCESS TOKEN .............................................................................................................................. 9 COMPUTE TAX ........................................................................................................................................................ 10 CALCULATE SALES TAXES - SIMPLE EXAMPLE......................................................................................................... 10 Request attributes ............................................................................................................................................... 10 REQUEST ........................................................................................................................................................... 12 Response attributes ............................................................................................................................................. 12 RESPONSE ......................................................................................................................................................... 14 EXAMPLE-2: CALCULATE SALES TAXES ON AN ITEM WITH SHIPPING AND HANDLING.............................................. 15 REQUEST ........................................................................................................................................................... 15 RESPONSE ......................................................................................................................................................... 16 EXAMPLE-3: CALCULATE SALES TAXES WITH LINE ITEMS IN A HIERARCHY. ........................................................... 16

Upload: others

Post on 28-May-2020

39 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

SalesTaxPAL (STP) - REST API USER GUIDE Fastest and easiest way to collect most accurate online e-commerce sales and use taxes.

API Version 1.0

Table of Content

SALESTAXPAL (STP) - REST API USER GUIDE ................................................................................................ 1

API VERSION .............................................................................................................................................................. 1

TABLE OF CONTENT ............................................................................................................................................... 1

MOBILE APP............................................................................................................................................................... 4

WEB APP ...................................................................................................................................................................... 4

API LIST ....................................................................................................................................................................... 4

TENANT, PARTY AND USERS ................................................................................................................................ 4

EXISTING USER......................................................................................................................................................... 5

NEW USER................................................................................................................................................................... 5

REGISTER ................................................................................................................................................................... 5

INSTALL MOBILE APP ............................................................................................................................................ 6

DOWNLOAD REST API SAMPLES ........................................................................................................................ 6

ABOUT DOWNLOADED API SAMPLES ............................................................................................................... 6

HEADERS .................................................................................................................................................................... 7

APPLICATION SECRET ................................................................................................................................................. 7 CHANGE APPLICATION SECRET.................................................................................................................................. 8 API ACCESS TOKEN GENERATION ............................................................................................................................. 8 API CALL USING ACCESS TOKEN .............................................................................................................................. 9

COMPUTE TAX ........................................................................................................................................................ 10

CALCULATE SALES TAXES - SIMPLE EXAMPLE......................................................................................................... 10 Request attributes ............................................................................................................................................... 10 REQUEST ........................................................................................................................................................... 12 Response attributes ............................................................................................................................................. 12 RESPONSE ......................................................................................................................................................... 14

EXAMPLE-2: CALCULATE SALES TAXES ON AN ITEM WITH SHIPPING AND HANDLING. ............................................. 15 REQUEST ........................................................................................................................................................... 15 RESPONSE ......................................................................................................................................................... 16

EXAMPLE-3: CALCULATE SALES TAXES WITH LINE ITEMS IN A HIERARCHY. ........................................................... 16

Page 2: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

REQUEST ........................................................................................................................................................... 17 RESPONSE ......................................................................................................................................................... 19

EXAMPLE-4: CALCULATE SALES TAXES AND SAVE AS AN INVOICE (I.E. ORDER) ..................................................... 19 REQUEST ........................................................................................................................................................... 19 RESPONSE ......................................................................................................................................................... 20

EXAMPLE-5: USING ITEM ATTRIBUTES FOR SPECIAL PROCESSING SUCH AS ECO FEES, TIRE FEES ETC. .................... 20 Special Item Attributes to note in Request .......................................................................................................... 21 REQUEST ........................................................................................................................................................... 21 Special taxes to note in the Response ................................................................................................................. 22 RESPONSE ......................................................................................................................................................... 22

EXAMPLE-6: COMPUTE TAX AT A SINGLE LOCATION ............................................................................................... 24 REQUEST ........................................................................................................................................................... 24 RESPONSE ......................................................................................................................................................... 25

INVOICE TAX ........................................................................................................................................................... 25

WAYS TO SAVE INVOICES ......................................................................................................................................... 25 INVOICE TAX WITH BOTH LINE ITEMS AND TAXES ARE FILLED UP ............................................................................ 26

Request attributes ............................................................................................................................................... 26 REQUEST ........................................................................................................................................................... 27 Response attributes ............................................................................................................................................. 29 RESPONSE ......................................................................................................................................................... 29

INVOICE TAX (WITH ONLY LINE ITEMS ARE FILLED UP) ............................................................................................ 29 REQUEST ........................................................................................................................................................... 29 RESPONSE ......................................................................................................................................................... 30

GET INVOICE ........................................................................................................................................................... 30

GET SINGLE INVOICE ............................................................................................................................................... 30 Request ............................................................................................................................................................... 31 Response ............................................................................................................................................................. 31

GET SINGLE INVOICE WITH ADJUSTMENT HISTORY .................................................................................................. 31 Request ............................................................................................................................................................... 31 Response ............................................................................................................................................................. 31

GET MULTIPLE INVOICES .......................................................................................................................................... 32 Request ............................................................................................................................................................... 32 Response ............................................................................................................................................................. 32

GET INVOICE SUMMARY .......................................................................................................................................... 32 Example-1: Query with all parameters .............................................................................................................. 32

Request attributes .............................................................................................................................................................. 33 Request .............................................................................................................................................................................. 33 Response ........................................................................................................................................................................... 33 Response attributes ........................................................................................................................................................... 33

Example-2: Query using only the date range ..................................................................................................... 34 Request .............................................................................................................................................................................. 34 Response ........................................................................................................................................................................... 34

TAX ADJUSTMENT ................................................................................................................................................. 35

TYPES OF ADJUSTMENTS .......................................................................................................................................... 35 REFUND ADJUSTMENT ............................................................................................................................................. 35

Request attributes ............................................................................................................................................... 35 REQUEST ........................................................................................................................................................... 36 RESPONSE ......................................................................................................................................................... 36

CHARGE ADJUSTMENT ............................................................................................................................................. 37 REQUEST ........................................................................................................................................................... 37 RESPONSE ......................................................................................................................................................... 37

ADJUSTMENT ON MULTIPLE LINE ITEMS AT A TIME .................................................................................................. 37 REQUEST ........................................................................................................................................................... 38

ADJUSTMENT RESTRICTIONS .................................................................................................................................... 38 Single quantity line item ID ................................................................................................................................ 38

Page 3: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Multi-quantity line item ID ................................................................................................................................. 38 Partial refund ..................................................................................................................................................................... 39 Full refund ......................................................................................................................................................................... 40 Charge again ..................................................................................................................................................................... 40

SALES TAX REPORT .............................................................................................................................................. 41

SUMMARY REPORT .................................................................................................................................................. 41 Request attributes ............................................................................................................................................... 41 Request ............................................................................................................................................................... 41 Response attributes ............................................................................................................................................. 41 Response ............................................................................................................................................................. 42

DETAILED REPORT ................................................................................................................................................... 42 Request attributes ............................................................................................................................................... 42 Request ............................................................................................................................................................... 42 Response attributes ............................................................................................................................................. 42 Response ............................................................................................................................................................. 43

SERVICE USAGE COSTS ....................................................................................................................................... 43

USAGE COST SUMMARY ........................................................................................................................................... 43 Request ............................................................................................................................................................... 44 Response ............................................................................................................................................................. 44

USAGE COST DETAILS............................................................................................................................................... 45 Request ............................................................................................................................................................... 45 Response ............................................................................................................................................................. 45

REFERENCES ........................................................................................................................................................... 46

TRANSACTION TYPES ............................................................................................................................................... 46 PARTY TYPES ........................................................................................................................................................... 46 PARTY ROLE TYPES .................................................................................................................................................. 46 ISO CURRENCY TYPES ............................................................................................................................................. 47 SELLER ADDRESS TYPES ........................................................................................................................................... 47 BUYER ADDRESS TYPES ............................................................................................................................................ 47 SITUS LOCATIONS .................................................................................................................................................... 47 ADDRESS TYPE ATTRIBUTES ..................................................................................................................................... 48 STATE OR PROVINCE TWO LETTER CODES ................................................................................................................ 49 ISO COUNTRY NAME CODES ..................................................................................................................................... 50 NEXUS CODES .......................................................................................................................................................... 51 PRODUCT CLASS CODES............................................................................................................................................ 52 TAX RESULT TYPE CODES ......................................................................................................................................... 52

EXAMPLE REQUEST/RESPONSE DATA REFERENCES ............................................................................... 53

COMPUTETAX-EXAMPLE2-RESPONSE.JSON .............................................................................................................. 53 COMPUTETAX-EXAMPLE3-RESPONSE.JSON .............................................................................................................. 56 COMPUTETAX-EXAMPLE4-RESPONSE.JSON .............................................................................................................. 66 COMPUTETAX-EXAMPLE6-RESPONSE.JSON .............................................................................................................. 67 INVOICETAX-EXAMPLE1-RESPONSE.JSON ................................................................................................................ 69 INVOICETAX-EXAMPLE2-RESPONSE.JSON ................................................................................................................ 71 INVOICETAX-EXAMPLE3-REQUEST.JSON ................................................................................................................. 73 INVOICETAX-EXAMPLE3-RESPONSE.JSON ................................................................................................................ 74 GETINVOICE-EXAMPLE1-REPONSE.JSON .................................................................................................................. 76 GETINVOICE-EXAMPLE2-MULTIPLE-INVOICES.JSON ................................................................................................. 78 ADJUSTMENT-EXAMPLE1-RESPONSE.JSON ............................................................................................................... 82 ADJUSTMENT-EXAMPLE2-RESPONSE.JSON ............................................................................................................... 87 ADJUSTMENT-EXAMPLE3-RESPONSE.JSON ............................................................................................................... 90 ADJUSTMENT-EXAMPLE4-RESPONSE.JSON ............................................................................................................... 92

Page 4: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Mobile App Install and start using "SalesTaxPAL" mobile app on iOS and Android in minutes.

Web App Visit https://www.salestaxpal.com for further details.

API List Below APIs are for seller use. All of these APIs has the below common base URI prefix. Replace HOST with actual host name. Also replace PORT if it is a non-standard port number. Base URI

https://api.salestaxpal.com/stp/api/rest/v1

API Names Post fix the below API names to the Base URI above to create the full URI.

API METHOD Purpose /appsecret/get POST Get application secret used for generating token.

/appsecret/change POST Change the current application secret.

/access/token POST Get an access token to make API calls.

/tax/compute POST Calculate sales and use taxes.

/tax/invoice POST Post calculated sales and use taxes as an invoice.

/tax/invoice/query POST Query for a single invoice.

/tax/invoice/query/list POST Query for multiple invoices as a list (with LIMIT).

/tax/invoice/query/list/summary POST Query a summary of invoices (with LIMIT)

/tax/invoice/adjustment/refund POST Refund from an invoice.

/tax/invoice/adjustment/charge POST Charge to an invoice.

/taxes/summary POST Summary view of sales and use taxes from invoices.

/taxes/details POST Summary view of sales and use taxes by invoice ID.

/cost/summary POST Summary cost of using the system (if applicable)

/cost/details POST System usage cost in details by date (if applicable)

Tenant, Party and Users

Page 5: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Tenant - is a business entity. For example Corporation 1 or your small business XYZ Corp. are examples of Tenants. Party - a department or division under a business entity (i.e. Tenant). For example Corporation 1 has a online selling division for their store item to be sold online. On selling over internet they will ship the item(s) to the buyer address. There could be multiple divisions doing the same online selling within same tenant. User - an individual who work in a department or division (i.e. Party). As an example, each online selling division of Corporation 1 may have multiple user accounts where each online user specialized in selling particular kind of item(s). Tenant can have multiple parties and each party can have multiple users who actually sell goods and services online. Each user account is responsible for selling and collecting online sales taxes.

Existing User Existing user can move on to the "Ready to make API calls" section to start using the API.

New User New user to the system should register first to create a an account using SalesTaxPAL mobile app or using website https://www.salestaxpal.com.

Register New user should register to the system to create an "user" account using an email and cell phone number. This is a very simple process. Here is a brief about the steps involved in registering and creating a FREE account.

• Download and Install SalesTaxPAL App - on your Android or iPhone/iPad. Search app name on "App Store" for Apple phones/iPad or "Google Play" for Android phones. It is FREE to install the mobile app.

• Get registration access codes - Open the App and click on "Get Registration Access Codes". It will ask for an email and cell phone number. Click OK after entering them. System will send an "emailAccessCode" and a "mobileAccessCode" to the email address and a mobile phone number.

• Register - Click on "Register" menu. Fill up the screens and press "Register" button at the last screen. This will send an email confirming the registration.

• Activate your account - On successful registration you will see an email with a link to activate your account. Open your email and click on the link to activate.

Page 6: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

• Ready to use your account - After activating your account you are ready to use mobile apps, web UI and REST API calls. Follow the below sections for making API calls to the system.

Install Mobile App Installing mobile app, register and create your account, you will be ready to use the SalesTaxPAL sales and use tax system from the mobile App UI, Web UI or make REST API calls to integrate with your applications. Application developers can download and try the API samples in minutes.

Download REST API samples Once registered to the system a free account is created. Make sure to activate your newly created account clicking on a link sent in your email. Once activated, you are ready to make API calls directly from your applications or test the APIs from Google POSTMAN rest client.

• Download the REST API examples

• Open google POSTMAN - REST API testing UI. Import the downloaded file.

• Changes needed in sample APIs - First make a "get application secret" (see in postman sample) call at the top in the sample list changing the account email ID and password. If you already know your application secret then no need to make this call. This will return the default application secret for your account for this API. Next, make a "get token" (refer postman sample) call using the "accessKeyId" and "accessKeyValue" from the response received in "get application secret" call above. "get token" call will return a "token" with a typical expiry time of one hour. Make sure that your application refresh the token before the current token is expired. Keep the STP_CLIENT_ID as it is.

• Try each API replacing the current token with the token you got!

About downloaded API samples Downloaded API list covers the below functions.

• Sales tax calculation - calculate online sales and use tax with the provided API. Calculation call optionally lets you save the calculation as an invoice (i.e. order) to the system.

• Invoice posting - save your online order as an invoice to our system for any future reference and adjustments on the order.

• Get Invoice - retrieve all the invoices within a date range or a particular invoice identified with the invoice ID.

Page 7: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

• Refund or charge to existing invoices (i.e. orders) - in case your order requires all or part of it to be refunded to the buyer, you can easily do so calling adjustment APIs. The adjustment APIs can let you "charge" additional amounts on any of the items in the order and/or let you "refund" amounts on all or part of the order. History of "refund" or "charge", is also maintained in the system and can be seen in case of buyer/seller disputes or other purpose.

• Sales and use taxes - generate a summary report or a detailed report on collected sales and use taxes.

• Subscription costs - generate a report on subscription fees and costs of using the various APIs.

Study the next sections to understand more about each of the API.

Headers For all API calls set the below header.

Content-Type: application/json

STP_CLIENT_ID: STP-API-CLIENT

Authorization: <Authentication Scheme> <token>

EXAMPLE:

Authorization: Bearer e6cc003d08473f69aa108ea4ac6b910d:400a5f9dbdf73c8c8e8492e68893cc36

Application secret

Once registered to the system, a default application secret key and value pair is created and ready to use for token generation for the API calls. For each user there is a unique application secret in each environment (e.g. SANDBOX, PRODUCTION). Secret from one environment can not be used in another environment.

API=/appsecret/get

Method=POST

Request:

{

"loginType": {

"loginAccess": {

"userName": "[email protected]",

"password": "mypassword123"

}

}

}

Page 8: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Response:

{

"tokenAccess": {

"accessKeyId": "D0CBA7C4-8B30-372A-9D81-8853FB5446C7",

"accessKeyValue": "8E97B5E8-D197-305A-B1C6-8AA5A9E10999"

},

"hasError": false

}

Change Application Secret

This is optional to start with. For security reason your application secret can be changed at any time if there is a need. Each time the application secret is changed, all existing tokens expire automatically. Therefore, after a change is secret, generate the token using the new secret.

API=/appsecret/change

Method=POST

Request:

{

"loginType": {

"loginAccess": {

"userName": "[email protected]",

"password": "mypassword123"

}

}

}

Response:

{

"tokenAccess": {

"accessKeyId": "A new secret key",

"accessKeyValue": "A new secret value"

},

"hasError": false

}

API Access Token Generation

Page 9: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

All API call must use a non-expiry token as part of the Authentication header. Below API

call returns a new token. It has a validity period with a start and end time in milliseconds. Client program therefore, can call this API again to create another token may be a minute before the current token is expiring. IMPORTANT: A client program can request next token around ((validityEndTimeMillis - valitityStartTimeMillis) - 60000) millisecond later from the time the current token is received in client side. This will ensure the client program to have a non-expiry token with the API server.

API=/access/token

Method=POST

REQUEST:

{

"loginType": {

"tokenAccess": {

"accessKeyId": "D0CBA7C4-8B30-372A-9D81-8853FB5446C7",

"accessKeyValue": "8E97B5E8-D197-305A-B1C6-8AA5A9E10999"

}

},

"transactionDate": 20180406

}

RESPONSE:

{

"tokenAccess": {

"token": "2c5e254621d2367fa3a5c347e35a7ff6:1067cce4b4ac397f8567131e15c68754",

"tokenType": "Bearer",

"validityStartTimeMillis": 1523841394310,

"validityEndTimeMillis": 1523844994310

},

"hasError": false

}

API Call Using Access Token

Each API request must have the AUTHORIZATION header with the received tokenType and

token. Below is an example.

Authorization Header:

Content-Type: application/json

Authorization: Bearer 2c5e254621d2367fa3a5c347e35a7ff6:1067cce4b4ac397f8567131e15c68754

Page 10: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Compute Tax Make call to this API to calculate sales and use taxes on products and services sold online. Most products are of TPP (Tangible Personal Property) category. The "productClass" attribute is used for setting product or service code for proper tax calculation. If "productClass" value does not match with any of the product class codes available in the system, it will be treated as "TPP" (Tangible Personal Property) category product and sales taxes will be calculated accordingly. Some features:

• Compute tax request can contain one or more line items. There must be at least one line item.

• Each line item ID must be unique within the request.

• Line items can be in a hierarchy; i.e. the top level line items "lineItems" is a list of line items. Each of the top-level line item can have child line items with same bucket name "lineItems" and the hierarchy may grow to any depth. However, it is not recommended to add large number of line items for delayed response primarily due to network latency. For simplicity it is recommended to add all line items at the top level as a list of lineItems.

• On response side - line item taxes are summarized on the line item level and also to its parents up to the root level. Depending on the sub-totals needed, one can simply look at the root level summaries for overall taxes, totals, sub-totals on entire hierarchy of line items or can deep dive into any hierarchy level to find the desired sub-totals.

• Taxes on individual line items can be found on the leaf level under "taxes" bucket as

list of different taxes applied.

• Each tax element has details such as jurisdiction, imposition, situs location (origin or destination where this tax element is applied), taxable amount, tax rate, total tax amount etc.

Calculate tax call can optionally save the calculated result as an invoice (i.e. order) to the system if you add the boolean flag "saveAsInvoice" to true. There are examples next. If you need to save your calculation in the server as an invoice then follow the examples next or make use of Invoice Tax API calls discussed later.

API=/tax/compute

METHOD=POST

Calculate sales taxes - Simple Example

Compute taxes on a single line item with no shipping an handling charges. This call simply calculates the taxes and returns the response.

Request attributes

Page 11: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

At the top, all request has two buckets, "loginType" and "computeTaxRequest". Below are the details of each bucket.

• transactionDate - The date this transaction has taken place. Sales tax rates can be

different from time to time. It must be present and of the Java date format "yyyyMMdd". Taxes computed based on the tax rules and rates applicable on a given "transactionDate".

• transactionType - Typically it is "SALE" for online commerce. However, it can be

one in the available list of transaction types.

• currency - Required parameter and the "isoCurrencyCode" value can be one from the

list of supported ISO currency types.

• seller - bucket must have a physicalOrigin or administrativeOrigin bucket in the

request. Must be one of the below valid seller address types. o physicalOrigin - The address from where the item is going to be shipped. o administrativeOrigin - The address where seller admin office is located. This

may be same as physicalOrigin.

• buyer - bucket must have a destination or administrativeDestination bucket in the

request. Must be one of the below buyer address types. In addition it will have "customerCode" bucket.

o destination - The actual physical address where the seller shipped the

packets for delivery. o administrativeDestination - The administrative address of the buyer

where the items are delivered. This could be an office address where items are received but consumed elsewhere with a actual physical address.

o customerCode (optional) - A DPP (direct pay permit) buyer will have a

code to apply. This bucket is optional depends on if the buyer is DPP.

• lineItems - details of the actual item sold. This is a list consists of one or more

number of line items. Each line item is described below: o lineItemId - it is a required attribute, a string, and unique within the same

request. Valid Ids are "1", "2", "xyz", "LI-001" etc. o vendorSKU (optional) - Seller provided item identification. Sellers typically

catalogue items on sale and each item has its own unique ID associated. This is that seller item number. This is a String type field with any letters, numbers and special characters are allowed. Duplicate vendorSKU if used across line items in the same request, it is not checked and server will not complain. We recommend requester should check the uniqueness and validity of the vendorSKU provided on each line item.

o product - This bucket is used to name the item and a product class code (productClass) known to the system.

▪ productClass - The name of the taxability category of the item. The actual value of the class code of the product from one known to the system. See available product class codes to use.

▪ classCode - The code against the taxability category name known as productClass. Use only one, "productClass" or the "classCode" preferably "classCode".

▪ value - The short name or description of the product. This could be a descriptive name of the product and may or may not be same as the productClass code.

Page 12: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

o quantity - For number of units ordered. This has a unit and number. ▪ unitOfMeasure - Typically "ea" representing each item. ▪ value - A Double type number such as 1, 2, 1.5, 1.99 etc.

o unitPrice - price of each unit of the item as a Double type value.

REQUEST

{

"computeTaxRequest": {

"transactionDate": 20170702,

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"customerCode": {

"value": "test_buyer"

},

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100.00

}

}]

}

}

Response attributes

At the top level, a flag "hasError" and "computeTaxResponse" buckets represents the response. Details of the buckets next:

Page 13: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

• hasError - This flag is made available in every response. If value is false that means the request was successfully executed in the server and the response is available under "computeTaxResponse".

• computeTaxResponse - This bucket is filled up with calculated sales taxes described below:

o total - sum of all item prices and all taxes items together. o subTotal - sum of all the item prices. o totalTax - sum of all the taxes on all items. o lineItems - In this bucket all line items appear in a hierarchy as they appear in

request. Each compute tax line item has the following: ▪ lineItemId - The unique item Id used in request for this item is returned. ▪ vendorSKU - The vendorSKU code used in request is returned. ▪ productClass - The productClass name used in request is returned. ▪ productName - The "value" attribute in "product" bucket in the request is

returned here as "productName". ▪ subTotalAmount - Sum of price for this line item including all child line

items under it in hierarchy. ▪ subTotalTax - Sum of all taxes on this line item including all child line

items under it in hierarchy. ▪ taxes - list of taxes that was applied on this line item. Each tax element

consists of the following:

• situsLocation - This tells which location is used for applying the tax rules. This is based on the address type used in the "seller" and "buyer" request bucket. See the available situs locations and their display values shown in this bucket.

• jurisdiction - The geographic location for which this particular sales tax is applied.

o value - the name of the geographic location; e.g. state (e.g. CALIFORNIA), county (e.g. ALAMEDA), city (e.g. SAN JOSE), special place name where the tax is applicable.

o level - jurisdiction level; e.g. if value is "CALIFORNIA" that is an "STATE" in the USA. So the level for "CALIFORNIA" is "STATE".

• imposition - The imposition on the jurisdiction that resulted this sales tax.

o value - the name of the imposition, e.g. "Sales and Use Tax", "Local Sales and Use Tax" etc.

• taxResultType - One of the available tax result type code is set here.

• taxableAmount - Amount out of total that is taxable.

• taxRate - Tax rate applied on the taxableAmount.

• taxAmount - calculated tax amount. ▪ lineItems - Child line items if any. It is of same structure described above

and repeats its structure the same way. This bucket appears if request has child line items in any line item. It is shown with same hierarchy as in the request.

Page 14: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

RESPONSE

{

"computeTaxResponse": {

"total": 109,

"subTotal": 100,

"totalTax": 9,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100,

"subTotalTax": 9,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.01,

"taxAmount": 1

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5,

Page 15: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

}

]

},

"hasError": false

}

Example-2: Calculate sales taxes on an item with shipping and handling.

In this example, there are two more line items added at the top level line item list. One of them is shipping item identified by "productClass" value "FOB Destination" and the other new one is the handling charge item with "productClass" value "Handling Charges". Add shipping and/or handling charges to an order when the entire order is considered as one packet to be shipped to the buyer. Of course, there is no such rule that shipping and handling must have to be charged for each order. All that matters is how a seller offers the products to a buyer.

REQUEST

{

"computeTaxRequest": {

"transactionDate": 20170702,

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

Page 16: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC-100",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100.00

}

},

{

"lineItemId": "2",

"vendorSKU": "SHP-222",

"product": {

"value": "Shipping",

"productClass": "FOB Destination"

},

"quantity": {

"value": 1,

"unitOfMeasure": "ea"

},

"unitPrice": {

"value": 25

}

},

{

"lineItemId": "3",

"vendorSKU": "Xyz123",

"product": {

"value": "Handling",

"productClass": "Handling Charges"

},

"quantity": {

"value": 1,

"unitOfMeasure": "ea"

},

"unitPrice": {

"value": 10

}

}]

}

}

RESPONSE

See response in reference section computeTax-example2-response.json

Example-3: Calculate sales taxes with line items in a hierarchy.

Page 17: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

In this example, there is nothing special but it demonstrates that a compute tax request can contain number of line items. Each line item must have a unique string line item ID. In this example, at the top level there are four line items. Last two line items are Shipping and Handling line items. The rest of the line items are simple line items in a hierarchy. In the response, the taxes for each of these line items will also appear in the identical hierarchy.

REQUEST

{

"computeTaxRequest": {

"transactionDate": 20170702,

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "1000001",

"product": {

"productClass": "Clothing",

"value": "Dad's T-Shirt"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 10.00

},

"lineItems": [{

"lineItemId": "2",

"vendorSKU": "1000002",

"product": {

"productClass": "Clothing",

"value": "Mom's Hawaiian T-Shirt"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 12.00

}

},

{

Page 18: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"lineItemId": "3",

"vendorSKU": "1000003",

"product": {

"productClass": "Clothing",

"value": "Mom's Summer T-Shirt"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 2

},

"unitPrice": {

"value": 15.00

},

"lineItems": [{

"lineItemId": "4",

"vendorSKU": "T-1000",

"product": {

"productClass": "Clothing",

"value": "Girl's Pajama"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 14.00

}

}]

}]

},

{

"lineItemId": "5",

"vendorSKU": "S-5001",

"product": {

"productClass": "TPP",

"value": "TPP1"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 20.00

},

"lineItems": [{

"lineItemId": "6",

"vendorSKU": "R-12345",

"product": {

"productClass": "TPP",

"value": "Some TPP item name."

},

"quantity": {

"unitOfMeasure": "ea",

"value": 2

},

"unitPrice": {

"value": 5.00

}

}]

},

{

"lineItemId": "7",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "FOB Destination"

"value": "Shipping Charge.",

},

"quantity": {

"value": 1,

"unitOfMeasure": "ea"

},

Page 19: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"unitPrice": {

"value": 25

}

},

{

"lineItemId": "8",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Handling Charges"

"value": "Handling Charge.",

},

"quantity": {

"value": 1,

"unitOfMeasure": "ea"

},

"unitPrice": {

"value": 10

}

}]

}

}

RESPONSE

See the response here computeTax-example3-response.json.

Example-4: Calculate sales taxes and save as an Invoice (i.e. Order)

Nothing special in this example except that the compute tax API can be used for calculating taxes and at the same time saving the calculation can be saved in the system as an invoice. All it needs is to add "saveAsInvoice" attribute in the request with a true value and optionally an "orderId". The order ID is a buyer (i.e. client) provided identification of the saved invoice. Irrespective of order ID is provided or not, tax engine generates a unique ID called "invoiceId" for each invoice saved to the system. If the "saveAsInvoice" is absent or its value is false, it just calculates the taxes without saving as a invoice in the system. This example is making use of Simple Example at the beginning and introducing:

o saveAsInvoice (optional) - a boolean flag set to true or false. If true, then only the calculation is saved as an invoice.

o orderId (optional) - a seller provided order ID unique from seller perspective. Seller can always rely on invoice ID sent back in the response and may choose not to set the order ID for any invoice. Order ID is an string type field can contain any characters and numbers.

REQUEST

{

"computeTaxRequest": {

"orderId": "1",

Page 20: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"saveAsInvoice": true,

"transactionDate": 20170702,

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC-100",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100.00

}

}]

}

}

RESPONSE

Response for this example is same as in the simple example response discussed at the beginning except that this will create an invoice to the system and return will have the "invoiceId" for further tracking. This saves time and improves performance for high performing transaction system avoiding two calls (one calculation call and then one invoice posting call) to one call.

Example-5: Using item attributes for special processing such as Eco fees, Tire fees etc.

This example, demonstrates how to use item attributes along with proper productClass codes to correctly collect special taxes and fees. Certain productClass, i.e. the "taxability category" has special attributes for applying with the request. With the use of correct productClass code along with the correct itemAttributes (bucket in the request below), tax engine accurately calculate taxes for such category of items.

Page 21: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Special Item Attributes to note in Request

See the green marked bucket; i.e. "itemAttributes" in the request that is the only thing new to this request compared to the simple example request shown at the beginning.

• itemAttributes - a list of item attributes. Each item attribute consists of (1) a attribute name, i.e. "name", (2) a classCode for the "name" of the attribute, and (2) a "value" for such attribute name. Refer to the special item attributes for more details.

o name - is the attribute name code; e.g. if you are computing California tax on "Video Monitors" (i.e. productClass) you should pass ""Screen Size" as the "name" of a attribute in order to collect proper environmental waste recycling fees that depends on the screen size.

o classCode - the code against the attribute "name" above; e.g. "STP-ATR-00140" for attribute name "Screen Size" above. NOTE: use only one of the two properties for each the attributes, (a) name or (b) classCode. Using both properties for the attribute will not cause any harm. "Value" field below must be provided.

o value - value of such attribute. For example if the attribute type is Double Number then the value can be 52, 52.0 etc. If the data type of the attribute is String, then the value is also a string enclosed with two double quote characters; e.g. "A value", "123" etc. For date, enter the value in yyyyMMdd format.

For all other buckets in this request, refer to the simple example request attributes.

REQUEST

{

"computeTaxRequest": {

"transactionDate": 20170702,

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

Page 22: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product."

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100.00

},

"itemAttributes": [{

"name": "Screen Size",

"value": 52

}]

}]

}

}

Special taxes to note in the Response

All taxes in the below response for this example is same as the taxes simple example response except one marked with color. The new tax element is a fee applied to this item category called "Environmental Waste Recycle Handling Fee". Note that the total taxes is 14 instead of 9 calculated previously in simple example response. Without the "itemAttributes" bucket in the request such special fees are not going to be calculated by the tax engine.

RESPONSE

{

"computeTaxResponse": {

"total": 114,

"subTotal": 100,

"totalTax": 14,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "EC1003",

"productClass": "Video Monitors",

"productName": "Display Monitor",

"subTotalAmount": 100,

"subTotalTax": 14,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Environmental Waste Recycle Handling Fee"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

Page 23: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxRate": 0.05,

"taxAmount": 5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.01,

"taxAmount": 1

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

Page 24: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxAmount": 0.5

}

]

}

]

},

"hasError": false

}

Example-6: Compute tax at a single location

This example can be used for finding taxes at a single geographic location. All of the above examples are for e-commerce online selling case where seller ship the sold items from a source address to a buyer destination address involving two addresses. This example is for a shop that has a fixed geographic location where the POS (point of sale) for buyer and seller has the same address. Taxes for a particular item or service does not change due to a different buyer address. Taxes on items and services in a shop at a given location may only change if the jurisdiction, impositions, rates etc. changed over a period of time. The only difference between this request and the simple example request at the beginning is that here there is no "seller" address. The shop address is treated as a "buyer" address (as well as seller physical origin). From the API perspective only the buyer address is filled up as the POS address. Rest of the request is same. Calculated taxes in this case therefore may be different compared to the taxes calculated in the simple example response.

REQUEST

{

"computeTaxRequest": {

"transactionDate": 20170702,

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"buyer": {

"destination": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

Page 25: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"unitPrice": {

"value": 100.00

}

}]

}

}

RESPONSE

See the response here computeTax-example6-response.json.

Invoice Tax There are different ways to post an invoice to the system. One is during compute tax call and another way is to call invoice tax APIs discussed in this section. Just like compute tax calls, invoice tax calls too is capable of calculating taxes if line items are found in the request and already calculated taxes are not present in the response bucket of the request.

API=/tax/invoice

Method=POST

Ways to save invoices

Following are the ways to create and post an invoice to the sales tax engine: (1) From Compute Tax API - Example-4 in the compute tax section explains it. This use case is good for high performance e-commerce system. It brings down two calls (one calculation and another to post the calculated taxes to the system later) to a single call. In e-commerce applications, this API call can be made when buyer checkout is completing with the confirmation of buyer payment. However, if there are reasons for which the final tax calculation call should not be saved as invoice, then the below two options are used to post the invoice later. (2) Using Invoice Tax API call with both line items and taxes are filled up - Invoice call has a "invoiceTaxRequest" bucket that can be filled up with line items the same way it is done for the Compute Tax requests. Request also has a "invoiceTaxResponse" bucket that can be filled up with previously calculated taxes. In other words, this use case, it fills up both the "invoiceTaxResponse" and the "invoiceTaxRequest" buckets. During invoice tax call, "invoiceTaxResponse" bucket is used as the correct source of taxes for the invoice. If both "invoiceTaxRequest" and "invoiceTaxResponse" bucket is filled up in the request, system does not re-calculate taxes again, instead, it use taxes found in the "invoiceTaxResponse" bucket. This is a post checkout invoice posting call where the application already know the line items used before in tax calculation and the taxes it has collected when purchase happened. All that it is now

Page 26: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

doing is to post an invoice to the system using the completed transaction line items and it's calculated taxes. (3) Use Invoice Tax API call with only line items are filled up - This is not a recommended method of posting an invoice to the system. In this case, invoice tax call calculates taxes for line items found under the "invoiceTaxRequest" bucket (the same way line items are entered in compute tax calls). This is because there is no "invoiceTaxResponse" bucket. When it is required to let the invoice tax call must re-calculate taxes again, do not set the "invoiceTaxResponse" bucket in the request. This may not be the right thing to do because the taxes was already calculated in the application during checkout, saved in application side, and then trying to post an invoice to the tax engine calculating it again. It may land up with different taxes than the one saved in client application side due to wrong usage of transaction date or the tax rules may have undergone minor changes or corrections for the same transaction date. NOTE: For tax refund or charge adjustment purpose, always make sure to set the "invoiceTaxRequest" bucket filled up with proper line items - the line items against which the taxes are populated in "invoiceTaxResponse" bucket. Tax adjustments such as "refund" and/or "charge" on the already booked orders (i.e. invoices) is done using refund adjustment API calls which looks into the request line items in order to perform the adjustments.

Invoice Tax with both line items and taxes are filled up

This is the most prominent use case for posting an invoice to the system.

Request attributes

Only new elements in structure will be explained here. For other elements refer to the compute tax section.

• invoiceTaxEnvelope - the entire envelope. o orderId (optional) - enter an order ID if needed. A client application can pass on

its own order ID. o transactionDate - refer here. o postingDate (optional) - Date the invoice is posted to the system. It could be a

different date than transactionDate when the taxes was calculated. o invoiceTaxRequest - the request bucket for the invoice containing the entire set

of line item as appears and discussed in the case of Compute Tax section. o invoiceTaxResponse - the response bucket filled up with the taxes already

calculated for the "invoiceTaxRequest" line items above. ▪ total - total price and taxes of all line items in hierarchy. ▪ subTotal - total prices of all line items in the hierarchy. ▪ totalTax - total taxes on all line items in the hierarchy. ▪ lineItems - the list of line items in this top level hierarchy as it appears in

the "invoiceTaxRequest"->"lineItems" list. The same line items are here in

Page 27: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

this response bucket with their tax details. Only few attributes of each line item is included in the response.

• lineItemId - refer compute tax response attributes.

• vendorSku - refer compute tax response attributes.

• productClass - refer here for the same.

• productName - refer here for the same.

• subTotalAmount - The sub total amount on all line items under it including this line item.

• subTotalTax - The sub total taxes on all line items under here including this line item.

• taxes - This structure is same as the response structure defined in the compute tax response parameter section.

REQUEST

{

"invoiceTaxEnvelope": {

"orderId": "2",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"value": 1,

"unitOfMeasure": "ea"

},

"unitPrice": {

"value": 100

}

}]

},

Page 28: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"invoiceTaxResponse": {

"total": 109.0,

"subTotal": 100.0,

"totalTax": 9.0,

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100.0,

"subTotalTax": 9.0,

"taxes": [{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.01,

"taxAmount": 1.0

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY

(ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

Page 29: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

}]

}]

}

}

}

Response attributes

Response is almost same as the request structure explained above except that response as additional attributes mentioned next.

• invoiceId - A unique invoice ID is definitely added in the response. This invoice ID is used later for querying a particular invoice.

RESPONSE

See the invoiceTax-example1-response.json response data here.

Invoice Tax (with only line items are filled up)

Notice that the response has the calculated taxes as part of the invoice even though the request has only the "invoiceTaxRequest" bucket but there is no "invoiceTaxResponse" bucket. In this case taxes are calculated on line items in the "invoiceTaxRequest" (exactly of same structure used in case of "computeTax" APIs). Calculated taxes are populated in the "invoiceTaxResponse" bucket. The entire response is saved to the system as invoice and also returned as response.

REQUEST

{

"invoiceTaxEnvelope": {

"orderId": "1",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

Page 30: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100.00

}

}]

}

}

}

RESPONSE

See the response here in invoiceTax-example2-response.json.

Get Invoice In the previous sections, i.e. Compute Tax example 4 and Invoice Tax, invoices are created in the system. In those examples, or any other examples the invoice tax response returned by the tax engine has the "invoiceId" field. Since the system already saved the invoice, using the "invoiceId" one can retrieve the entire invoice including its adjustment history. Here is an example of the Get Invoice API.

Get Single Invoice

In this example, the API is returning a single invoice matching the "invoiceId".

Page 31: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

API=/tax/invoice/query

METHOD=POST

Request

{

"invoiceId": 173092868728001

}

Response

See the getInvoice-Example1-response.json here.

Get Single Invoice with adjustment history

In this example, using the flag "isReturnHistory", it returns the entire invoice with all adjustments made on the invoice. Query is also asking the tax engine to query the invoice with the "orderId". In the query, both "invoiceId" and "orderId" can be present or either one of them can be present. Typically, if "invoiceId" is present "orderId" is redundant and not required. On the other hand, if only "orderId" is present the query may result more than one invoices. Since orderId is provided by the seller (e.g. client app), and if seller provided order Id was duplicated across invoices, query with only orderId may lead to multiple invoices. Since "invoiceId" is generated in the tax engine side it is guaranteed to be unique, and a query with only invoiceId will find at the most one invoice.

Request

{

"invoiceId": 173092868728001,

"orderId": "1",

"isReturnHistory": true

}

Response

See the details of the "invoiceHistory" and "adjustmentHistory" bucket parameters in adjustment-Example1-response.json.

Page 32: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Get multiple invoices

Adding two date attributes as range in the query will result in retrieving all matching queries as list. The "isReturnHistory" attribute if present in request with value of true, the invoices will include adjustment history as well. For better performance on network latency it is recommended to set "isReturnHistory" to false or not to use this attribute.

API=/tax/invoice/query/list

METHOD=POST

Request

queryStartDate - is the start date in Java "yyyyMMdd" format. queryEndDate - is the query end date in Java "yyyyMMdd" format.

{

"queryStartDate": 20170801,

"queryEndDate": 20170830,

"isReturnHistory": false

}

Response

See the response in getInvoice-example2-multiple-invoices.json.

Get Invoice Summary

Query to the system for a summary of all invoices found within a date interval supported by other parameters such as an "orderId", "invoiceId", etc. Client application may need to know all available invoices to selectively perform further operations such as viewing, report generation, refund or charge.

API=/tax/invoice/query/list/summary

METHOD=POST

Example-1: Query with all parameters

This example will fetch at the most one invoice summary if all of the attributes value match with an existing invoice entity.

Page 33: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Request attributes

• orderId - the order ID passed on to the invoice creation APIs, if any.

• invoiceId - Unique invoice ID number.

• queryStartDate - Query starting date with the "yyyyMMdd" format.

• queryEndDate - Query end date with the "yyyyMMdd" format.

Request

{

"orderId": "1",

"invoiceId": 2351574165737588,

"queryStartDate": 20170101,

"queryEndDate": 20171231

}

Response

Response has one invoice summary as part of the "list" bucket which holds list of invoice summary object.

Response attributes

• count - number of records in the invoice summary "list".

• list - A list of invoice entity summary. Each invoice summary has the following attributes:

o transactionDate - Actual transaction found in the invoice of "yyyyMMdd" format.

o formattedTransactionDate - Is used for display purpose and of "yyyy/MM/dd" format.

o invoiceId - Invoice ID of the invoice. o orderId - order ID if exists in the order. o gross - is the gross prices and taxes together. o subtotal - is the total price total. o taxtotal - is the total of all taxes.

• hasError - false, if API execution was successful, true otherwise.

{

"count": 1,

"list": [

{

"transactionDate": 20170702,

Page 34: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"formattedTransactionDate": "2017/07/02",

"invoiceId": 2351574165737588,

"orderId": "1",

"gross": 87.2,

"subtotal": 80,

"taxtotal": 7.2

}

],

"hasError": false

}

Example-2: Query using only the date range

Omitting the invoiceId and orderId makes the query to find potentially more than one invoices. This example query is using only the start and end dates.

Request

{

"queryStartDate": 20170101,

"queryEndDate": 20171231

}

Response

{

"count": 27,

"list": [

{

"transactionDate": 20170702,

"formattedTransactionDate": "2017/07/02",

"invoiceId": 713183820776551,

"orderId": "1",

"gross": 109,

"subtotal": 100,

"taxtotal": 9

},

....

{

"transactionDate": 20170702,

"formattedTransactionDate": "2017/07/04",

"invoiceId": 713186973378527,

"orderId": "1",

"gross": 218,

"subtotal": 200,

"taxtotal": 18

}

],

"hasError": false

}

Page 35: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Tax Adjustment An existing order can be subjected to a full or partial refund or there can be additional charges after the order is completed. It is also common to charge extra to the order for additional quantities, shipping, handling etc. even after the buying is completed. This process is known as "adjustment". An adjustment on price and quantity therefore results in additional or reduced taxes.

• To perform adjustment of already completed orders, seller has to ensure that the sale was stored in the system as an invoice.

• The API in this section makes it possible to call for adjustments. Adjustment call causes re-calculation of taxes using the actual transaction date, updating the invoice with new price, quantity, subtotals and total, and then saving of the new state of the invoice.

• An adjustment history is also maintained within the invoice. Adjustment history can be used for auditing and dispute resolution purposes.

Types of adjustments

There are two types of adjustments when calling adjustment API. Use refund adjustment for refunding taxes on the saved order due to return of some or all of the items in the order. If additional item, unit price, etc. needs to be charged on the original order then use the charge adjustment. Each type is explained next with examples.

• Refund - Taxes may reduce due to full or partial refund on the order.

• Charge - Taxes may increase due to additional amount, quantity etc. on items are increased.

There could be multiple adjustment requests made against an existing order. Each adjustment request state is saved as part of "adjustmentHistory" bucket whereas the state of the invoice just before the adjustment is saved in the "invoiceHistory" bucket under the same invoice.

Refund Adjustment

A "refund" type adjustment is explained here. The original invoice has only one line item.

API=/tax/invoice/adjustment/refund

METHOD=POST

Request attributes

Page 36: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

• isReturnHistory (optional) - boolean true to let server also return all adjustments made so far on this invoice. If false or this attribute is absent in the request, it does not return history. It is recommended to set it to false to achieve better performance due to less data transfer over net. Default is false.

• invoiceId - The ID of the invoice. Each invoice has a unique invoice ID that need to be present in the request.

• adjustables - a list of adjustment requests. Each has its own line item ID, unit price to adjust and the affected quantity. o lineItemId - ID of the line item on which this adjustment will be performed. o quantity - quantity on that line item. See special conditions applied on multi-quantity

line item refund. o unitPrice - the price amount to refund or charge on top of existing price. For

example, if the last saved line item with ID 1 had a price of 100, and it is decided to reduce the price by 10 (refund 10), then enter 10 here. On completion of adjustment, the overall invoice request bucket will show a new price of 90 (original price 100 minus refund 10). The new adjusted taxes in the response bucket will be based on the new unit price of 90. If the adjustmentType is "charge" then the new unit price will be 110, new taxes are expected to increase and will be based on new unit price of 110.

• Refer the original invoice created in the invoice tax example. About this example - In this example unit price of 10 is reduced from the current unit price of the line item identified by the line item ID of "1" because the "adjustmentType" is "refund". The "quantity" field is the number of line items. Since each adjustment done on an invoice is recorded in the system, request can use "isReturnHistory" attribute set to true to get the adjustment history as well as part of the response.

REQUEST

{

"invoiceId": 173092868728001,

"isReturnHistory": true,

"adjustmentType": "refund",

"adjustables": [{

"lineItemId": "1",

"quantity": 1,

"unitPrice": 10

}]

}

RESPONSE

Refer the full JSON response in adjustment-Example1-response.json. New response parameters are described in the response example.

Page 37: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Charge Adjustment

Parameters for "charge" adjustment is same as in "refund" adjustment except the URI is different. Charge is used when unit price, quantity, shipping and/or handling etc. are subjected to increase. This causes potentially the taxes to increase as well. Request body looks the same as refund adjustment.

API=/tax/invoice/adjustment/charge

METHOD=POST

REQUEST

{

"invoiceId": 1119986864504404,

"adjustmentType": "charge",

"isReturnHistory": false,

"adjustables": [{

"lineItemId": "1",

"quantity": 1,

"unitPrice": 10

}]

}

RESPONSE

Refer the JSON response here adjustment-Example2-response.json.

Adjustment on multiple line items at a time

Adjustments can be made on one or more line items at a time on an invoice. Everything remains the same except that more than one adjustment can be added under "adjustables" shown below. In this example, request is doing a "refund" on three line items on the same invoice. Original invoice has one line item with two quantities along with shipping and handling fee line items. Refund is made reducing line item unit price by 5. Other two line items too has some refund.

API=/tax/invoice/adjustment/refund

METHOD=POST

Page 38: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

REQUEST

{

"invoiceId": 2351574165737588,

"adjustmentType": "refund",

"adjustables": [{

"lineItemId": "1",

"quantity": 2,

"unitPrice": 5

},{

"lineItemId": "3",

"quantity": 1,

"unitPrice": 7

},{

"lineItemId": "2",

"quantity": 1,

"unitPrice": 10

}]

}

Adjustment restrictions

All request adjustment items must contain a:

• valid line item ID for each adjustment,

• non zero unit price, and

• a valid quantity.

Single quantity line item ID

Full or partial adjustments for "refund" and "charge" can be made to any line item in the invoice without restrictions.

Multi-quantity line item ID

Adjustment (refund or charge) is not allowed if request quantity does not match with the actual line item quantities for line item. In other words, unit price can be adjusted only on all of the quantities for the same line item. As an example, for line item ID 1, if the quantity is 2 and in the adjustment request "quantity" is 1, then it is not allowed. This is because unit price adjustment can not be applied to one of the multiple quantities on that line item. To make things simple, first do a full "refund" on the particular line item returning all quantities and full price. After full refund, do a "charge" adjustment on the same line item with any quantity and unit price. InvoiceTax example-3 request (and the invoice tax example-3 response) has more than one quantity under line item ID 1. Seller wants to ship an additional quantity with a reduced unit price. This requires seller to change the overall quantity to be 3 for line item ID 1 and the new

Page 39: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

average unit price of each item to be 90. There are many ways to do the adjustment to achieve this goal. Following is a demonstration about how this goal can be achieved. Also it will help understanding the errors may be thrown from the API.

Partial refund

Allowed case - Refund unit price by 10 (from current unit price of 100) on all quantities. It makes unit price for both quantity to 90 as the new unit price. Allowed because the unit price adjustment is on both quantities. Similarly full "refund" or any unit price adjustment is allowed as long as it is applied on all quantities on the line item.

API=/tax/invoice/adjustment/refund

METHOD=POST

Request

{

"invoiceId": 694217312001729,

"adjustmentType": "refund",

"adjustables": [{

"lineItemId": "1",

"quantity": 2,

"unitPrice": 10

}]

}

Not allowed case - Try doing a further refund by a unit price of 10 from the last adjusted invoice that become 90 but on only 1 quantity out of 2. This is not allowed and API throws an error message with "hasError" is set to true. Similarly, "charge" is not allowed if quantity value does not match with the actual quantity in the invoice. Request

{

"invoiceId": 694217312001729,

"adjustmentType": "charge",

"adjustables": [{

"lineItemId": "1",

"quantity": 1,

"unitPrice": 10

}]

}

Response (In case of "refund" below error is displayed. Similar error message will be returned for "charge" case as well.)

Page 40: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

{

"error": {

"errorMessage": "refund: Partial adjustment is not allowed for items with multiple

quantity. Refund all quantity in the line item and then do a charge.",

"errorStack": "refund: Partial adjustment ..."

},

"hasError": true

}

Full refund

In this case line item above is fully refunded. Taxes in the response therefore become zero after full refund call. Very first call above would have done the job of full refund instead of refunding only 10. Since the very first refund call resulted the new unit price of 90, this full refund request therefore returning both quantities and unit price of 90. At the end of this call the taxes potentially will also be zero. Request

{

"invoiceId": 694217312001729,

"adjustmentType": "refund",

"adjustables": [{

"lineItemId": "1",

"quantity": 2,

"unitPrice": 90

}]

}

Response See the response adjustment-Example3-response.json.

Charge again

After the full refund above, seller can charge on the item again with a new quantity and unit price. In this case seller decided to use quantity 3 and unit price 90 for the line item ID 1. After this charge adjustment the quantity, unit price, and taxes are all going to change. Make sure to use the same order date under "transactionDate". Taxes could be different on a different "transactionDate". Request

{

Page 41: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"transactionDate": 20170701,

"invoiceId": 694217312001729,

"adjustmentType": "charge",

"adjustables": [{

"lineItemId": "1",

"quantity": 3,

"unitPrice": 90

}]

}

Response See the adjustment-Example4-response.json here.

Sales Tax Report Two APIs to provide sales tax report. One that provides a total summary on all invoices with a date range, and the other that provides details of taxes on each invoice found in the date range.

Summary Report

API=/taxes/summary

METHOD=POST

Request attributes

• queryStartDate - query start date is of Java date format "yyyyMMdd".

• queryEndDate - query end date of Java date format "yyyyMMdd".

Request

{

"queryStartDate": 20170101,

"queryEndDate": 20171231

}

Response attributes

Page 42: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Response is a list of three objects, i.e. the gross sales, sub total, and taxes total with each has name and value attributes.

Response

{

"count": 3,

"list": [

{

"name": "Gross sales: ",

"value": 1810.32

},

{

"name": "Sub total: ",

"value": 1648

},

{

"name": "Total sales tax: ",

"value": 162.32

}

],

"hasError": false

}

Detailed Report

It returns each invoice summary object as a list under "list" bucket in the response.

API=/taxes/details

METHOD=POST

Request attributes

Same as in tax summary API request except the URI is different.

Request

{

"queryStartDate": 20170101,

"queryEndDate": 20171231

}

Response attributes

The "list" in the response is a list of invoice summary object.

Page 43: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

• list - list of invoice summary object. Each invoice summary object consists of: o transactionDate - actual transaction date for the invoice of format "yyyyMMdd". o formattedTransactionDate - same as transactionDate above except it is

formatted as "yyyy/MM/dd" for display purpose. o invoiceId - invoice ID of each invoice. o orderId - (optional) the seller provided order ID during invoice creation, if any. o total - the total amount includes total price and total sales taxes together. o subtotal - the total item price for the entire invoice. o taxtotal - total taxes for the entire invoice.

• hasError - true if there was an error at server, false otherwise.

Response

{

"list": [

{

"transactionDate": 20170702,

"formattedTransactionDate": "2017/07/02",

"invoiceId": 713183820776551,

"orderId": "1",

"total": 109,

"subtotal": 100,

"taxtotal": 9

},

....

{

"transactionDate": 20170702,

"formattedTransactionDate": "2017/07/02",

"invoiceId": 713186973378527,

"orderId": "1",

"total": 218,

"subtotal": 200,

"taxtotal": 18

}

],

"hasError": false

}

Service Usage Costs These APIs used by those subscribed to the cloud service. It returns the basic subscription fees and costs may be associated for such subscription. Sales tax engine can be configured to work on subscription basis. If the subscription feature is turned on and user is charged based on usage of functionalities such as "compute tax", "invoice tax", "adjustment" etc. then the costs of such usage can be found using these APIs.

Usage cost summary

Page 44: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

A summary is provided with plan (name, base fee, subscription type) and API usage charges.

API=/cost/summary

METHOD=POST

Request

Request attributes

• queryStartDate - start date is of Java date format "yyyyMMdd".

• queryEndDate - end date is of Java date format "yyyyMMdd".

{

"queryStartDate": 20170701,

"queryEndDate": 20170831

}

Response

Response is a list of objects.

• list - of 4 objects, i.e. plan, base fee for the plan, fee type, and API usage charges (if any). Objects are:

o Subscription Plan - name/value pair describing the plan name user has subscribed. o Base fee - name/value pair with base fee cost. o Subscription type - Duration of subscription, e.g. "Yearly", "Quarterly",

"Monthly", "Free", "Unlimited" etc. o API usage charges - key value pair, tells how much is the total cost of using the

APIs for the input date range.

• hasError - true if there was an error, false otherwise.

{

"count": 4,

"list": [

{

"name": "Subscription: ",

"value": "Month-To-Month Base Subscription Plan"

},

{

"name": "Base fee: ",

"value": FREE

},

{

"name": "Subscription type: ",

"value": "Monthly"

},

{

"name": "API usage charges: ",

"value": 0

}

Page 45: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

],

"hasError": false

}

Usage cost details

API usage cost summary by date of service. This API call provides cost details breaking the entire costs in to API used, usage count, unit price and total by date. Only dates appear in the response are those dates for which there is at least one usage is found.

API=/cost/details

METHOD=POST

Request

{

"queryStartDate": 20170701,

"queryEndDate": 20170830

}

Response

Response attributes:

o unitCost - object representing unit cost for each functionality of the service. o compute - cost per call on compute tax. o invoice - cost per call on invoice tax. o adjustment - cost per call on each adjustment call. o other - cost for each usage of other functionally, if applicable.

o count - number of service usage records found in the "list". o list - list of service usage object.

o serviceDateNumber - Date usage happened, of format "yyyyMMdd". o serviceDate - Usage date string formatted as "yyyy/MM/dd". o calculations - number of compute tax calls made. o invoices - number of invoice tax calls made o others - number of other API usage calls made, if applicable. o calculationCost - total cost of compute tax calculation calls on that date. o invoiceCost - total cost of invoice tax calls on that date. o refundCost - total cost of adjustment API calls on that date. o otherCost - total cost of other API usage costs on that date, if applicable.

o hasError - whether or not any error occurred during this API call.

{

"unitCost": {

"compute": 0.0,

Page 46: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"invoice": 0.0,

"adjustment": 0.0,

"other": 0.0

},

"count": 19,

"list": [{

"serviceDateNumber": 20170813,

"serviceDate": "2017/08/13",

"calculations": 8,

"invoices": 9,

"refunds": 5,

"others": 0,

"calculationCost": 0.0,

"invoiceCost": 0.0,

"refundCost": 0.0,

"otherCost": 0,

"totalCost": 0.0

},

....

{

"serviceDateNumber": 20170723,

"serviceDate": "2017/07/23",

"calculations": 2,

"invoices": 0,

"refunds": 0,

"others": 0,

"calculationCost": 0.0,

"invoiceCost": 0.0,

"refundCost": 0.0,

"otherCost": 0.0,

"totalCost": 0.0

}],

"hasError": false

}

References

Transaction types

Sale, Lease, Rental, ProductMovement, InventoryRemoval

Party types

TaxPayer, Buyer, Vendor

Party role types

Buyer, Seller, Owner, Dispatcher, Recipient

Page 47: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

ISO Currency types

Currency Code Country Description

USD United States USA Dollars

CAD Canada Canada Dollars

Seller address types

Following are the seller address type codes and their display values. Use the first part as

codes in the request. Second part - the display value is shown in the "situsLocation" field in the response.

Location Code Display Name Description

physicalOrigin Physical Origin Physical location from

where the items are packaged for shipping.

administrativeOrigin Administrative Origin Admin address of seller

but may not be the source address from where items

are packaged for shipping.

Buyer address types

Following are the available buyer address type codes used in request bucker for making request. Display value on right is shown in the "situsLocation" field in the response.

Location Code Display Name Description

destination Destination Buyer actual address

where the items are consumed or service is

performed.

administrativeDestination Administrative Destination May be an admin office where the items are

received. However, it may be consumed else where

at a different physical

address.

Situs Locations

Following are the situs location codes and their display names.

Page 48: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Display Name Location Code Description

Physical Origin physicalOrigin Seller real item shipping address location type.

Administrative Origin administrativeOrigin Seller administrative address location type.

Destination destination Buyer real item receiving address location type.

Administrative Destination

administrativeDestination Buyer administrative address location type.

Address type attributes

Any of the seller address types or buyer address types has the following common set of attributes. It is recommended to include all address attributes for most accurate sales tax calculation.

• street - House number and street name; e.g. "2065 Kelvin Avenue".

• city - name of the City; e.g. "Santa Clara".

• stateOrProvince - Two letter state name or province code; e.g. For California in USA can be typed as "CA". Code for BRITISH COLUMBIA in Canada is "BC". See the list of state or province two letter codes in USA and CANADA.

• districtOrCounty - Name of the district or county. In USA it is county where as most other countries such as in Canada it is known as district. Example of USA county in California is "Santa Clara", "Alameda" etc.

• postalCode - Enter exact postal code.

• country - name of the three letter ISO country code. For USA enter "USA" and for Canada enter "CAN". See the list of valid ISO country name codes.

An example JSON request contains the below buyer and seller addresses. Seller ...

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

...

Buyer

...

"buyer": {

"destination": {

Page 49: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

...

State or province two letter codes

Here is the list of two letter state or province codes. Currently USA and CANADA is supported.

Two Letter Code State/Province Name Code Country Code

AL ALABAMA USA

AK ALASKA USA

AZ ARIZONA USA

AR ARKANSAS USA

AA ARMED FORCES AMERICA USA

AE ARMED FORCES EUROPE USA

AP ARMED FORCES PACIFIC USA

CA CALIFORNIA USA

CO COLORADO USA

CT CONNECTICUT USA

DE DELAWARE USA

DC DISTRICT OF COLUMBIA USA

FL FLORIDA USA

GA GEORGIA USA

HI HAWAII USA

ID IDAHO USA

IL ILLINOIS USA

IN INDIANA USA

IA IOWA USA

KS KANSAS USA

KY KENTUCKY USA

LA LOUISIANA USA

ME MAINE USA

MD MARYLAND USA

MA MASSACHUSETTS USA

MI MICHIGAN USA

MN MINNESOTA USA

MS MISSISSIPPI USA

MO MISSOURI USA

MT MONTANA USA

NE NEBRASKA USA

Page 50: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

NV NEVADA USA

NH NEW HAMPSHIRE USA

NJ NEW JERSEY USA

NM NEW MEXICO USA

NY NEW YORK USA

NC NORTH CAROLINA USA

ND NORTH DAKOTA USA

OH OHIO USA

OK OKLAHOMA USA

OR OREGON USA

PA PENNSYLVANIA USA

RI RHODE ISLAND USA

SC SOUTH CAROLINA USA

SD SOUTH DAKOTA USA

TN TENNESSEE USA

TX TEXAS USA

UT UTAH USA

VT VERMONT USA

VA VIRGINIA USA

WA WASHINGTON USA

WV WEST VIRGINIA USA

WI WISCONSIN USA

WY WYOMING USA

AB ALBERTA CAN

BC BRITISH COLUMBIA CAN

MB MANITOBA CAN

NB NEW BRUNSWICK CAN

NL NEWFOUNDLAND AND LABRADOR CAN

NT NORTHWEST TERRITORIES CAN

NS NOVA SCOTIA CAN

NU NUNAVUT CAN

ON ONTARIO CAN

PE PRINCE EDWARD ISLAND CAN

QC QUEBEC CAN

SK SASKATCHEWAN CAN

YT YUKON CAN

ISO country name codes

Code Country Description

USA United States Three letter country code for United States of America.

CAD Canada Three letter country code for Canada.

Page 51: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Nexus Codes

Below are the valid nexus codes. This may change from time to time while more countries and states are supported. Currently USA and CANADA is supported.

Nexus Name Nexus Country

ALABAMA UNITED STATES

ALASKA UNITED STATES

ARIZONA UNITED STATES

ARKANSAS UNITED STATES

CALIFORNIA UNITED STATES

COLORADO UNITED STATES

CONNECTICUT UNITED STATES

DELAWARE UNITED STATES

FLORIDA UNITED STATES

GEORGIA UNITED STATES

HAWAII UNITED STATES

IDAHO UNITED STATES

ILLINOIS UNITED STATES

INDIANA UNITED STATES

IOWA UNITED STATES

KANSAS UNITED STATES

KENTUCKY UNITED STATES

LOUISIANA UNITED STATES

MAINE UNITED STATES

MARYLAND UNITED STATES

MASSACHUSETTS UNITED STATES

MICHIGAN UNITED STATES

MINNESOTA UNITED STATES

MISSISSIPPI UNITED STATES

MISSOURI UNITED STATES

MONTANA UNITED STATES

NEBRASKA UNITED STATES

NEVADA UNITED STATES

NEW HAMPSHIRE UNITED STATES

NEW JERSEY UNITED STATES

NEW MEXICO UNITED STATES

NEW YORK UNITED STATES

NORTH CAROLINA UNITED STATES

NORTH DAKOTA UNITED STATES

OHIO UNITED STATES

OKLAHOMA UNITED STATES

OREGON UNITED STATES

Page 52: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

PENNSYLVANIA UNITED STATES

RHODE ISLAND UNITED STATES

SOUTH CAROLINA UNITED STATES

SOUTH DAKOTA UNITED STATES

TENNESSEE UNITED STATES

TEXAS UNITED STATES

UTAH UNITED STATES

VERMONT UNITED STATES

VIRGINIA UNITED STATES

WASHINGTON UNITED STATES

WEST VIRGINIA UNITED STATES

WISCONSIN UNITED STATES

WYOMING UNITED STATES

PUERTO RICO UNITED STATES

AMERICAN SAMOA UNITED STATES

GUAM UNITED STATES

NORTHERN MARIANA ISLANDS UNITED STATES

ALBERTA CANADA

BRITISH COLUMBIA CANADA

MANITOBA CANADA

NEW BRUNSWICK CANADA

NEWFOUNDLAND AND LABRADOR CANADA

NOVA SCOTIA CANADA

ONTARIO CANADA

PRINCE EDWARD ISLAND CANADA

QUEBEC CANADA

SASKATCHEWAN CANADA

NORTHWEST TERRITORIES CANADA

NUNAVUT CANADA

YUKON TERRITORY CANADA

Product class codes

Use the below URL to see the list of class codes.

https://www.salestaxpal.com/classCodes.jsp

Tax result type codes Following are the valid tax result type (used in taxResultType bucket) values:

taxReultType code Description

No tax No tax is applied for some reason.

Taxable Taxable and tax is applied.

Page 53: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

Nontaxable The item is not taxable.

Exempt The item is exempt from collecting tax.

DPP Applied This code is set if buyer is DPP. A direct pay permit (DPP) authorizes its holder to purchase any tangible personal property,

digital property, or certain services without payment of sales and

use tax to vendors. A business with a direct pay permit assumes responsibility for payment of all applicable taxes directly to the

Department.

Example request/response data references

computeTax-example2-response.json

{

"computeTaxResponse": {

"total": 147.15,

"subTotal": 135,

"totalTax": 12.15,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC-100",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100,

"subTotalTax": 9,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.01,

"taxAmount": 1,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

Page 54: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

},

{

"lineItemId": "2",

"vendorSKU": "SHP-222",

"productClass": "FOB Destination",

"productName": "Shipping",

"subTotalAmount": 25,

"subTotalTax": 2.25,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.065,

"taxAmount": 1.625,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 25,

Page 55: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxRate": 0.01,

"taxAmount": 0.25,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.005,

"taxAmount": 0.125,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.005,

"taxAmount": 0.125,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.005,

"taxAmount": 0.125,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

},

{

"lineItemId": "3",

"vendorSKU": "Xyz123",

"productClass": "Handling Charges",

"productName": "Handling",

"subTotalAmount": 10,

"subTotalTax": 0.9,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.065,

"taxAmount": 0.65,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

Page 56: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.01,

"taxAmount": 0.1,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

}

]

},

"hasError": false

}

computeTax-example3-response.json

Page 57: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

{

"computeTaxResponse": {

"total": 142.79,

"subTotal": 131,

"totalTax": 11.79,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "1000001",

"productClass": "Clothing",

"productName": "Dad's T-Shirt",

"subTotalAmount": 10,

"subTotalTax": 0.9,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.065,

"taxAmount": 0.65,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.01,

"taxAmount": 0.1,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

Page 58: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

],

"lineItems": [

{

"lineItemId": "2",

"vendorSKU": "1000002",

"productClass": "Clothing",

"productName": "Mom's Hawaiian T-Shirt",

"subTotalAmount": 12,

"subTotalTax": 1.08,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 12,

"taxRate": 0.065,

"taxAmount": 0.78,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 12,

"taxRate": 0.01,

"taxAmount": 0.12,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 12,

"taxRate": 0.005,

"taxAmount": 0.06,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

Page 59: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 12,

"taxRate": 0.005,

"taxAmount": 0.06,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 12,

"taxRate": 0.005,

"taxAmount": 0.06,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

},

{

"lineItemId": "3",

"vendorSKU": "1000003",

"productClass": "Clothing",

"productName": "Mom's Summer T-Shirt",

"subTotalAmount": 30,

"subTotalTax": 2.7,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 30,

"taxRate": 0.065,

"taxAmount": 1.95,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 30,

"taxRate": 0.01,

"taxAmount": 0.3,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 30,

"taxRate": 0.005,

Page 60: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxAmount": 0.15,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 30,

"taxRate": 0.005,

"taxAmount": 0.15,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 30,

"taxRate": 0.005,

"taxAmount": 0.15,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

],

"lineItems": [

{

"lineItemId": "4",

"vendorSKU": "T-1000",

"productClass": "Clothing",

"productName": "Girl's Pajama",

"subTotalAmount": 14,

"subTotalTax": 1.26,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 14,

"taxRate": 0.065,

"taxAmount": 0.91,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 14,

"taxRate": 0.01,

"taxAmount": 0.14,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

Page 61: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY

(ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 14,

"taxRate": 0.005,

"taxAmount": 0.07,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 14,

"taxRate": 0.005,

"taxAmount": 0.07,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 14,

"taxRate": 0.005,

"taxAmount": 0.07,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

}

]

}

]

},

{

"lineItemId": "5",

"vendorSKU": "S-5001",

"productClass": "TPP",

"productName": "TPP1",

"subTotalAmount": 20,

"subTotalTax": 1.8,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 20,

"taxRate": 0.065,

"taxAmount": 1.3,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

Page 62: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 20,

"taxRate": 0.01,

"taxAmount": 0.2,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 20,

"taxRate": 0.005,

"taxAmount": 0.1,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 20,

"taxRate": 0.005,

"taxAmount": 0.1,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 20,

"taxRate": 0.005,

"taxAmount": 0.1,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

],

"lineItems": [

{

"lineItemId": "6",

"vendorSKU": "R-12345",

"productClass": "TPP",

"productName": "Some TPP item name",

"subTotalAmount": 10,

"subTotalTax": 0.9,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

Page 63: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"value": "Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.065,

"taxAmount": 0.65,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.01,

"taxAmount": 0.1,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

}

]

},

{

"lineItemId": "7",

"vendorSKU": "ABC100L1",

Page 64: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"productClass": "FOB Destination",

"productName": "Shipping",

"subTotalAmount": 25,

"subTotalTax": 2.25,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.065,

"taxAmount": 1.625,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.01,

"taxAmount": 0.25,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.005,

"taxAmount": 0.125,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.005,

"taxAmount": 0.125,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 25,

"taxRate": 0.005,

Page 65: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxAmount": 0.125,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

},

{

"lineItemId": "8",

"vendorSKU": "ABC100L1",

"productClass": "Handling Charges",

"productName": "Handling",

"subTotalAmount": 10,

"subTotalTax": 0.9,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.065,

"taxAmount": 0.65,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.01,

"taxAmount": 0.1,

"situsLocation": "Physical Origin",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

Page 66: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 10,

"taxRate": 0.005,

"taxAmount": 0.05,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

}

]

},

"hasError": false

}

computeTax-example4-response.json

{

"computeTaxResponse": {

"total": 109,

"subTotal": 100,

"totalTax": 9,

"invoiceId": 512521743735935,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC-100",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100,

"subTotalTax": 9,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.01,

Page 67: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxAmount": 1

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

}

]

}

]

},

"hasError": false

}

computeTax-example6-response.json

{

"computeTaxResponse": {

"total": 109,

"subTotal": 100,

"totalTax": 9,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

Page 68: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"subTotalAmount": 100,

"subTotalTax": 9,

"taxes": [

{

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.01,

"taxAmount": 1,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSIT DISTRICT (SCCT)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSPORTATION AUTHORITY (SCVT)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSACTIONS AND USE TAX (CMPL)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.0025,

"taxAmount": 0.25,

"situsLocation": "Destination",

Page 69: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "TRANSACTIONS AND USE TAX (SVTB)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.0013,

"taxAmount": 0.125,

"situsLocation": "Destination",

"taxResultType": "Taxable"

},

{

"jurisdiction": {

"value": "RETAIL TRANSACTIONS AND USE TAX (SCCR)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxableAmount": 100,

"taxRate": 0.0013,

"taxAmount": 0.125,

"situsLocation": "Destination",

"taxResultType": "Taxable"

}

]

}

]

},

"hasError": false

}

invoiceTax-example1-response.json

{

"invoiceTax": {

"invoiceId": 173092868728001,

"orderId": "2",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

Page 70: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"value": 1,

"unitOfMeasure": "ea"

},

"unitPrice": {

"value": 100

}

}]

},

"invoiceTaxResponse": {

"total": 109.0,

"subTotal": 100.0,

"totalTax": 9.0,

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100.0,

"subTotalTax": 9.0,

"taxes": [{

"situsLocation": "Physical Origin",

"jurisdiction": {

"level": "STATE"

},

"imposition": {

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"level": "COUNTY"

},

"imposition": {

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.01,

"taxAmount": 1.0

},

{

"situsLocation": "Destination",

"jurisdiction": {

"level": "DISTRICT"

},

"imposition": {

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

Page 71: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"situsLocation": "Destination",

"jurisdiction": {

"level": "DISTRICT"

},

"imposition": {

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"level": "DISTRICT"

},

"imposition": {

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

}]

}]

},

"hasError": false

}

invoiceTax-example2-response.json

{

"invoiceTax": {

"invoiceId": 169789955259918,

"orderId": "1",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

Page 72: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"value": 1,

"unitOfMeasure": "ea"

},

"unitPrice": {

"value": 100

}

}]

},

"invoiceTaxResponse": {

"total": 109.0,

"subTotal": 100.0,

"totalTax": 9.0,

"lineItems": [{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100.0,

"subTotalTax": 9.0,

"taxes": [{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.01,

"taxAmount": 1.0

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY

(ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

Page 73: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100.0,

"taxRate": 0.005,

"taxAmount": 0.5

}]

}]

}

},

"hasError": false

}

invoiceTax-Example3-request.json

{

"invoiceTaxEnvelope": {

"orderId": "1",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [{

"lineItemId": "1",

Page 74: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 2

},

"unitPrice": {

"value": 100.00

}

}]

}

}

}

invoiceTax-Example3-response.json

{

"invoiceTax": {

"invoiceId": 694217312001729,

"orderId": "1",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"taxAreaId": 50859999,

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"taxAreaId": 50011290,

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 2

},

"unitPrice": {

"value": 100

Page 75: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

}

}

]

},

"invoiceTaxResponse": {

"total": 218,

"subTotal": 200,

"totalTax": 18,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 200,

"subTotalTax": 18,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 200,

"taxRate": 0.065,

"taxAmount": 13

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 200,

"taxRate": 0.01,

"taxAmount": 2

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 200,

"taxRate": 0.005,

"taxAmount": 1

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 200,

"taxRate": 0.005,

Page 76: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxAmount": 1

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 200,

"taxRate": 0.005,

"taxAmount": 1

}

]

}

]

}

},

"hasError": false

}

getInvoice-Example1-reponse.json

{

"invoiceTax": {

"invoiceId": 173092868728001,

"orderId": "1",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"taxAreaId": 50859999,

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"taxAreaId": 50011290,

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

Page 77: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100

}

}

]

},

"invoiceTaxResponse": {

"total": 109,

"subTotal": 100,

"totalTax": 9,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100,

"subTotalTax": 9,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.01,

"taxAmount": 1

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

Page 78: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

}

]

}

]

}

},

"hasError": false

}

getInvoice-example2-multiple-invoices.json

"count" - is the number invoices in the response under "list".

{

"count": 27,

"list": [

{

"invoiceId": 781564752345255,

"orderId": "2",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

Page 79: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100

}

}

]

},

"invoiceTaxResponse": {

"total": 109,

"subTotal": 100,

"totalTax": 9,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100,

"subTotalTax": 9,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.01,

"taxAmount": 1

},

{

"situsLocation": "Destination",

"jurisdiction": {

Page 80: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

}

]

}

]

}

},

....

{

"invoiceId": 413019162666175,

"orderId": "test123",

"transactionDate": 20170702,

"invoiceTaxRequest": {

"orderId": "test123",

"transactionType": "SALE",

"saveAsInvoice": true,

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"taxAreaId": 50859999,

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"taxAreaId": 50011290,

"city": "Fremont",

"stateOrProvince": "CA",

Page 81: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC-100",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100

}

}

]

},

"invoiceTaxResponse": {

"total": 109,

"subTotal": 100,

"totalTax": 9,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC-100",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100,

"subTotalTax": 9,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.01,

"taxAmount": 1

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

Page 82: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

}

]

}

]

}

}

],

"hasError": false

}

adjustment-Example1-response.json

Response parameters - only new parameters are explained here. In the adjustment request if the "isReturnHistory" is true the following buckets are returned in the response. If history part in the response is not required, it is recommended to use "isReturnHistory" to set false (or do not use this attribute in the request) in order to improve performance avoiding extra data transfer over net.

• adjustmentHistory - a list of all adjustments made so far. It is a list with the "key" and "value" pairs like a map. The "key" provides the order of the adjustment request with the one based "index". The "key" structure also contains a time stamp field with the format "yyyy/MM/dd-HH:mm:ss:SSS" to understand exactly when the particular adjustment was

Page 83: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

made. The adjustment request part is living in the same structure under "value" bucket. Iterate the keys to find the corresponding requests.

o key - is used to find the original adjustment request and the order of each adjustments using the following parameters.

▪ index - the 1 based order of adjustment calls made. ▪ timestamp - The exact time up to the millisecond level when the

adjustment was made recorded at the tax engine local standard time. Date format used is "yyyy/MM/dd-HH:mm:ss:SSS".

o value - Under "adjustmentHistory" bucket, the "value" field is the original adjustment request made to the system.

• invoiceHistory - Like the "adjustmentHistory" bucket, this bucket has the same "key" to retrieve the state of invoice before the adjustment was performed. The keys found under "adjustmentHistory" bucket are the same set of keys found under "invoiceHistory" bucket. The key should be used to get the invoice state, i.e. the "value" bucket. In other words, the "value" buckets under "adjustmentHistory" holds the state of the requests whereas the "value" buckets under "invoiceHistory" holds the state of the invoice, identified by the same common "key".

o key - the same set of keys found under "adjustmentHistory". o value - entire invoice state saved just before the adjustment was made.

The post adjustment state of the example invoice is shown below with tax calculation requests under "invoiceTaxRequest" and calculated taxes under "invoiceTaxResponse". Adjustment history is under "invoiceTaxResponse" bucket.

{

"invoiceTax": {

"invoiceId": 173092868728001,

"orderId": "2",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

Page 84: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 90

}

}

]

},

"invoiceTaxResponse": {

"total": 98.1,

"subTotal": 90,

"totalTax": 8.1,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 90,

"subTotalTax": 8.1,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 90,

"taxRate": 0.065,

"taxAmount": 5.85

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 90,

"taxRate": 0.01,

"taxAmount": 0.9

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 90,

"taxRate": 0.005,

"taxAmount": 0.45

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

Page 85: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 90,

"taxRate": 0.005,

"taxAmount": 0.45

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 90,

"taxRate": 0.005,

"taxAmount": 0.45

}

]

}

]

},

"adjustmentHistory": [

{

"key": {

"index": 1,

"timestamp": "2017/08/10-22:05:03:409"

},

"value": {

"adjustmentType": "refund",

"invoiceId": 173092868728001,

"isReturnHistory": true,

"adjustables": [

{

"lineItemId": "1",

"quantity": 1,

"unitPrice": 10

}

],

"transactionDate": 20170701

}

}

],

"invoiceHistory": [

{

"key": {

"index": 1,

"timestamp": "2017/08/10-22:05:03:409"

},

"value": {

"invoiceId": 173092868728001,

"orderId": "2",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

Page 86: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"country": "USA"

}

},

"buyer": {

"destination": {

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 100

}

}

]

},

"invoiceTaxResponse": {

"total": 109,

"subTotal": 100,

"totalTax": 9,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 100,

"subTotalTax": 9,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.065,

"taxAmount": 6.5

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.01,

"taxAmount": 1

},

Page 87: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY

(ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 100,

"taxRate": 0.005,

"taxAmount": 0.5

}

]

}

]

}

}

}

]

},

"hasError": false

}

adjustment-Example2-response.json

There are no new response parameters here. The adjustment history is not included in the response because "isReturnHistory" parameter in the request is set to false.

{

Page 88: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"invoiceTax": {

"invoiceId": 1119986864504404,

"orderId": "3",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"taxAreaId": 50859999,

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"taxAreaId": 50011290,

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 1

},

"unitPrice": {

"value": 110

}

}

]

},

"invoiceTaxResponse": {

"total": 119.9,

"subTotal": 110,

"totalTax": 9.9,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 110,

"subTotalTax": 9.9,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

Page 89: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxableAmount": 110,

"taxRate": 0.065,

"taxAmount": 7.15

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 110,

"taxRate": 0.01,

"taxAmount": 1.1

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 110,

"taxRate": 0.005,

"taxAmount": 0.55

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 110,

"taxRate": 0.005,

"taxAmount": 0.55

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 110,

"taxRate": 0.005,

"taxAmount": 0.55

}

]

}

]

}

},

"hasError": false

}

Page 90: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

adjustment-Example3-response.json

{

"invoiceTax": {

"invoiceId": 694217312001729,

"orderId": "1",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"taxAreaId": 50859999,

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"taxAreaId": 50011290,

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 0

},

"unitPrice": {

"value": 0

}

}

]

},

"invoiceTaxResponse": {

"total": 0,

"subTotal": 0,

"totalTax": 0,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

"subTotalAmount": 0,

"subTotalTax": 0,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

Page 91: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 0,

"taxRate": 0.065,

"taxAmount": 0

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 0,

"taxRate": 0.01,

"taxAmount": 0

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 0,

"taxRate": 0.005,

"taxAmount": 0

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 0,

"taxRate": 0.005,

"taxAmount": 0

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 0,

"taxRate": 0.005,

"taxAmount": 0

}

]

}

]

}

},

Page 92: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"hasError": false

}

adjustment-Example4-response.json

{

"invoiceTax": {

"invoiceId": 694217312001729,

"orderId": "1",

"transactionDate": 20170702,

"postingDate": 20170705,

"invoiceTaxRequest": {

"transactionType": "SALE",

"currency": {

"isoCurrencyCode": "USD"

},

"seller": {

"physicalOrigin": {

"taxAreaId": 50859999,

"city": "San Jose",

"stateOrProvince": "CA",

"districtOrCounty": "Santa Clara",

"postalCode": "95125",

"country": "USA"

}

},

"buyer": {

"destination": {

"taxAreaId": 50011290,

"city": "Fremont",

"stateOrProvince": "CA",

"districtOrCounty": "Alameda",

"postalCode": "94536",

"country": "USA"

}

},

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"product": {

"productClass": "Video Monitors",

"value": "Some name about the product"

},

"quantity": {

"unitOfMeasure": "ea",

"value": 3

},

"unitPrice": {

"value": 90

}

}

]

},

"invoiceTaxResponse": {

"total": 294.3,

"subTotal": 270,

"totalTax": 24.3,

"lineItems": [

{

"lineItemId": "1",

"vendorSKU": "ABC100L1",

"productClass": "Video Monitors",

"productName": "Some name about the product",

Page 93: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"subTotalAmount": 270,

"subTotalTax": 24.3,

"taxes": [

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "CALIFORNIA",

"level": "STATE"

},

"imposition": {

"value": "Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 270,

"taxRate": 0.065,

"taxAmount": 17.55

},

{

"situsLocation": "Physical Origin",

"jurisdiction": {

"value": "SANTA CLARA",

"level": "COUNTY"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 270,

"taxRate": 0.01,

"taxAmount": 2.7

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "TRANSPORTATION IMPROVEMENT AUTHORITY (ACTI)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 270,

"taxRate": 0.005,

"taxAmount": 1.35

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "BAY AREA RAPID TRANSIT DISTRICT (BART)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 270,

"taxRate": 0.005,

"taxAmount": 1.35

},

{

"situsLocation": "Destination",

"jurisdiction": {

"value": "ESSENTIAL HEALTH CARE SERVICES (ACHC)",

"level": "DISTRICT"

},

"imposition": {

"value": "Local Sales and Use Tax"

},

"taxResultType": "Taxable",

"taxableAmount": 270,

"taxRate": 0.005,

Page 94: SalesTaxPAL - REST API · directly from your applications or test the APIs from Google POSTMAN rest client. • Download the REST API examples • Open google POSTMAN - REST API testing

SalesTaxPAL, Inc.

© SalesTaxPAL 2018

"taxAmount": 1.35

}

]

}

]

}

},

"hasError": false

}