Skip to end of banner
Go to start of banner

Compute Tax

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Inbound | POST | /tax/compute-tax

Summary

This API is used to compute and fetch tax details.

Description

This API will compute and fetch the tax details. Tax details can optionally be stored in MiniOMS against a unique reference no based on the request parameter “store”.

Tax Computation Logic

  1. The user uploads the applicable tax rate rule (e.g. GST_APPAREL, GST_FOOTWEAR, GST_5, GST_8) using the UI for all HSNs

  2. Caller invokes the APIs with line items (with HSN codes and tax rule)

  3. If Tax Rule is given, that is consumed directly

  4. Else, The system finds the applicable tax rate using the following logic

    1. Find the rule for matching 8 digit HSN code.

    2. If not found, then find rule for matching 6 digit HSN  code

  5. From the selling price and state data compute

    1. Base price

    2. Taxes

    3. Tax breakup

Request Params

  • store

Parameter Name

Data Type

Description

Mandatory

store

Boolean

This parameter specifies if the tax details need to be stored or not. This parameter is true if tax details need to be stored.

yes

Request

{

  "fromCountryCode": "IN",

  "fromState": "Karnataka",

  "fromTin": "29AADCP7081J1ZY",

  "fromZip": "560102",

  "referenceNo": "order1234",

  "toState": "Gujarat",

  "toTin": "19AADCP7081J1ZZ",

  "toZip": "394518",

  "lineItems": [

     {

       "actualSellingPricePerUnit": 100.00,

       "hsn": "hsn2431",

       "lineItemId": 1,

       “orderItemCode”:”1”,

       “channelSku”:”channel-sku-1”,

       "quantity": 1,

       "sku": "sku1",

       "taxRule": "GST_APPAREL",

       "attributes": [

         {

           "key": "itemName",

           "value": "Shirt"

         }

       ]

    }

  ],

  "attributes": [

     {

       "key": "orderTime",

       "value": "2021-06-11T15:13:12Z"

     }

   ]

}

Parameter Name

Data Type

Description

Mandatory

fromCountryCode

String

Country Code of Seller

yes

fromState

String

State of Seller

yes

fromTin

String

Seller GSTIN

yes

fromZip

String

Zip/Pin code of Seller

yes

referenceNo

String

Unique Id to identify the order/shipment against which tax is calculated

yes

toState

String

State of Customer

yes

toTin

String

Customer GSTIN

no

toZip

String

Zip/Pin code of Customer

yes

attributes

Object[]

Order level extra attributes to be stored

no

attributes.key

String

Name of attribute

yes

attributes.value

String 

Value of attribute

yes

lineItems

Object[]

Line Items for which tax details needs to be calculated

yes

lineItems.actualSellingPricePerUnit

Double

Selling price of the item per unit

yes

lineItems.hsn

String

HSN code for the product

yes

lineItems.lineItemId

Long

Unique Id to identify the line item

yes

lineItems.quantity

Integer

Quantity of the product

yes

lineItems.sku

String

SKU of the product

yes

lineItems.orderItemCode

String

Order Item Code in your system

no

lineItems.channelSku

String

Channel Sku of item

no

lineItems.taxRule

String

Tax Rule for the product. If passed, this will be used for tax calculation. Otherwise tax rule will be fetched from the HSN-Tax Rule mapping uploaded on UI

no

lineItems.attributes

Object[]

LineItem level extra attributes to be stored

no

lineItems.attributes.key

String

Name of attribute

yes

lineItems.attribute.value

String

Value of attribute

yes

Response

{

    "referenceNo": "order1234",

    "fromCountryCode": "IN",

    "fromTin": "29AADCP7081J1ZY",

    "fromState": "Karnataka",

    "fromZip": "560102",

    "toTin": "19AADCP7081J1ZZ",

    "toState": "Gujarat",

    "toZip": "394518",

    "lineItems": [

        {

            "lineItemId": 1,

            "actualSellingPricePerUnit": 100.0,

            "quantity": 1,

            "hsn": "hsn2431",

            "taxRule": "GST_APPAREL",

            "sku": "sku1",

            “orderItemCode”:”1”,

            “channelSku”:”channel-sku-1”,

            "actualSellingPriceTotal": 100.0,

            "baseSellingPricePerUnit": 95.24,

            "baseSellingPriceTotal": 95.24,

            "netTaxAmountPerUnit": 4.76,

            "netTaxAmountTotal": 4.76,

            "taxRate": 5.0,

            "subTaxItemData": [

                {

                    "type": "IGST",

                    "rate": 5.0,

                    "taxPerUnit": 4.76,

                    "taxTotal": 4.76

                },

                {

                    "type": "SGST",

                    "rate": 0.0,

                    "taxPerUnit": 0.0,

                    "taxTotal": 0.0

                },

                {

                    "type": "CGST",

                    "rate": 0.0,

                    "taxPerUnit": 0.0,

                    "taxTotal": 0.0

                }

            ]

        }

    ]

}

Parameter Name

Data Type

Description

lineItems.baseSellingPricePerUnit

Double

Per unit base selling price of the product

lineItems.baseSellingPriceTotal

Double

Total base selling price of the product

lineItems.netTaxAmountPerUnit

Double

Per unit tax applicable for the product

lineItems.netTaxAmountTotal

Double

Total tax applicable for the product

lineItems.taxRate

Double

Tax Rate applied on the product

lineItems.subTaxItemData

Object[]

Distribution of tax with tax type

lineItems.subTaxItemData.type

Double

Type of tax applicable

lineItems.subTaxItemData.rate

Double

Rate of this type of tax

lineItems.subTaxItemData.taxPerUnit

Double

Per unit tax applicable of this type

lineItems.subTaxItemData.taxTotal

Double

Total tax applicable of this type

Note: The other parameters passed in the response are the same as the parameters in the request body.

Example Response with SGST and CGST tax

{

    "referenceNo": "order12345",

    "fromCountryCode": "IN",

    "fromTin": "29AADCP7081J1ZY",

    "fromState": "Karnataka",

    "fromZip": "560102",

    "toTin": "19AADCP7081J1ZZ",

    "toState": "Karnataka",

    "toZip": "560101",

    "lineItems": [

        {

            "lineItemId": 1,

            "actualSellingPricePerUnit": 100.0,

            "quantity": 1,

            "hsn": "hsn2431",

            "taxRule": "GST_APPAREL",

            "sku": "sku1",

            “orderItemCode”:”1”,

            “channelSku”:”channel-sku-1”,

            "actualSellingPriceTotal": 100.0,

            "baseSellingPricePerUnit": 95.24,

            "baseSellingPriceTotal": 95.24,

            "netTaxAmountPerUnit": 4.76,

            "netTaxAmountTotal": 4.76,

            "taxRate": 5.0,

            "subTaxItemData": [

                {

                    "type": "IGST",

                    "rate": 0.0,

                    "taxPerUnit": 0.0,

                    "taxTotal": 0.0

                },

                {

                    "type": "SGST",

                    "rate": 2.5,

                    "taxPerUnit": 2.38,

                    "taxTotal": 2.38

                },

                {

                    "type": "CGST",

                    "rate": 2.5,

                    "taxPerUnit": 2.38,

                    "taxTotal": 2.38

                }

            ]

        }

    ]

}

  • No labels