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

# Update Discount

> Update the details of an existing discount identified by its ID. Allows modification of various fields including `name`, `code`, `discount_type`, and more. Requires `x-store-id` for authorization. Returns the updated discount data.



## OpenAPI

````yaml /api-reference/growth-api.json patch /v1/discounts/{id}
openapi: 3.0.0
info:
  title: Growth API
  description: Comprehensive API documentation for Blink.
  version: 1.0.0
servers:
  - url: https://api.blink.store/v1
security:
  - storeIdHeader: []
paths:
  /v1/discounts/{id}:
    patch:
      tags:
        - Discounts
      summary: Update Discount
      description: >-
        Update the details of an existing discount identified by its ID. Allows
        modification of various fields including `name`, `code`,
        `discount_type`, and more. Requires `x-store-id` for authorization.
        Returns the updated discount data.
      parameters:
        - name: id
          in: path
          required: true
          description: ID of the discount.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDiscountRequest'
      responses:
        '200':
          description: Discount updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountDetails'
        '400':
          description: Bad Request - No updatable fields provided.
        '404':
          description: Discount not found.
      security:
        - storeIdHeader: []
components:
  schemas:
    UpdateDiscountRequest:
      type: object
      properties:
        name:
          type: string
        code:
          type: string
        discount_type:
          type: string
        discount_amount:
          type: number
        status:
          type: string
        max_redemptions:
          type: integer
        starts_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        product_ids:
          type: array
          items:
            type: string
    DiscountDetails:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        code:
          type: string
        discount_type:
          type: string
        discount_amount:
          type: number
        status:
          type: string
        max_redemptions:
          type: integer
        starts_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        product_ids:
          type: array
          items:
            type: string
  securitySchemes:
    storeIdHeader:
      type: apiKey
      in: header
      name: x-store-id

````