---
title: "Apply a discount to an order"
method: POST
path: "/shop/orders/{orderId}/discounts"
tags: ["Orders"]
---

# Apply a discount to an order

`POST /shop/orders/{orderId}/discounts`

Use this endpoint to apply the discount from a [`DiscountType`](/endpoints/DiscountTypes) to an order.

## Request body

- object
  - `discount_type_code` string, required — The code for the [`DiscountType`](/endpoints/DiscountTypes). If the code exists, the discount will be applied. If not, an error will be returned.
  - `discount_amount` integer, required — The value of the discount to be applied when a [`DiscountType`](/endpoints/DiscountTypes) is applied. If this is for a customisable in-app discount type, this will be able to be changed before being applied.
  - `amount_type` 'monetary' | 'percentage' — The type of discount. For a promo code, this will always be a percentage.
  - `reason_code` 'coupon' | 'general' | 'predefined' | 'voucher_difference' — The code for the reason the discount was applied.

## Response `201`

The `OrderDiscount` was successfully applied.

- object
  - `data` OrderDiscount[]
    - `id` string, mongo-id, required — The ID of the order discount.
    - `discount_type_code` string, required — The code for the [`DiscountType`](/endpoints/DiscountTypes). If the code exists, the discount will be applied. If not, an error will be returned.
    - `applicable_for` 'app_only' | 'app_and_booking_engine', required — Where the [`DiscountType`](/endpoints/DiscountTypes) is able to be applied.
    - `amount_type` 'monetary' | 'percentage', required — The type of discount. For a promo code, this will always be a percentage.
    - `discount_amount` integer, required — The value of the discount to be applied when a [`DiscountType`](/endpoints/DiscountTypes) is used. This can be used as a monetary amount or percentage for an in-app discount type and is set to percentage for a promo code.
    - `calculated_amount` integer, required — The total calculated amount of this discount.
    - `currency` string, required — The currency of the monetary discount to be applied if `amount_type` is set to `monetary` for an in-app discount type. This is associated with the site.
    - `reason_code` 'coupon' | 'general' | 'predefined' | 'voucher_difference', nullable, required — The code for the reason the discount was applied.
    - `coupon_code_id` string, object-id, nullable, required — The ID of the coupon code used to add this discount, if applicable.
    - `coupon` BasketCouponSummary, required
      - `id` string, object-id, required — The ID of the coupon.
      - `code` string, required — The code of the coupon.
      - `name` string, required — The name of the coupon.
      - `description` string, required — A description of the coupon.
      - `customer_credit_id` string, uuid, required — The customer credit this coupon relates to, if applicable.
    - `applied_by` UserSummary, required
      - `id` string, mongo-id, required — The ID of the user.
      - `avatar` Media
        - `id` string, uuid, required — Unique identifier of the uploaded media item, returned from `createMedia`. Pass this ID into any field that accepts a media reference (logos, hero images, product images, etc.).
        - `file_name` string, required — Original filename of the uploaded asset, preserved as provided at upload time. Used for display in the media library and as a hint when serving downloads.
        - `mime_type` string, required — The mime type of the media item.
        - `original_url` string, required — The url of the media resource.
        - `size` integer, required — The size of the media item in bytes.
        - `url` string, required — The url of the converted media resource.
      - `email` string, email, required
      - `first_name` string, required
      - `full_name` string, required
      - `last_name` string, required
    - `applied_at` string, date-time, required — The date and time the [`DiscountType`](/endpoints/DiscountTypes) was applied.
    - `site_id` string, uuid, required — The ID of the site the discount is associated with.

## Other responses

- `404` — The resource couldn't be found
- `422` — The request didn't pass validation

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
