---
title: "Calculate a discount"
method: POST
path: "/discounts/calculate"
tags: ["Discounts"]
---

# Calculate a discount

`POST /discounts/calculate`

## Request

- Base URL: `https://api.vrio.app`
- URL: `https://api.vrio.app/discounts/calculate`
- Auth: API key in header `X-Api-Key`

Calculate a discount for an array of offers.

## Request body

- object
  - `offers` object[], required: Define the offers to calculate the discount for.
    - `offer_id` integer, required: Offer ID associated with offer.
    - `item_id` integer: Item ID associated with offer.
    - `offer_quantity` integer: The quantity of the offer.
    - `offer_price` string: Override offer price.
    - `discount_code` string, required: Discount code to apply.

## Response `200`

OK

- object
  - `offers` object[]
    - `offer_id` integer
    - `offer_price` string
    - `offer_quantity` integer
    - `offer_price_total` string
    - `offer_total_discount` string
    - `offer_discounted_price_total` string
    - `discount_details` object
      - `total_discount` string
      - `label` string
      - `cart_label` string
      - `quantity_description` string
      - `order_discount_total` string
      - `dunning_discount_total` string
      - `quantity_discount_total` string
      - `discount_code_discount_total` string
      - `promotional_profile_discount_total` string
      - `per_offer` string
      - `discount_code_valid` boolean
      - `discount_code_message` string

## Other responses

- `400`: Error response
- `401`: Unauthorized response
- `403`: Forbidden response
- `500`: Error response

---

[API](https://skmtc.dev/vrio/apis/selling.md) - [All operations](https://skmtc.dev/vrio/apis/selling/llms.txt) - [OpenAPI document](https://skmtc.dev/vrio/apis/selling/revisions/83eca29c6745?raw)
