Fees and discounts

Calculate a discount and the fee together

Given an amount and a discount, returns the fee, the discount taken off, and the final amount the customer pays. Unauthenticated so a checkout page can call it while the customer is still choosing how to pay — it identifies the merchant by merchantId rather than by a key, and reads nothing back that the page did not already send. Send all four fields: a partial body is rejected at the edge before it reaches the calculator. When no discount applies, the response carries the fee alone.

post/v2/discounts/calculate

Request

  • Base URL: https://test-api.kashier.io
  • URL: https://test-api.kashier.io/v2/discounts/calculate
  • Auth: none required

Request body

merchantIdstring required

The merchant the payment is for. Example: YOUR_MID

amountnumber required

The amount before fee and discount.

interactionSourcestring

Where the payment is being taken, since fees differ by channel.

discountobject

The discount to apply. Send an empty object to calculate the fee alone.

Response

The fee, the discount, and the resulting amounts. Fields that do not apply are left out — with no discount in play you get paymentFees on its own.

paymentFeesnumber

The processing fee on the amount.

discountAmountnumber

How much comes off for the discount.

originalAmountnumber

The amount before the discount.

finalAmountnumber

What the customer actually pays.

Changes

No recorded changes to this operation across all 1 revision of this API.