trouble getting the tax value from the checkout data

d-kusama
New Member
1 0 0

Let me ask you a question.
I'm having trouble getting the tax value from the checkout data in the JavaScript Buy SDK.

Shops using the SDK will be Japanese shops.
The consumption tax rate in Japan is 10%.

--JavaScript Buy SDK
https://shopify.github.io/js-buy-sdk/
I'm using the JavaScript Buy SDK to create a cart screen,
I am in trouble because I cannot pay the tax amount when displaying the cart contents information.

As a procedure,
Add items to your cart with Adding Line Items
https://shopify.github.io/js-buy-sdk/#adding-line-items
We check the data contents with Fetching a Checkout.
https://shopify.github.io/js-buy-sdk/#adding-line-items

When I check the contents of the Checkout data in console.log, the tax amount is not included.
`` ```
first part omitted ...
taxExempt: false
taxesIncluded: (...)
totalPrice: "6000"
totalPriceV2: GraphModel
totalTax: "0"
totalTaxV2: GraphModel
・ ・ Omitted
webUrl: "https://kanimusha.myshopify.com/xxx/checkouts/xxx
・ ・ Last part omitted
`` ```
The value is totalTax: “0”.

So how do you get a sales tax of ¥ 600, which is 10% of ¥ 6,000 instead of 0?
* When you access the shopify payment screen from webUrl, the tax (estimate) is ¥ 600.

0 Likes