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

# Update Coupon

> The "Update Coupon" API enables you to modify existing coupon details such as discount values, validity periods, usage limits, and other promotional parameters. Use this endpoint to adjust or extend promotional offers for your customers.



## OpenAPI

````yaml /api-reference/payments/openapi.json put /payments/coupon
openapi: 3.0.0
info:
  title: Payments API
  description: Documentation for payments API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Payments
    description: Documentation for payments API
  - name: Integrations
    description: Documentation for payments API
  - name: Orders
    description: Documentation for payments API
  - name: Order fulfillments
    description: Documentation for payments API
  - name: Order Notes
    description: Documentation for payments API
  - name: Transactions
    description: Documentation for payments API
  - name: Subscriptions
    description: Documentation for payments API
  - name: Coupons
    description: Documentation for payments API
  - name: Custom Provider
    description: Documentation for payments API
paths:
  /payments/coupon:
    put:
      tags:
        - Coupons
      summary: Update Coupon
      description: >-
        The "Update Coupon" API enables you to modify existing coupon details
        such as discount values, validity periods, usage limits, and other
        promotional parameters. Use this endpoint to adjust or extend
        promotional offers for your customers.
      operationId: update-coupon
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCouponParams'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCouponResponseDto'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - Location-Access:
            - payments/coupons.write
components:
  schemas:
    UpdateCouponParams:
      type: object
      properties:
        altId:
          type: string
          description: Location Id
          example: BQdAwxa0ky1iK2sstLGJ
        altType:
          type: string
          description: Alt Type
          enum:
            - location
          example: location
        name:
          type: string
          description: Coupon Name
          example: New Year Sale
        code:
          type: string
          description: Coupon Code
          example: LEVELUPDAY2022
        discountType:
          type: string
          description: Discount Type
          enum:
            - percentage
            - amount
          example: amount
        discountValue:
          type: number
          description: Discount Value
          example: 10
        startDate:
          type: string
          description: Start date in YYYY-MM-DDTHH:mm:ssZ format
          example: '2023-01-01T22:45:00.000Z'
        endDate:
          type: string
          description: End date in YYYY-MM-DDTHH:mm:ssZ format
          example: '2023-01-31T22:45:00.000Z'
        usageLimit:
          type: number
          description: Max number of times coupon can be used
          example: 10
        productIds:
          description: Product Ids
          example:
            - 6241712be68f7a98102ba272
          type: array
          items:
            type: string
        applyToFuturePayments:
          type: boolean
          example: true
          default: true
          description: Is Coupon applicable on upcoming subscription transactions
        applyToFuturePaymentsConfig:
          example:
            - type: fixed
              duration: 5
              durationType: months
            - type: forever
          default:
            type: forever
          description: >-
            If coupon is applicable on upcoming subscription transactions, how
            many months should it be applicable for a subscription
          allOf:
            - $ref: '#/components/schemas/ApplyToFuturePaymentsConfig'
        limitPerCustomer:
          type: boolean
          example: true
          default: false
          description: Limits whether a coupon can be redeemed only once per customer.
        id:
          type: string
          description: Coupon Id
          example: 6241712be68f7a98102ba272
      required:
        - altId
        - altType
        - name
        - code
        - discountType
        - discountValue
        - startDate
        - id
    CreateCouponResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: Unique MongoDB identifier for the coupon
          example: 67f6c132d9485f9dacd5f123
        usageCount:
          type: number
          description: Number of times the coupon has been used
          example: 12
        limitPerCustomer:
          type: number
          description: >-
            Maximum number of times a customer can use this coupon (0 for
            unlimited)
          example: 5
        altId:
          type: string
          description: Location Id
          example: 79t07PzK8Tvf73d12312
        altType:
          type: string
          description: Type of entity
          example: location
        name:
          type: string
          description: Display name of the coupon
          example: NEWT6
        code:
          type: string
          description: Redemption code for the coupon
          example: NEWT6
        discountType:
          type: string
          description: Type of discount (percentage or amount)
          example: percentage
          enum:
            - percentage
            - amount
        discountValue:
          type: number
          description: Value of the discount (percentage or fixed amount)
          example: 25
        status:
          type: string
          description: Current status of the coupon
          example: scheduled
          enum:
            - scheduled
            - active
            - expired
        startDate:
          type: string
          description: Date when the coupon becomes active
          example: '2025-04-30T18:30:00.000Z'
        endDate:
          type: string
          description: End date when the coupon expires
          example: '2025-05-30T18:30:00.000Z'
        applyToFuturePayments:
          type: boolean
          description: Indicates if the coupon applies to future recurring payments
          example: true
        applyToFuturePaymentsConfig:
          $ref: '#/components/schemas/ApplyToFuturePaymentsConfigDto'
        userId:
          type: string
          description: User ID associated with the coupon (if applicable)
          example: q0m15dTLGeiGOXG123123
        createdAt:
          type: string
          description: Creation timestamp
          example: '2025-04-09T18:49:22.026Z'
        updatedAt:
          type: string
          description: Last update timestamp
          example: '2025-04-09T18:49:22.026Z'
        traceId:
          type: string
          description: Unique identifier for tracing this API request
          example: c667b18d-8f5e-44cf-a914
      required:
        - _id
        - usageCount
        - limitPerCustomer
        - altId
        - altType
        - name
        - code
        - discountType
        - discountValue
        - status
        - startDate
        - applyToFuturePayments
        - applyToFuturePaymentsConfig
        - createdAt
        - updatedAt
        - traceId
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
    ApplyToFuturePaymentsConfig:
      type: object
      properties:
        type:
          type: string
          description: Type of the config
          example: forever | fixed
          enum:
            - forever
            - fixed
        duration:
          type: number
          description: Duration the coupon to be applied in a subscription
          example: 5
        durationType:
          type: string
          description: Type of the duration
          example: months
          enum:
            - months
      required:
        - type
        - duration
        - durationType
    ApplyToFuturePaymentsConfigDto:
      type: object
      properties:
        type:
          type: string
          description: Type of future payments configuration
          example: fixed
          enum:
            - forever
            - fixed
        duration:
          type: number
          description: Duration value for fixed type configurations
          example: 3
        durationType:
          type: string
          description: Duration type for fixed configurations (e.g. months)
          example: months
      required:
        - type

````