dw.order
Class TaxMgr
Object
dw.order.TaxMgr
Provides methods to access the tax table.
Constants
TAX_POLICY_GROSS  :  Number = 0
Constant representing the gross taxation policy.
TAX_POLICY_NET  :  Number = 1
Constant representing the net taxation policy.
Properties
customRateTaxClassID  :  String  (Read Only)
The ID of the tax class that represents items with a custom tax rate. The standard order calculation process assumes that such line items are initialized with a tax rate and a being ignored during the tax rate lookup sequence of the calculation process.

Note that this tax class does not appear in the Business Manager tax module.

defaultTaxClassID  :  String  (Read Only)
The ID of the default tax class defined for the site. This class might be used in case a product or service does not define a tax class.
If no default tax class is defined, the method returns null.
defaultTaxJurisdictionID  :  String  (Read Only)
The ID of the default tax jurisdiction defined for the site. This jurisdiction might be used in case no jurisdiction is defined for a specific address.
If no default tax jurisdiction is defined, this method returns null.
taxationPolicy  :  Number  (Read Only)
The taxation policy (net/gross) configured for the current site.
taxExemptTaxClassID  :  String  (Read Only)
The ID of the tax class that represents tax exempt items. The tax manager will return a tax rate of 0.0 for this tax class.

Note that this tax class does not appear in the Business Manager tax module.

Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
static applyExternalTax(basket : Basket) : void
Applies externally set tax rates to the given Basket.
static getCustomRateTaxClassID() : String
Returns the ID of the tax class that represents items with a custom tax rate.
static getDefaultTaxClassID() : String
Returns the ID of the default tax class defined for the site.
static getDefaultTaxJurisdictionID() : String
Returns the ID of the default tax jurisdiction defined for the site.
static getTaxationPolicy() : Number
Returns the taxation policy (net/gross) configured for the current site.
static getTaxExemptTaxClassID() : String
Returns the ID of the tax class that represents tax exempt items.
static getTaxJurisdictionID(location : ShippingLocation) : String
Returns the ID of the tax jurisdiction for the specified address.
static getTaxRate(taxClassID : String, taxJurisdictionID : String) : Number
Returns the tax rate defined for the specified combination of tax class and tax jurisdiction.
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.

Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβ€”passing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβ€”this is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?

This isn't just another prep courseβ€”it's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.

The Salesforce B2C Commerce Architect certification is a whole different gameβ€”complex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Method Detail
applyExternalTax
static applyExternalTax(basket : Basket) : void
Applies externally set tax rates to the given Basket. Only use when LineItemCtnr.isExternallyTaxed() returns true. Note: a basket can only be created in EXTERNAL tax mode using SCAPI.

Typical usage in tax calculation:

    var TaxMgr = require('dw/order/TaxMgr');

        calculateTaxes: function () {
        Basket basket = BasketMgr.getCurrentBasket();
        if ( basket.isExternallyTaxed() )
        {
            TaxMgr.applyExternalTaxation( basket );
        }
        else
        {
            // calculation with tax tables or customization
        }
        }
    

Parameters:
basket - apply external taxation to this basket

getCustomRateTaxClassID
static getCustomRateTaxClassID() : String
Returns the ID of the tax class that represents items with a custom tax rate. The standard order calculation process assumes that such line items are initialized with a tax rate and a being ignored during the tax rate lookup sequence of the calculation process.

Note that this tax class does not appear in the Business Manager tax module.


getDefaultTaxClassID
static getDefaultTaxClassID() : String
Returns the ID of the default tax class defined for the site. This class might be used in case a product or service does not define a tax class.
If no default tax class is defined, the method returns null.
Returns:
the ID of the default tax class defined for the site or null.

getDefaultTaxJurisdictionID
static getDefaultTaxJurisdictionID() : String
Returns the ID of the default tax jurisdiction defined for the site. This jurisdiction might be used in case no jurisdiction is defined for a specific address.
If no default tax jurisdiction is defined, this method returns null.
Returns:
the ID of the default tax jurisdiction defined for the site or null.

getTaxationPolicy
static getTaxationPolicy() : Number
Returns the taxation policy (net/gross) configured for the current site.
Returns:
Taxation policy configured for current site

getTaxExemptTaxClassID
static getTaxExemptTaxClassID() : String
Returns the ID of the tax class that represents tax exempt items. The tax manager will return a tax rate of 0.0 for this tax class.

Note that this tax class does not appear in the Business Manager tax module.


getTaxJurisdictionID
static getTaxJurisdictionID(location : ShippingLocation) : String
Returns the ID of the tax jurisdiction for the specified address. If no tax jurisdiction defined for the site matches the specified address, this method returns null.
Parameters:
location - The shipping location
Returns:
the ID of the tax jurisdiction for the specified address or null.

getTaxRate
static getTaxRate(taxClassID : String, taxJurisdictionID : String) : Number
Returns the tax rate defined for the specified combination of tax class and tax jurisdiction.
Method returns null if no tax rate is defined.
Method returns 0.0 of 'nontaxable' tax rate is specified (see method 'getNontaxableTaxClassID'.
Parameters:
taxClassID - ID of the tax class
taxJurisdictionID - ID of tax jusrisdiction
Returns:
the tax rate defined for the specified combination of tax class and tax jurisdiction.

β™₯
Notifications pending to read