KashierDevelopersKashier Developers

Calculate a discount and the fee together

curl -X POST "https://test-api.kashier.io/v2/discounts/calculate" \  -H "Content-Type: application/json" \  -d '{    "merchantId": "YOUR_MID",    "amount": 100,    "interactionSource": "online",    "discount": {}  }'

{  "paymentFees": 15,  "discountAmount": 10,  "originalAmount": 100,  "finalAmount": 90}

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.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

POST
/v2/discounts/calculate