API - Creating Tax Code and Tax Rates in printIQ

API - Creating Tax Code and Tax Rates in printIQ

Overview

The purpose of this document is to assist with retrieving and creating TaxCodes and TaxRates within printIQ.

API Request Table

Below is a list of endpoints used for retrieving, updating, and creating TaxCodes and TaxRates


API Object
Odata Endpoint
Tax Type
All Tax Type
GET /api/v1/odata/TaxTypes
POST /api/v1/odata/TaxTypes

By ID
GET /api/v1/odata/TaxTypes({Id})
PATCH /api/v1/odata/TaxTypes({Id})




Tax Types

The “TaxType” endpoint within the v1 toolset is used to GET or CREATE tax codes and/or rates within printIQ.

Example of V1 OData API Request (GET)

Request to GET a list of all the TaxTypes within printIQ

Request to GET a list of all the TaxTypes with only selecting or displaying the “Name”, “Code” and if the TaxType is Active.

Request to get a list of all the TaxTypes with only selecting or displaying the “Name”, “Code”, “IsRevenue” and if the TaxType is Active.

Request to get a list of all the TaxTypes with only selecting or displaying the “Name”, “Code”, “IsRevenue” and if the TaxType is Active.
This is also expanding the TaxTypeRates which includes the RATE for the TaxType.

Example of V1 OData API Request (GETBYID)

Request to GET the TaxTypes by ID within printIQ if the ID is known.
https://SITEURL/api/v1/odata/TaxTypes(Id) – ID is required. You can get the IDs from the GET endpoint above.

Request to GET by ID with using the same selects and expands as per the GET endpoint above.

Example of V1 OData API Request (POST)

Request to POST a new TaxType within printIQ https://SITEURL.printiq.com/api/v1/odata/TaxTypes 
Example Body:

  1. {  
  2. "Id": 0, - Passing 0 will create a new otherwise leaving blank or passing ID won’t work for POST.
  3.   "Code": "AndrewTest1", - TaxType Code
  4.   "Name": "AndrewTest1", - TaxType Name
  5.   "Description": "AndrewTest1", - TaxType Description 
  6.   "IsRevenue": true, - Is this a Revenue TaxType
  7.   "IsExpense": true, - Is this a Expense TaxType
  8.   "IsAsset": true, - Is this a Asset TaxType
  9.   "IsLiability": true, - Is this a Liability TaxType
  10.   "Order": 0, - Order for the TaxType Admin Screen
  11.   "Default": false, - Set the TaxType as default for printIQ
  12.   "Uncalculated": false, - Set to True to use for TaxJar API Calls
  13.   "EnforceQuoting": true,
  14.   "EnforceInvoicing": true,
  15.   "DisableOperationOverrides": true,
  16.   "Active": true, - Set if the TaxType is Active
  17.   "TaxTypeRates": [
  18.     {
  19.       "Id": 0, - Pass 0 to create TaxType Rate
  20.       "RateTypeId": 1, - Pass in the RateTypeID as per example below
  21.       "Name": "City", - RateTypeName
  22.       "Rate": 0.2, - Set the TaxType Rate Amount
  23.       "Compounding": false - Set the TaxType Rate as compounding
  24.     }, 
  25.     {
  26.       "Id": 0, - Pass 0 to create TaxType Rate
  27.       "RateTypeId": 2, - Pass in the RateTypeID as per example below
  28.       "Name": "Country", - RateTypeName
  29.       "Rate": 0.2, - Set the TaxType Rate Amount
  30.       "Compounding": false - Set the TaxType Rate as compounding
  31.     }
  32.   ]
  33. }

Example of the RateTypeID’s

RateTypeID
RateTypeCode
RateTypeName
1 CIT
CITY
2
COU
COUNTRY
3
DIS
DISTRICT
4
STA
STATE
5
STD
STANDARD

Example of V1 OData API Request (Patch)

Request to PATCH an existing TaxType within printIQ. 
GET previous TaxType Created via the POST and Update the Name

  1. {
  2.   "Code": "AndrewTest1", - TaxType Code
  3.   "Name": "AndrewTest2", - TaxType Name
  4.   "Description": "AndrewTest1", - TaxType Description 
  5.   "IsRevenue": true, - Is this a Revenue TaxType
  6.   "IsExpense": true, - Is this a Expense TaxType
  7.   "IsAsset": true, - Is this a Asset TaxType
  8.   "IsLiability": true, - Is this a Liability TaxType
  9.   "Order": 0, - Order for the TaxType Admin Screen
  10.   "Default": false, - Set the TaxType as default for printIQ
  11.   "Uncalculated": false, - Set to True to use for TaxJar API Calls
  12.   "EnforceQuoting": true,
  13.   "EnforceInvoicing": true,
  14.   "DisableOperationOverrides": true,
  15.   "Active": true, - Set if the TaxType is Active
  16. }
Example of the RateTypeID's

RateTypeID RateTypeCode RateTypeName
1 CIT CITY
2 COU COUNTRY
3 DIS DISTRICT
4 STA STATE
5 STD STANDARD

Reference and Groups


In addition, the GETPRICE API request also supports passing Operation References and Groups.
These can be Identified by expanding the above requests to include the References and Groups.

Request to GET the Finishing/Operation showing only “FinishingShortName”, Operations Type Flags with Expanding the References and Groups available for Operations

Below is an example response of 1 object from ComponentReferenceGroups array,
as you can see the Operation Name is “WF GROM” this is a “Section Operation” with a Group of “Top Only” and Reference “Left Only”

  1. {
  2.       "FinishingShortName": "WF GROM",
  3.       "FinishingJob": false,
  4.       "FinishingSection": true,
  5.       "FinishSide": false,
  6.       "ComponentReferenceGroups": [
  7.         {
  8.           "Id": 3195,
  9.           "FinishingId": 1515,
  10.           "ComponentsReference": "Left Only",
  11.           "ComponentsGroup": "Top Only",
  12.           "NumRows": 1
  13.         },
  14.       ]
  15.     }

The GETPRICE request would look like this using the above example.

  1.         "SectionOperations": [
  2.           {
  3.             "OperationName": " WF GROM",
  4.             "Reference": " Left Only",
  5.             "Group": " Top Only"
  6.           }
  7.         ],


    • Related Articles

    • Product Tax Override on Product Category

      In some jurisdictions, Tax regulations dictate various rates on different product types. For example, in the UK you need to consider the following when determining the taxability of a product. “The standard VAT rate is only paid on some printed ...
    • Tax System - Aggregator Options

      Overview Inter-state sales in North America are subject to a myriad of rules and conditions to determine the tax rate(s) to apply. Taxjar or Avalara offer the ability to calculate and return the rate to IQ to enable completing the invoicing process. ...
    • printIQ Integration toolbox

      Integration Toolbox Getting started with integration and API overview Access printable attachment at the top or bottom of this article depending on your browser. Introduction  When it comes to workflow and integration, everyone’s requirements are ...
    • API – QuoteProcess Creating a Basic Quote

      Basic API calls to create a quote/job Each printiq instance site has access to the Swagger API doco https://{instancedetail}/swagger/ui/index To build a basic quote – in order the calls would be : ...
    • API – Single Sign On

      INTRODUCTION The printIQ Single Sign On (SSO) API can be called to obtain a URL with a token that has been pre-authenticated to log a user in, and begin a customer quote. The API calls are restricted by IP address, which must be configured manually ...