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

# Delete a Promotional Code

> Deletes a promotional code. This action is permanent.

## Deleting Promotional Codes

Delete a promotional code from your affiliate program. This removes the code but does not affect the parent coupon or other promotional codes.

<Warning>
  Deleting a promotional code is permanent. Consider deactivating the code
  instead if you want to preserve historical data while preventing future use.
</Warning>


## OpenAPI

````yaml DELETE /promotional-codes
openapi: 3.0.1
info:
  title: Referly API
  description: API for managing affiliates, referrals, and sales for SaaS businesses
  version: 1.0.0
servers:
  - url: https://www.referly.so/api/v1
security:
  - bearerAuth: []
paths:
  /promotional-codes:
    delete:
      summary: Delete a promotional code
      description: Deletes a promotional code. This action is permanent.
      requestBody:
        description: Promotional code delete details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromotionalCodeDelete'
        required: true
      responses:
        '200':
          description: Promotional code deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  deletedCode:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      code:
                        type: string
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Promotional code not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PromotionalCodeDelete:
      type: object
      required:
        - promotionalCodeId
      properties:
        promotionalCodeId:
          type: string
          format: uuid
          description: The promotional code ID to delete
    Error:
      type: object
      properties:
        error:
          type: integer
          description: Error code
        message:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````