---
title: "Create Discount"
method: POST
path: "/api/v1/discounts"
tags: ["Discounts"]
---

# Create Discount

`POST /api/v1/discounts`

## Request body

- object
  - `discount` union, required
    - DefaultDiscountClientInsertSchema
      - `pricingModelId` string
      - `name` string, required
      - `code` string, required — The discount code, must be unique and between 3 and 20 characters.
      - `amount` integer, required — A positive integer
      - `amountType` 'percent' | 'fixed', required
      - `active` boolean
      - `duration` 'once', required
      - `numberOfPayments` unknown
    - NumberOfPaymentsDiscountClientInsertSchema
      - `pricingModelId` string
      - `name` string, required
      - `code` string, required — The discount code, must be unique and between 3 and 20 characters.
      - `amount` integer, required — A positive integer
      - `amountType` 'percent' | 'fixed', required
      - `active` boolean
      - `duration` 'number_of_payments', required
      - `numberOfPayments` integer, required — A positive integer
    - ForeverDiscountClientInsertSchema
      - `pricingModelId` string
      - `name` string, required
      - `code` string, required — The discount code, must be unique and between 3 and 20 characters.
      - `amount` integer, required — A positive integer
      - `amountType` 'percent' | 'fixed', required
      - `active` boolean
      - `duration` 'forever', required
      - `numberOfPayments` unknown

## Response `200`

Successful response

- object
  - `discount` union, required
    - ForeverDiscountClientSelectSchema
      - `id` string, required
      - `createdAt` integer, required — Epoch milliseconds.
      - `updatedAt` integer, required — Epoch milliseconds.
      - `livemode` boolean, required
      - `organizationId` string, required
      - `pricingModelId` string, required
      - `name` string, required
      - `code` string, required — The discount code, must be unique and between 3 and 20 characters.
      - `amount` integer, required — A positive integer
      - `amountType` 'percent' | 'fixed', required
      - `active` boolean, required
      - `duration` 'forever', required
      - `numberOfPayments` unknown
    - NumberOfPaymentsDiscountClientSelectSchema
      - `id` string, required
      - `createdAt` integer, required — Epoch milliseconds.
      - `updatedAt` integer, required — Epoch milliseconds.
      - `livemode` boolean, required
      - `organizationId` string, required
      - `pricingModelId` string, required
      - `name` string, required
      - `code` string, required — The discount code, must be unique and between 3 and 20 characters.
      - `amount` integer, required — A positive integer
      - `amountType` 'percent' | 'fixed', required
      - `active` boolean, required
      - `duration` 'number_of_payments', required
      - `numberOfPayments` integer, required — A positive integer
    - DefaultDiscountClientSelectSchema
      - `id` string, required
      - `createdAt` integer, required — Epoch milliseconds.
      - `updatedAt` integer, required — Epoch milliseconds.
      - `livemode` boolean, required
      - `organizationId` string, required
      - `pricingModelId` string, required
      - `name` string, required
      - `code` string, required — The discount code, must be unique and between 3 and 20 characters.
      - `amount` integer, required — A positive integer
      - `amountType` 'percent' | 'fixed', required
      - `active` boolean, required
      - `duration` 'once', required
      - `numberOfPayments` unknown

## Other responses

- `400` — Invalid input data
- `401` — Authorization not provided
- `403` — Insufficient access
- `500` — Internal server error

## Changes

- **2026-01-18** `06c4dd78e137` — 6 info
  - added the new optional request property `discount/anyOf[#/components/schemas/DefaultDiscountClientInsertSchema]/pricingModelId`
  - added the new optional request property `discount/anyOf[#/components/schemas/ForeverDiscountClientInsertSchema]/pricingModelId`
  - added the new optional request property `discount/anyOf[#/components/schemas/NumberOfPaymentsDiscountClientInsertSchema]/pricingModelId`
  - added the required property `discount/anyOf[#/components/schemas/DefaultDiscountClientSelectSchema]/pricingModelId` to the response with the `200` status
  - …2 more
- **2025-10-18** `a1eeb4fac4d6` — 1 breaking, 7 info
  - removed `subschema #1, subschema #2, subschema #3` from the `discount` request property `anyOf` list
  - added `#/components/schemas/DefaultDiscountClientInsertSchema, #/components/schemas/NumberOfPaymentsDiscountClientInsertSchema, #/components/schemas/ForeverDiscountClientInsertSchema` to the `discount` request property `anyOf` list
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - …4 more
- **2025-06-25** `0cf7bce0c17d` — 1 breaking, 1 info
  - removed `subschema #1, subschema #2, subschema #3` from the `discount` request property `anyOf` list
  - added `subschema #1, subschema #2, subschema #3` to the `discount` request property `anyOf` list
- …earlier changes not shown

[Full history](https://skmtc.dev/flowglad/apis/flowglad-api/changes/api/v1/discounts/post.md)

---

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