Skip to Content
Author's profile photo Ramya K

How to consume SAP Localization Hub – Tax in Yaas (Commerce as a Service)


Development Environment


You need the following development environment to consume SAP Localization Hub – Tax within Commerce as a Service

1. Access to the following:

2. An developer account in or, where you want to deploy the storefront application consuming SAP Localization Hub – Tax.


3. HCP development tools to create HTML application. You install these your local system. For further details on how to create an application, refer to the following link


Setting up the Storefront


You need a storefront for transacting on the products of your company. The sections in this document highlight the unique steps that you need to perform for enabling SAP Localization Hub – Tax in your storefront. For more information on setting up a default storefront refer to the following link





While downloading the GIT, you have the following options:

1. Create the default storefront, for tax calculations in US and CA

2. Create an enhanced storefront, for tax calculations in CN and MX, in addition to US and CA.


Note: To deploy the GIT locally, follow the steps mentioned in the GITHUB links above.


While creating a project and site, subscribe to the following packages:

a. Core Package

b. Commerce as a Service

c. SAP Localization Hub – Tax

Deployment in HCP


Instead of standard deployment in YaaS, you need to deploy the storefront in HCP. To do so, perform the following:

1. Create an HTML application in HCP

2. Import the dist/public folder of the storefront project from the localhost into your application in eclipse IDE

3. Deploy the HTML application in HCP. The application opens the newly created storefront, and the products added to the project are accessible in the storefront.


Enable SAP Localization Hub – Tax for your site

The service, SAP Localization Hub – Tax is enabled at a site level. To enable this tax service for, you must perform the following for each site.

Note: Use the postman rest client or an equivalent to perform these steps


     1. Get an authorization token from the oAuth API.

         Send POST request to URL – with the following passed as “x-www-form-urlencoded” parameters

      • grant_type = client_credentials
      • scope = hybris.tenant=<your project identifier> hybris.site_manage
      • client_id = jcc2RRjLS9ckcRj8jSuWu47HiqEFOf3j
      • client_secret = MaIDJA6z16VSAzDC


           This will return the authorization token.

           Below is the screenshot of how this request and response looks in the postman client.


postman req1.png





     2. Send a POST request to{projectidentifier}/sites/{site code}/tax where “projectidentifier” is your project identifier and “site code” is your site code. You would have provided this information when creating your project and site in the builder. Pass the following Header data:

      • Authorization = Bearer <authorization token got from step a>
      • Content-Type = application/json

Use the below Payload:


“id”: “tax”,

“name”: “SLH Tax Service”,

“serviceType”: “urn:x-yaas:service:tax”,

“serviceUrl”: ““,

“active”: true


Below is the screenshot of how the request and response looks in the postman client.


postman req2.png









                     Note: In the screenshot example, the project id is “slhsweetsshop” and site code is “cn”


      This will enable SAP Localization Hub – tax for the site.                   

Once the above steps are completed, the SAP Localization Hub – Tax will be activated for your site(s). In the storefront, a user can add products to the cart and estimate tax for the products in the shopping cart by providing zip code and country and clicking on Apply. This action invokes the tax service and display the calculated tax.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Link to Hybris's Github is wrong

      Should be

      but now it is

      Author's profile photo Ramya K
      Ramya K
      Blog Post Author

      Thanks for pointing out. I've changed the link.