Discounting a transaction

Overview

This guide outlines the process for handling discounts and provides recommendations for integrating with CereTax. When dealing with discounts in the CereTax transaction API, there are two options:

  • reduce the sale price of the discounted line item(s) prior to sending the transaction to CereTax.
  • provide CereTax with an invoice-level discount amount that can be distributed across all applicable line items on the invoice.

Reduce Sales Price

The simplest way to handle discounts is to reduce the sales price of the discounted line item(s) prior to sending CereTax the transaction. For example, if you sell a product for $100 and a 20% discount is applied to the order, CereTax should be sent the line item with a revenue amount of $80.00.

Allocate Invoice Discount Amount

The CereTax transaction API supports an invoice-level discountAmount field. This field can be used to specify the total discount amount associated with the invoice. At the line-level, a discounted field is used to denote which lines the discount amount is applicable to.

When specifying a discount amount at the invoice level, the system automatically allocates the discount proportionally across invoice lines where the discounted field is set to true. For example, if you specify a discount amount of $40 on an invoice with two $100 lines where discounted is set to true, each line will be discounted by $20

By default, when a discount amount is provided at the invoice level, invoice lines will have the discounted field set to true and all lines will receive a proportional discount.

If the discount amount should not apply to any specific line items on the invoice, the discounted field should be updated to false for those line items. This ensures that discounts are only applied where applicable, preventing erroneous discount allocations. For example, if you specify a discount amount of $20 on an invoice that includes one line for general merchandise and one line for a gift card, you may want to set the discounted field to false for the gift card line.

Integration Recommendations

For systems that already allocates or applies discounts at the line level, CereTax recommends using the Reduce Sales Price discount method for discount handling.