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

# Delete a Coupon

> Permanently deletes a coupon **and every promotional code attached to it**. Any code your affiliates are already sharing stops working immediately. This cannot be undone — set `valid` to `false` with [Update a Coupon](/api-reference/coupons/update) if you only want to stop new redemptions.

Fires the `coupon.deleted` webhook.

## 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: >-
    REST API for managing affiliates, referrals, sales, affiliate links, coupons
    and promotional codes in your Referly affiliate program.


    Every request must send `Authorization: Bearer <YOUR_API_KEY>`. The token is
    scoped to a single affiliate program, so no program ID is ever required in
    the request — every read and write is automatically limited to that program.


    Requests are rate limited per token, per endpoint and per method.
  version: 1.0.0
servers:
  - url: https://www.referly.so/api/v1
security:
  - bearerAuth: []
paths:
  /coupons:
    delete:
      summary: Delete a coupon
      description: >-
        Permanently deletes a coupon **and every promotional code attached to
        it**. Any code your affiliates are already sharing stops working
        immediately. This cannot be undone — set `valid` to `false` with [Update
        a Coupon](/api-reference/coupons/update) if you only want to stop new
        redemptions.


        Fires the `coupon.deleted` webhook.
      requestBody:
        description: The coupon to delete
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CouponDelete'
        required: true
      responses:
        '200':
          description: The coupon and its promotional codes were deleted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Confirmation message
                  deletedCoupon:
                    type: object
                    description: The coupon that was removed
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: The deleted coupon ID
                      name:
                        type: string
                        nullable: true
                        description: The deleted coupon's name
        '400':
          description: '`couponId` was not supplied.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: No coupon with that ID exists in this program.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          description: The coupon could not be deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CouponDelete:
      type: object
      required:
        - couponId
      properties:
        couponId:
          type: string
          format: uuid
          description: The coupon to delete. Its promotional codes are deleted with it.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human readable description of what went wrong
  responses:
    Unauthorized:
      description: >-
        The `Authorization` header is missing, is not a `Bearer` header, or the
        token is not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: API access is not enabled for this account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Too many requests for this token on this endpoint. Please slow down.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````