Skip to main content
POST
/
{locale}
/
shop
/
coupons
/
calculate-discount
curl -X POST "https://staging-api.loyalty.lt/en/shop/coupons/calculate-discount" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "coupon_code": "SUMMER20",
    "purchase_amount": 50.00
  }'
{
  "success": true,
  "message": "Discount calculated successfully",
  "data": {
    "can_apply": true,
    "discount_amount": 10.00,
    "final_amount": 40.00,
    "purchase_amount": 50.00,
    "savings": 10.00,
    "points_awarded": 0,
    "reward_details": "20% discount"
  }
}

Calculate Coupon Discount

Calculate the discount amount that would be applied for a given coupon and purchase amount. Useful for previewing the discount before redeeming.
This endpoint uses Partner API authentication (X-API-Key and X-API-Secret headers).

Request Body

coupon_code
string
required
The coupon code to calculate discount for
purchase_amount
number
required
The purchase amount in euros

Response

success
boolean
Indicates successful calculation
data
object
curl -X POST "https://staging-api.loyalty.lt/en/shop/coupons/calculate-discount" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "coupon_code": "SUMMER20",
    "purchase_amount": 50.00
  }'
{
  "success": true,
  "message": "Discount calculated successfully",
  "data": {
    "can_apply": true,
    "discount_amount": 10.00,
    "final_amount": 40.00,
    "purchase_amount": 50.00,
    "savings": 10.00,
    "points_awarded": 0,
    "reward_details": "20% discount"
  }
}

Discount Types

TypeCalculation
percentagepurchase_amount * discount_amount / 100
fixedmin(discount_amount, purchase_amount)
pointsNo direct discount, awards points instead