DEV Community

Brian,Kun Liu
Brian,Kun Liu

Posted on • Originally published at Medium on

Mastering Dual-Currency Tax Rules in Chargebee: A Comprehensive Guide

Chargee is a platform for our toB system to manage transactions with merchants (users of our toB platform). The transactions between the merchant and us are the credit charge and subscription billing cycles. The article is based on the credit charging revamp, but it can also be applied to other similar functions when using it. In the previous design, we didn’t include tax when we were setting the price for the product. Our first thought is to rely on the Chargebee setting. However, the Chargebee cannot support a kind of international currency, like the USD, with inclusive tax settings in many countries. Our charging system for merchants needs to support local currency and USD in Thailand and the Philippines.

Apart from this, our special point is that the financial team and product team don’t want to change our current setting. so that our credit charging feature does not interfere with other features like billing subscription cycling.

The goal:

Take the tax amount via the tax rate set by the country:

Malaysia: 6%; Thailand: 7%; the Philippines: 12%; other countries: 0%.

Tax rule in ChargeBee:

The tax rate is defined in ChargeBee by country, like the Philippines. https://storehub-test.chargebee.com/taxes

In practice, the type of price (Tax Exclusive or Tax Inclusive) doesn’t determine whether the tax is included.

Of course, we can use a pre-calculation, but the reception won’t show the tax amount in the Chargebee. It’s currently being applied in Thailand.

The type of tax is determined by the currency tax setting:

https://storehub-test.chargebee.com/taxes/currency_price_type

And Tax Exclusive means that Chargebee will take tax automatically in the Chargebee. We just need to provide the amount with

In conclusion, the country decides the tax rate, but the type of currency price determines the tax-taking action.

We planned not to take tax on USD currency during the design and implementation processes. Following this rule, tax-inclusive seems like a good choice. In reality, the tax-inclusive option can only support one country at a time while using a non-referenced tax rate in another. For example, the Philippines is considered a tax-inclusive country without tax in USD. However, the tax amount in USD will be taken by Chargebee automatically in Thailand. So tax-exclusive is the only option to keep the same in different countries.

Design flow:

Reference:

Chargebee API document: https://apidocs.chargebee.com/docs/api/v1?prod_cat_ver=1

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)