In the following request we will create a Checkout session with
Here's a breakdown of these values:
- The amount is required and represents the total to collect for payment after discounts, inclusive of taxes.
- The subtotalAmount represents the total before any discounts, inclusive of taxes.
- The totalDiscount represents the reduction in price applied across all the products or services.
- The totalTaxAmount represents the total tax added to the price of the products or services.
The totalDiscount, totalTaxAmount and subtotalAmount values are optional and these values are for display purposes only and do not have an effect on the amount collected.
Replace <secret-key> with your secret API integration key. For more information, see here.
Given the amount to collect and totalDiscount to apply, the subtotalAmount and totalTaxAmount can be calculated as follows:
- subtotalAmount = amount + totalDiscount
- totalTaxAmount = amount - (amount)/(1.15)