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

# Update a discount

> Update a discount



## OpenAPI

````yaml billing.2024-07-30.product.live PUT /discounts/{id}
openapi: 3.0.0
info:
  title: Billing
  description: Manage Billing
  version: '0.1'
servers:
  - url: https://dev.seqhq.io/api
    description: DEV
  - url: https://sandbox.sequencehq.com/api
    description: SANDBOX
  - url: https://eu.sequencehq.com/api
    description: PRODUCTION
security: []
tags: []
paths:
  /discounts/{id}:
    servers: []
    parameters: []
    put:
      tags:
        - Discounts
      summary: Update a discount
      description: Update a discount
      operationId: putDiscountsById
      parameters:
        - name: id
          in: path
          description: Discount ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            Your [API credentials](/reference/authentication). Eg. `Basic
            {credentials}`.
          required: true
          schema:
            type: string
        - name: Sequence-Version
          in: header
          description: Use this header to select an API version
          required: false
          schema:
            type: string
            enum:
              - '2024-07-30'
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/UpdateDiscountEndpointUpdateDiscountRequestModel
              example:
                billingScheduleId: 08a76ddb-230e-4700-a5e2-70f6edaf7d50
                priceIds:
                  - e007e884-5100-4183-8355-4771865cb4d7
                separateLineItem: false
                amount: 25
                discountCalculationType: PERCENTAGE
                message: Loyalty Discount
                validFrom: '2023-01-01'
                validTo: '2023-01-31'
            examples:
              UpdateDiscountEndpointUpdateDiscountRequestModel:
                summary: ''
                value:
                  billingScheduleId: 08a76ddb-230e-4700-a5e2-70f6edaf7d50
                  priceIds:
                    - e007e884-5100-4183-8355-4771865cb4d7
                  separateLineItem: false
                  amount: 25
                  discountCalculationType: PERCENTAGE
                  message: Loyalty Discount
                  validFrom: '2023-01-01'
                  validTo: '2023-01-31'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountResponse'
                example:
                  id: d58bf2e3-7a5d-4900-8457-2521c6880f7d
                  sequenceAccountId: 1986c663-9ee9-4811-bfbf-57d2ad666096
                  billingScheduleId: 08a76ddb-230e-4700-a5e2-70f6edaf7d50
                  phaseId: 220e1878-b70a-4dfd-9c55-7651424b12d6
                  priceIds:
                    - e007e884-5100-4183-8355-4771865cb4d7
                  separateLineItem: false
                  amount: 25
                  discountCalculationType: PERCENTAGE
                  message: Loyalty Discount
                  validFrom: '2023-01-01'
                  validTo: '2023-01-31'
                  createdAt: '2022-06-28T16:47:00Z'
                  updatedAt: '2022-06-28T16:47:00Z'
                  seatDiscountType: ALL_SEATS
              examples:
                DiscountResponse:
                  summary: ''
                  value:
                    id: d58bf2e3-7a5d-4900-8457-2521c6880f7d
                    sequenceAccountId: 1986c663-9ee9-4811-bfbf-57d2ad666096
                    billingScheduleId: 08a76ddb-230e-4700-a5e2-70f6edaf7d50
                    phaseId: 220e1878-b70a-4dfd-9c55-7651424b12d6
                    priceIds:
                      - e007e884-5100-4183-8355-4771865cb4d7
                    separateLineItem: false
                    amount: 25
                    discountCalculationType: PERCENTAGE
                    message: Loyalty Discount
                    validFrom: '2023-01-01'
                    validTo: '2023-01-31'
                    createdAt: '2022-06-28T16:47:00Z'
                    updatedAt: '2022-06-28T16:47:00Z'
                    seatDiscountType: ALL_SEATS
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '500':
          description: Internal Server Error
          content: {}
