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

# Delete a discount code

> Delete a discount code and remove it from every form. Past redemptions are kept.

> [!NOTE]
>
> Replace `{your-subdomain}` with your workspace’s subdomain. \
> Learn how to find your subdomain in [Workspace subdomain](https://apidocs.neetoform.com/api/workspace-subdomain.md).


## OpenAPI

````yaml bundled/discount-codes.yaml DELETE /discount_codes/{id}
openapi: 3.0.3
info:
  title: NeetoForm Discount Codes APIs
  version: 2.0.0
servers:
  - description: NeetoForm APIs
    url: https://{your-subdomain}.neetoform.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
tags:
  - name: Discount Codes
    description: APIs to manage discount codes, see their redemptions and get reports.
paths:
  /discount_codes/{id}:
    delete:
      tags:
        - Discount Codes
      summary: Delete a discount code
      description: >-
        Delete a discount code and remove it from every form. Past redemptions
        are kept.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - $ref: '#/components/parameters/DiscountCodeId'
      responses:
        '204':
          description: No Content - Discount code deleted
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
    DiscountCodeId:
      in: path
      name: id
      description: >-
        Id of the discount code. You can get it by using the [List discount
        codes](/api/discount-codes/list) API.
      required: true
      schema:
        type: string
        example: 6f1c2a7e-2b1d-4a51-9a0e-1f8f3b0c9d11
  responses:
    NotFound:
      description: Not Found - Discount code with the given ID does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error_response'
          example:
            error: DiscountCode does not exist.
  schemas:
    error_response:
      type: object
      properties:
        error:
          type: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.