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

# Create contract recurring discount

> Creates a recurring discount schedule for a contract. The discount is applied to each billing cycle within the date window.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/contracts/{id}/recurring-discounts
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/contracts/{id}/recurring-discounts:
    post:
      tags:
        - Contracts
      summary: Create contract recurring discount
      description: >-
        Creates a recurring discount schedule for a contract. The discount is
        applied to each billing cycle within the date window.
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: id
          required: true
          description: Unique identifier for the contract.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                planId:
                  type: string
                  format: uuid
                  nullable: true
                  description: >-
                    Optional plan to scope the discount to. Required when
                    targetScope is "plan".
                method:
                  type: string
                  enum:
                    - fixed
                    - percentage
                  description: >-
                    Discount method: "fixed" (amount in cents) or "percentage"
                    (basis points).
                amount:
                  type: number
                  multipleOf: 1
                  minimum: 1
                  description: >-
                    Amount in cents when method is "fixed", or basis points
                    (1-10000, where 10000 = 100%) when method is "percentage".
                description:
                  type: string
                  minLength: 1
                  description: Display text of the discount as it appears on invoices.
                startDate:
                  type: string
                  format: date
                  description: >-
                    First billing-cycle start date the discount applies to. Must
                    match a valid cycle date of the contract.
                endDate:
                  type: string
                  format: date
                  nullable: true
                  description: >-
                    Optional last cycle date the discount applies to. Null means
                    the discount has no end.
                distributionMode:
                  type: string
                  enum:
                    - proportional
                    - full
                  default: proportional
                  description: >-
                    For split invoices: "proportional" divides a fixed discount
                    across invoices; "full" applies it in full to each.
                targetScope:
                  type: string
                  enum:
                    - invoice
                    - plan
                    - contract_minimum_amount
                  description: >-
                    Where the discount applies: "invoice", "plan", or
                    "contract_minimum_amount".
              required:
                - method
                - amount
                - description
                - startDate
                - targetScope
              additionalProperties: false
              allOf:
                - if:
                    properties:
                      method:
                        enum:
                          - percentage
                  then:
                    properties:
                      amount:
                        maximum: 10000
        required: true
      responses:
        '201':
          description: >-
            Schema representing a recurring discount configured on a contract.
            On every billing cycle within its validity window, the discount is
            applied to the generated invoices as an invoice discount, as long as
            it is active (see isActive).
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: >-
                      The unique identifier of the recurring discount in our
                      system.
                  planId:
                    type: string
                    format: uuid
                    nullable: true
                    description: >-
                      The unique identifier of the plan targeted by the
                      discount, for plan and metric target scopes. Null for
                      invoice and contract_minimum_amount scopes.
                  targetScope:
                    type: string
                    enum:
                      - invoice
                      - plan
                      - metric
                      - contract_minimum_amount
                    description: >-
                      What the discount applies to on each generated invoice:
                      invoice (the whole invoice), plan (the line item group of
                      the targeted plan), metric (the line item of the targeted
                      usage charge), or contract_minimum_amount (the contract
                      minimum commitment line item).
                  method:
                    type: string
                    enum:
                      - fixed
                      - percentage
                    description: >-
                      How amount is interpreted: fixed subtracts a monetary
                      amount; percentage subtracts a percentage of the targeted
                      amount.
                  amount:
                    type: number
                    multipleOf: 1
                    minimum: 1
                    description: >-
                      Value of the discount, as a positive integer: whole cents
                      when method is fixed; basis points when method is
                      percentage (1 basis point = 0.01%; maximum 10000 = 100%).
                  description:
                    type: string
                    minLength: 1
                    description: Display text of the discount as it appears on invoices.
                  startDate:
                    type: string
                    format: date
                    description: First billing cycle date the discount applies to.
                  endDate:
                    type: string
                    format: date
                    nullable: true
                    description: >-
                      Last billing cycle date the discount applies to. Null when
                      the discount has no end date.
                  distributionMode:
                    type: string
                    enum:
                      - proportional
                      - full
                    description: >-
                      For fixed discounts on contracts that split invoices
                      across payment accounts: full applies the whole amount on
                      each invoice of the cycle; proportional splits the amount
                      across the cycle's invoices in proportion to their totals.
                      Percentage discounts always apply per invoice.
                  isActive:
                    type: boolean
                    description: >-
                      Whether the discount is applied to new billing cycles.
                      Inactive discounts are kept for history but no longer
                      applied.
                required:
                  - id
                  - planId
                  - targetScope
                  - method
                  - amount
                  - description
                  - startDate
                  - endDate
                  - distributionMode
                  - isActive
                additionalProperties: false
        '400':
          description: Error object returned to the client.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A human-readable description of the error
                  code:
                    type: string
                    description: A unique identifier for the type of error
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      Additional context about the error, such as invalid fields
                      or constraints. Each endpoint may include specific error
                      details in their documentation
                  causations:
                    type: array
                    description: >-
                      Optional array of error objects following the same
                      structure as the parent error. Only present when there's a
                      meaningful chain of related errors to expose
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: >-
                            A human-readable description of the underlying error
                            cause
                        code:
                          type: string
                          description: A unique identifier for the type of underlying error
                        details:
                          type: object
                          additionalProperties: true
                          description: Additional context about the underlying error
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - code
                  - message
                additionalProperties: false
        '404':
          description: Error object returned to the client when a resource is not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A human-readable description of the error
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````