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

# Update discount code

> Update an existing discount code. Only the fields included in the request are updated.

<Info>Replace `{your-subdomain}` with your workspace’s subdomain. <br /> Learn how to find your subdomain in [Workspace subdomain](/getting-started/workspace-subdomain).</Info>


## OpenAPI

````yaml bundled/discount-codes.yaml PATCH /discount-codes/{id}
openapi: 3.0.3
info:
  title: NeetoCal Discount Codes APIs
  version: 2.0.0
servers:
  - description: NeetoCal APIs
    url: https://{your-subdomain}.neetocal.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/getting-started/workspace-subdomain).
security: []
tags:
  - name: Discount codes
    description: APIs to manage discount codes for bookings.
paths:
  /discount-codes/{id}:
    patch:
      tags:
        - Discount codes
      summary: Update a discount code
      description: >-
        Update an existing discount code. Only the fields included in the
        request are updated.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID of the discount code to update.
          example: d6ccef53-f369-4b54-a818-6e93e2a0455c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: Code of the discount code. This value should be unique.
                  example: OFF50
                value:
                  type: integer
                  description: >-
                    Value of the discount code. This value should be between
                    1-100 if kind is percentage.
                  example: 50
                kind:
                  type: string
                  description: Type of the discount code. Either fixed or percentage.
                  enum:
                    - fixed
                    - percentage
                  example: percentage
                redeems_limit:
                  type: integer
                  description: >-
                    Number of times the discount code can be redeemed. If left
                    empty, the discount can be redeemed unlimited times.
                  example: 10
                redeems_limit_by_email:
                  type: integer
                  description: >-
                    Number of times the discount code can be redeemed by using a
                    particular email. If left empty, the discount can be
                    redeemed unlimited times.
                  example: 5
                expires_at:
                  type: string
                  description: >-
                    Date upto which the discount code can be used. If left
                    empty, discount code can be used forever. It should be of
                    the format "DD-MM-YYYY"
                  example: 12-05-2025
                days_valid_after_first_use_per_client:
                  type: integer
                  description: >-
                    Number of days upto which the discount code can be used by a
                    particular client after their first use. If left empty, the
                    discount code can be used forever.
                  example: 7
                allowed_emails:
                  type: array
                  description: >-
                    Array of allowed email addresses that can redeem the
                    discount code. When provided, it replaces the existing list.
                    If left empty, the discount code can be redeemed using any
                    email address.
                  items:
                    type: string
                    format: email
                    description: Valid email address
                  example:
                    - eve@bigbinary.com
                    - charlie@bigbinary.com
                meeting_ids:
                  type: array
                  items:
                    type: string
                    format: SID
                  description: >-
                    Array of meeting SIDs in which the discount code can be used
                    in. When provided, it replaces the existing list. You can
                    get `sid` in different ways. Visit the scheduling link page
                    and then click on "Settings" > "Show SID". That will give
                    you `sid`. The other way you can get `sid` is by listing
                    scheduling links using our [List scheduling
                    links](/api-reference/scheduling-links/list) API. Here you
                    will see `sid` for each scheduling link.
                  example:
                    - ktr8qu3
                    - xzfpwqg
                    - csesbjq
                    - c64h5yx
      responses:
        '200':
          description: OK - Discount code updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  discount_code:
                    $ref: '#/components/schemas/discount_code'
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/getting-started/authentication) for more information.
      required: true
      schema:
        type: string
  schemas:
    discount_code:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the created discount code.
          example: d6ccef53-f369-4b54-a818-6e93e2a0455c
        code:
          type: string
          description: The unique discount code created.
          example: OFF_60
        value:
          type: integer
          description: Value of the discount.
          example: 60
        kind:
          type: string
          description: Type of the discount (fixed or percentage).
          enum:
            - fixed
            - percentage
        redeems_limit:
          type: integer
          description: Number of times the discount code can be redeemed.
          example: 100
        redeems_limit_by_email:
          type: integer
          description: Number of times the discount code can be redeemed per email.
          example: 10
        expires_at:
          type: string
          format: date-time
          description: Expiration date and time of the discount code in ISO 8601 format.
          example: '2025-08-12T00:00:00.000Z'
        days_valid_after_first_use_per_client:
          type: integer
          description: >-
            Number of days the discount code is valid for a client after their
            first use. If null, the discount code can be used indefinitely.
          example: 28
        meetings:
          type: array
          description: >-
            Array of meetings where the discount code can be used. Each meeting
            is represented as a tuple containing [meeting_id, meeting_name].
          items:
            type: array
            minItems: 2
            maxItems: 2
            items:
              type: string
            description: A tuple containing meeting ID and meeting name
          example:
            - - 0b947f19-94a3-409b-ae3b-36d79a1b4969
              - Meeting with consultation team

````