> ## 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 Coupon

> Deletes a coupon and all associated promotional codes. This action is permanent.

## Deleting Coupons

Delete a coupon from your affiliate program. This will also delete all promotional codes associated with this coupon.

<Warning>
  Deleting a coupon is permanent and will cascade delete all promotional codes
  linked to it. Make sure to deactivate the coupon first if you want to preserve
  historical data.
</Warning>


## OpenAPI

````yaml DELETE /coupons
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:
  /coupons:
    delete:
      summary: Delete a coupon
      description: >-
        Deletes a coupon and all associated promotional codes. This action is
        permanent.
      requestBody:
        description: Coupon delete details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CouponDelete'
        required: true
      responses:
        '200':
          description: Coupon deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  deletedCoupon:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Coupon not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CouponDelete:
      type: object
      required:
        - couponId
      properties:
        couponId:
          type: string
          format: uuid
          description: The coupon 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

````