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

> Permanently deletes a sale and the commissions that cascade from it. This cannot be undone.

The request succeeds with the same response even when no sale matched. Fires the `sale.deleted` webhook.



## OpenAPI

````yaml DELETE /sales
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:
  /sales:
    delete:
      summary: Delete sale
      description: >-
        Permanently deletes a sale and the commissions that cascade from it.
        This cannot be undone.


        The request succeeds with the same response even when no sale matched.
        Fires the `sale.deleted` webhook.
      requestBody:
        description: The sale to delete
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaleDelete'
        required: true
      responses:
        '200':
          description: The sale was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteMessage'
        '400':
          description: '`saleId` was not supplied, or the delete failed.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/ProgramNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    SaleDelete:
      type: object
      required:
        - saleId
      properties:
        saleId:
          type: integer
          description: The sale to delete
    DeleteMessage:
      type: object
      properties:
        message:
          type: string
          description: Confirmation message
    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'
    ProgramNotFound:
      description: The affiliate program this token belongs to no longer exists.
      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

````