Skip to content

Discounts, gift cards and store credit

Represent discounts, multi-buy offers, gift cards and store credit in Kustom Checkout order lines, with the required amounts and VAT calculations.

Calculate reductions in your system and send them in the order lines. Kustom has no discount UI.

Support for handling discounts, gift cards and store credit inside the checkout is planned. Until then, use order lines.

This shirt has a discount of 5000 minor units at 25% VAT. Set total_discount_amount and reduce total_amount accordingly:

{
"type": "physical",
"name": "White t-shirt",
"reference": "12-345-ABC",
"quantity": 1,
"unit_price": 30000,
"tax_rate": 2500,
"total_amount": 25000,
"total_discount_amount": 5000,
"total_tax_amount": 5000
}

Use a separate line with negative amounts and type: "discount". For 10.00 off at 25% VAT:

{
"type": "discount",
"name": "10.00 discount",
"reference": "12-345-ABC-discount",
"quantity": 1,
"unit_price": -1000,
"tax_rate": 2500,
"total_amount": -1000,
"total_tax_amount": -200
}

Calculate the offer’s value, such as one free item in a three-for-two offer. Send it as a negative total_amount on a discount line. Calculate total_tax_amount using the formula in How VAT lands on a reduction.

These are not discounts, because no VAT is due when they are sold — only when they are spent. Redeem them as a negative line at 0% tax, typed gift_card:

{
"type": "gift_card",
"name": "Gift card",
"reference": "voucher",
"quantity": 1,
"unit_price": -10000,
"tax_rate": 0,
"total_amount": -10000,
"total_tax_amount": 0
}

Store credit issued for a return is handled the same way, typed store_credit. Loyalty points and bonus checks are agreed case by case with Kustom, but a bonus check generally behaves as a voucher.

A voucher that covers the whole cart leaves a zero-amount order, which needs no configuration: Kustom shows no payment methods, leaves the purchase button active and the confirmation page reports a completed zero-amount order.

VAT is calculated on the discounted price. The tax on any line is:

total_amount - total_amount * 10000 / (10000 + tax_rate)

order_amount must equal the sum of all line totals, including reductions.

This page is also available as Markdown — append .md to its URL — and is indexed in llms.txt.