---
title: "Update discount"
method: PATCH
path: "/draft_trips/{trip_uuid}/discounts/{id}"
tags: ["Discounts"]
---

# Update discount

`PATCH /draft_trips/{trip_uuid}/discounts/{id}`

Update Discount

## Path parameters

- `trip_uuid` string, required
- `id` string, required

## Request body

- object
  - `data` UpdateDiscount — Update Discount
    - `name` string — Name of the discount code
    - `amount` integer — Amount of the discount code
    - `quantity` integer — How many times this discount code can be used. You can set it to null for "unlimited" value. (NOTE: setting "null" value is not possible in this editor)
    - `discount_type` 'amount' | 'percentage' — Type of discount code
    - `duration` object — Discount duration details
      - `duration_reference` 'trip_start_date' | 'absolute' — Reference for applying offsets or selecting dates. If `trip_start_date` is selected, the discount will be applied based on the start date of the trip. Either `start_offset_days` or `end_offset_days` must be provided. If `absolute` is selected, the discount will be applied based on the absolute start and end dates provided. Either `start_date` or `end_date` must be provided.
      - `start_date` string, date — Start date of the discount.
      - `end_date` string, date — End date of the discount
      - `start_offset_days` integer — Number of days before the reference to start the discount
      - `end_offset_days` integer — Number of days before the reference to end the discount

## Response `200`

Successfully updated

- object
  - `data` Discount — Discount model
    - `id` string — ID of the discount code
    - `name` string, required — Name of the discount code
    - `amount` integer, required — Amount of the discount code
    - `quantity` integer — How many times this discount code can be used. You can set it to null for "unlimited" value. (NOTE: setting "null" value is not possible in this editor)
    - `discount_type` 'amount' | 'percentage', required — Type of discount code
    - `duration` object — Discount duration details
      - `duration_reference` 'trip_start_date' | 'absolute', required — Reference for applying offsets or selecting dates. If `trip_start_date` is selected, the discount will be applied based on the start date of the trip. Either `start_offset_days` or `end_offset_days` must be provided. If `absolute` is selected, the discount will be applied based on the absolute start and end dates provided. Either `start_date` or `end_date` must be provided.
      - `start_date` string, date — Start date of the discount.
      - `end_date` string, date — End date of the discount
      - `start_offset_days` integer — Number of days before the reference to start the discount
      - `end_offset_days` integer — Number of days before the reference to end the discount
    - `created_at` integer — Time at which the object was created. Measured in seconds since the Unix epoch.

---

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