# Functions

# Overview

The Chargebee.js library includes functions that allow you to carry out activities or fetch information for your customers during the checkout process. For example, functions can be used to:

  • Check the validity of an EU-VAT number before you exempt a customer from taxes.
  • Calculate the amount a customer must pay on checkout after discounts and taxes.
  • Estimate the amount that the customer has to pay on the next renewal.

Described below, are the functions that are currently available in Chargebee JS. Contact us if you wish to see other features supported here.

# Available Functions

# Estimates

"Estimates", as the name implies, can be used to find out the estimate for operating as against operating itself. Say, if you want to create a new subscription or update an existing one, you can deduce the details such as the amount the customer needs to be charged for this operation, the state the subscription would be in, etc. using the estimate functions.

Note: Ensure that a publishable API key that has been configured to “Allow Estimate API Calls” is used for invoking Estimates functions.

Currently, we support the following Estimate functions

# Note:

  • These APIs when invoked don't perform actual operations. They just generate an estimate.
  • If you have configured Avalara, Chargebee will retrieve the tax amount from Avalara to be displayed in the estimated invoice, this may increase your Avalara request count.

# EU-VAT Validation

Chargebee validates VAT Number by sending a validation request to VAT Information Exchange System (VIES (opens new window)), a search engine owned by the European Commission.

Note: To carry out EU-VAT validation, organization address must be set in Chargebee.

Refer here for the implementation details.