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

# Delete a discount

> Permanently delete a discount code. Prevent further usage of the discount.



## OpenAPI

````yaml delete /v1/discounts/{id}/delete
openapi: 3.0.0
info:
  title: Creem API
  description: >-
    Creem is an all-in-one platform for managing subscriptions and recurring
    revenue, tailored specifically for today's SaaS companies. It enables you to
    boost revenue, enhance customer retention, and scale your operations
    seamlessly.
  version: v1
  contact:
    name: Creem Support
    url: https://creem.io
    email: support@creem.io
  license:
    name: Commercial
    url: https://creem.io/terms
  termsOfService: https://creem.io/terms
servers:
  - url: https://api.creem.io
  - url: https://test-api.creem.io
security: []
tags: []
externalDocs:
  description: Creem Documentation
  url: https://docs.creem.io
paths:
  /v1/discounts/{id}/delete:
    delete:
      tags:
        - Discounts
      summary: Delete a discount.
      description: >-
        Permanently delete a discount code. Prevent further usage of the
        discount.
      operationId: deleteDiscount
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the discount to delete
          schema:
            type: string
      responses:
        '200':
          description: Successfully deleted a discount
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountEntity'
        '400':
          description: Bad Request - Invalid input parameters
        '401':
          description: Unauthorized - Invalid or missing API key
        '404':
          description: Not Found - Resource does not exist
      security:
        - ApiKey: []
components:
  schemas:
    DiscountEntity:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object.
        mode:
          $ref: '#/components/schemas/EnvironmentMode'
        object:
          type: string
          description: >-
            A string representing the object’s type. Objects of the same type
            share the same value.
          example: discount
        status:
          type: string
          description: The status of the discount (e.g., active, inactive).
          enum:
            - deleted
            - active
            - draft
            - expired
            - scheduled
          example: active
        name:
          type: string
          description: The name of the discount.
          example: Holiday Sale
        code:
          type: string
          description: The discount code. A unique identifier for the discount.
          example: HOLIDAY2024
        type:
          type: string
          description: The type of the discount, either "percentage" or "fixed".
          enum:
            - percentage
            - fixed
          example: percentage
        amount:
          type: number
          description: The amount of the discount. Can be a percentage or a fixed amount.
          example: 20
        currency:
          type: string
          description: The currency of the discount. Only required if type is "fixed".
          example: USD
        percentage:
          type: number
          description: >-
            The percentage of the discount. Only applicable if type is
            "percentage".
          example: 15
        expiry_date:
          format: date-time
          type: string
          description: The expiry date of the discount.
          example: '2024-12-31T23:59:59Z'
        max_redemptions:
          type: number
          description: The maximum number of redemptions allowed for the discount.
          example: 100
        duration:
          type: string
          description: The duration type for the discount.
          enum:
            - forever
            - once
            - repeating
          example: repeating
        duration_in_months:
          type: number
          description: >-
            The number of months the discount is valid for. Only applicable if
            the duration is "repeating" and the product is a subscription.
          example: 6
        applies_to_products:
          description: The list of product IDs to which this discount applies.
          example:
            - prod_123
            - prod_456
          type: array
          items:
            type: string
        redeem_count:
          type: number
          description: The number of times this discount has been redeemed.
          example: 15
      required:
        - id
        - mode
        - object
        - status
        - name
        - code
        - type
    EnvironmentMode:
      type: string
      description: String representing the environment.
      enum:
        - test
        - prod
        - sandbox
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can find your API key in the Creem
        dashboard under Settings > API Keys.

````

Built with [Mintlify](https://mintlify.com).