components:
  schemas:
    UpdateDiscountEndpointUpdateDiscountRequestModel:
      required:
        - amount
        - billingScheduleId
        - discountCalculationType
        - message
        - priceIds
        - separateLineItem
      type: object
      example:
        billingScheduleId: 08a76ddb-230e-4700-a5e2-70f6edaf7d50
        priceIds:
          - e007e884-5100-4183-8355-4771865cb4d7
        separateLineItem: false
        amount: 25
        discountCalculationType: PERCENTAGE
        message: Loyalty Discount
        validFrom: '2023-01-01'
        validTo: '2023-01-31'
      properties:
        billingScheduleId:
          type: string
          description: Billing Schedule ID
          example: 08a76ddb-230e-4700-a5e2-70f6edaf7d50
        priceIds:
          type: array
          description: >-
            Price IDs this discount applies to. If not populated, the discount
            applies to all prices on the billing schedule
          example:
            - e007e884-5100-4183-8355-4771865cb4d7
          items:
            type: string
        separateLineItem:
          type: boolean
          description: >-
            Indicates whether the discount should appear as a separate line item
            in the invoice
          example: false
        amount:
          type: number
          description: Amount to be reduced
          example: 25
        discountCalculationType:
          $ref: '#/components/schemas/DiscountCalculationType'
          description: Indicates whether the discount amount is percentage or nominal
        message:
          type: string
          description: Message to appear on the Invoice
          example: Loyalty Discount
        validFrom:
          type: string
          description: First Day Discount is Valid
          format: date
          example: '2023-01-01'
        validTo:
          type: string
          description: Last Day Discount is Valid
          format: date
          example: '2023-01-31'
    DiscountResponse:
      required:
        - amount
        - billingScheduleId
        - createdAt
        - discountCalculationType
        - id
        - message
        - priceIds
        - seatDiscountType
        - separateLineItem
        - sequenceAccountId
        - updatedAt
      type: object
      example:
        id: d58bf2e3-7a5d-4900-8457-2521c6880f7d
        sequenceAccountId: 1986c663-9ee9-4811-bfbf-57d2ad666096
        billingScheduleId: 08a76ddb-230e-4700-a5e2-70f6edaf7d50
        phaseId: 220e1878-b70a-4dfd-9c55-7651424b12d6
        priceIds:
          - e007e884-5100-4183-8355-4771865cb4d7
        separateLineItem: false
        amount: 25
        discountCalculationType: PERCENTAGE
        message: Loyalty Discount
        validFrom: '2023-01-01'
        validTo: '2023-01-31'
        createdAt: '2022-06-28T16:47:00Z'
        updatedAt: '2022-06-28T16:47:00Z'
        seatDiscountType: ALL_SEATS
      properties:
        id:
          type: string
          description: Discount ID
          example: d58bf2e3-7a5d-4900-8457-2521c6880f7d
        sequenceAccountId:
          type: string
          description: The Sequence Account to which this Discount belongs
          example: 1986c663-9ee9-4811-bfbf-57d2ad666096
        billingScheduleId:
          type: string
          description: Billing Schedule ID
          example: 08a76ddb-230e-4700-a5e2-70f6edaf7d50
        phaseId:
          type: string
          description: Phase ID
          example: 220e1878-b70a-4dfd-9c55-7651424b12d6
        priceIds:
          type: array
          description: >-
            Price IDs this discount applies to. If not populated, the discount
            applies to all prices on the billing schedule
          example:
            - e007e884-5100-4183-8355-4771865cb4d7
          items:
            type: string
        separateLineItem:
          type: boolean
          description: >-
            Indicates whether the discount should appear as a separate line item
            in the invoice
          example: false
        amount:
          type: number
          description: Amount to be reduced
          example: 25
        discountCalculationType:
          $ref: '#/components/schemas/DiscountCalculationType'
          description: Indicates whether the discount amount is percentage or nominal
        message:
          type: string
          description: Message to appear on the Invoice
          example: Loyalty Discount
        validFrom:
          type: string
          description: First Day Discount is Valid
          format: date
          example: '2023-01-01'
        validTo:
          type: string
          description: Last Day Discount is Valid
          format: date
          example: '2023-01-31'
        createdAt:
          type: string
          description: Created at
          example: '2022-06-28T16:47:00Z'
        updatedAt:
          type: string
          description: Updated At
          example: '2022-06-28T16:47:00Z'
        seatDiscountType:
          $ref: '#/components/schemas/SeatDiscountType'
          description: Determines how the discount is applied to any seat-based prices
    DiscountCalculationType:
      type: string
      example: PERCENTAGE
      enum:
        - PERCENTAGE
        - NOMINAL
    SeatDiscountType:
      type: string
      example: ALL_SEATS
      enum:
        - INCLUDED_SEATS_ONLY
        - OVERAGE_SEATS_ONLY
        - ALL_SEATS

````