> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plude.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create discount

> Create a discount.



## OpenAPI

````yaml post /discounts
openapi: 3.0.1
info:
  title: Plude
  description: Headless subscription management and recurring billing.
  termsOfService: https://plude.com/terms
  contact:
    name: Corporate Contact
    url: https://plude.com/contact
  license:
    name: License
    url: https://plude.com/license
  version: v4.2024.7.1
servers: []
security:
  - Bearer: []
paths:
  /discounts:
    post:
      tags:
        - Discounts
      summary: Create discount
      description: Create a discount.
      parameters:
        - name: x-environment
          in: header
          description: >-
            Configure which environment the request will handle. If the provided
            credentials do not allow access to this specified environment, a 403
            Forbidden response is returned.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDiscountRequest'
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
components:
  schemas:
    CreateDiscountRequest:
      required:
        - name
      type: object
      properties:
        name:
          maxLength: 50
          minLength: 1
          type: string
        description:
          type: string
          description: An internal short description for this discount.
          nullable: true
        productHandle:
          maxLength: 50
          type: string
          description: Stock keeping unit of line. See https://go.plude.io/h21010.
          nullable: true
        invoiceText:
          maxLength: 500
          type: string
          description: A description that will be shown on the invoice item.
          nullable: true
        percentage:
          type: number
          description: >-
            The discount amount in percentage. between 0.0001 and 1.0000.
            Detaults to 0.
          format: double
          nullable: true
        expiresAt:
          type: string
          description: >-
            Datetime of when this discount expires. Discount can no longer be
            applied after this date has elapsed.
          format: date-time
          nullable: true
        amounts:
          type: object
          additionalProperties:
            type: integer
            format: int64
          description: >-
            Dictionary with discount amounts. Key is a three-letter ISO currency
            code, in lowercase. Must be a supported currency.
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    Bearer:
      type: http
      description: "JWT Authorization header using the Bearer scheme. \r\n\r\n Enter 'Bearer' [space] and then your token in the text input below.\r\n\r\nExample: \"Bearer 12345abcdef\""
      scheme: Bearer

````