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

# Update Sale

> Updates a sale based on their ID



## OpenAPI

````yaml PUT /sales
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:
  /sales:
    put:
      summary: Update a sale by ID
      description: Updates a sale based on their ID
      requestBody:
        description: Sale update details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaleUpdate'
        required: true
      responses:
        '200':
          description: Sale updated successfully
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SaleUpdate:
      type: object
      required:
        - saleId
      properties:
        saleId:
          type: integer
          description: The sale ID to delete
        name:
          type: string
          description: Email associated with the sale
        email:
          type: string
          format: email
          description: Email of the customer associated with the sale
        totalEarned:
          type: number
          format: float
          description: Total amount earned from the sale
        commissionRate:
          type: number
          format: float
          description: Commission rate for the sale
    Error:
      type: object
      properties:
        error:
          type: integer
          description: Error code
        message:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````