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

# Create Contract

> Create a new Contract.



## OpenAPI

````yaml post /contracts
openapi: 3.0.0
info:
  title: Vayu API
  version: 1.0.0
  description: >-
    The Vayu API is a RESTful API that allows you to submit events for
    processing and storage & manage billing related entities.
              The API is secured using the Bearer Authentication scheme with JWT tokens.
              To obtain a JWT token, please contact Vayu at team@withvayu.com
  contact:
    email: dev@withvayu.com
    name: Vayu, Inc
    url: https://withvayu.com
servers:
  - url: https://connect.withvayu.com
    description: Production server
  - url: https://staging-connect.withvayu.com
    description: Sandbox server
security: []
tags:
  - name: auth
    description: >-
      The auth tag is used for endpoints related to authentication and
      authorization.
  - name: events
    description: The events tag is used for endpoints related to event ingestion.
  - name: customers
    description: The customers tag is used for endpoints related to customer management.
  - name: meters
    description: The meters tag is used for endpoints related to meter management.
  - name: contracts
    description: The contracts tag is used for endpoints related to contract management.
  - name: invoices
    description: The invoices tag is used for endpoints related to invoice management.
  - name: credits
    description: The credits tag is used for endpoints related to credit management.
  - name: webhooks
    description: The webhooks tag is used for endpoints related to webhook management.
paths:
  /contracts:
    post:
      tags:
        - contracts
      summary: Create Contract
      description: Create a new Contract.
      operationId: createContract
      requestBody:
        $ref: '#/components/requestBodies/CreateContractRequest'
      responses:
        '200':
          $ref: '#/components/responses/CreateContractResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - BearerAuthorizer: []
components:
  requestBodies:
    CreateContractRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateContractRequest'
  responses:
    CreateContractResponse:
      description: RequestSuccess
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateContractResponse'
  schemas:
    ValidationErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
        code:
          type: string
          description: Specific machine-readable error code
        message:
          type: string
          description: Human-readable error explanation
        param:
          type: string
          description: Single parameter that failed validation
        params:
          type: array
          items:
            type: object
            properties:
              param:
                type: string
                description: The parameter that failed validation
              message:
                type: string
                description: Why validation failed for this parameter
            required:
              - param
              - message
          description: Multiple parameters that failed validation
      required:
        - type
        - code
        - message
    UnauthorizedErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - authentication_error
        code:
          type: string
          enum:
            - authentication_failed
        message:
          type: string
          description: Human-readable error explanation
      required:
        - type
        - code
        - message
    RateLimitErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - rate_limit_error
        code:
          type: string
          enum:
            - rate_limit_exceeded
        message:
          type: string
          description: Human-readable error explanation
      required:
        - type
        - code
        - message
    InternalServerErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - api_error
        code:
          type: string
          enum:
            - internal_error
        message:
          type: string
          description: Human-readable error explanation
      required:
        - type
        - code
        - message
    CreateContractRequest:
      type: object
      properties:
        startDate:
          type: string
          description: The start date of the contract
          format: date-time
        customerId:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: The id of the customer that the contract is associated with
        name:
          type: string
          description: The name of the contract
        salesForceOpportunityId:
          type: string
          nullable: true
          description: >-
            The id of the sales force opportunity that the contract is
            associated with
        endDate:
          type: string
          nullable: true
          description: The end date of the contract
          format: date-time
        signatureDate:
          type: string
          nullable: true
          description: The signature date of the contract
          format: date-time
        products:
          type: array
          items:
            type: object
            properties:
              displayName:
                type: string
                description: The display name of the product
              description:
                type: string
                nullable: true
                description: The description of the product
              scheduling:
                type: object
                properties:
                  billingDay:
                    type: integer
                    minimum: 1
                    maximum: 31
                    default: 1
                    description: The day of the month that the product is billed
                  duration:
                    type: object
                    properties:
                      unit:
                        type: string
                        enum:
                          - DAY
                          - WEEK
                          - MONTH
                          - YEAR
                        default: MONTH
                      value:
                        type: integer
                        minimum: 0
                        maximum: 1000
                    required:
                      - unit
                      - value
                    description: The duration of the product
                required:
                  - duration
                description: The scheduling of the product
              pricing:
                oneOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - ONE_TIME
                      price:
                        type: number
                        minimum: 0
                      discount:
                        type: object
                        nullable: true
                        properties:
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the discount. Will appear on the
                              invoice.
                          type:
                            type: string
                            enum:
                              - FIXED
                              - PERCENTAGE
                            description: >-
                              The type of discount — FIXED for a fixed amount,
                              PERCENTAGE for a percentage-based discount.
                          amount:
                            type: number
                            minimum: 0
                            description: >-
                              The discount amount. Interpreted as a currency
                              amount for FIXED or a percentage for PERCENTAGE.
                          recurring:
                            type: integer
                            minimum: 1
                            description: >-
                              The number of billing periods the discount applies
                              for. If not provided, the discount recurs
                              indefinitely.
                        required:
                          - name
                          - type
                          - amount
                        description: An optional discount to apply to this product
                      isCreditPurchase:
                        type: boolean
                        description: >-
                          Whether this one-time fee is a credit purchase. When
                          true, the product is treated as a prepaid credit that
                          the customer can use later. Defaults to false.
                    required:
                      - type
                      - price
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - CONTRACT_TERMS
                      price:
                        type: number
                        minimum: 0
                      installments:
                        type: array
                        nullable: true
                        items:
                          type: object
                          properties:
                            installmentDate:
                              type: string
                              format: date-time
                            amount:
                              type: number
                              minimum: 0
                          required:
                            - installmentDate
                            - amount
                      discount:
                        type: object
                        nullable: true
                        properties:
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the discount. Will appear on the
                              invoice.
                          type:
                            type: string
                            enum:
                              - FIXED
                              - PERCENTAGE
                            description: >-
                              The type of discount — FIXED for a fixed amount,
                              PERCENTAGE for a percentage-based discount.
                          amount:
                            type: number
                            minimum: 0
                            description: >-
                              The discount amount. Interpreted as a currency
                              amount for FIXED or a percentage for PERCENTAGE.
                          recurring:
                            type: integer
                            minimum: 1
                            description: >-
                              The number of billing periods the discount applies
                              for. If not provided, the discount recurs
                              indefinitely.
                        required:
                          - name
                          - type
                          - amount
                        description: An optional discount to apply to this product
                    required:
                      - type
                      - price
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - SUBSCRIPTION
                      price:
                        type: number
                        minimum: 0
                      subscriptionCadence:
                        type: object
                        properties:
                          unit:
                            type: string
                            enum:
                              - DAY
                              - WEEK
                              - MONTH
                              - YEAR
                            default: MONTH
                          value:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - unit
                          - value
                      discount:
                        type: object
                        nullable: true
                        properties:
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the discount. Will appear on the
                              invoice.
                          type:
                            type: string
                            enum:
                              - FIXED
                              - PERCENTAGE
                            description: >-
                              The type of discount — FIXED for a fixed amount,
                              PERCENTAGE for a percentage-based discount.
                          amount:
                            type: number
                            minimum: 0
                            description: >-
                              The discount amount. Interpreted as a currency
                              amount for FIXED or a percentage for PERCENTAGE.
                          recurring:
                            type: integer
                            minimum: 1
                            description: >-
                              The number of billing periods the discount applies
                              for. If not provided, the discount recurs
                              indefinitely.
                        required:
                          - name
                          - type
                          - amount
                        description: An optional discount to apply to this product
                    required:
                      - type
                      - price
                      - subscriptionCadence
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - TIERED
                      tiers:
                        type: array
                        items:
                          type: object
                          properties:
                            fromInclusive:
                              type: number
                              minimum: 0
                            toExclusive:
                              type: number
                              nullable: true
                              minimum: 0
                            rate:
                              type: number
                              nullable: true
                              minimum: 0
                            flatFee:
                              type: number
                              nullable: true
                              minimum: 0
                            packageSize:
                              type: number
                              nullable: true
                              minimum: 0
                          required:
                            - fromInclusive
                      subscriptionCadence:
                        type: object
                        nullable: true
                        properties:
                          unit:
                            type: string
                            enum:
                              - DAY
                              - WEEK
                              - MONTH
                              - YEAR
                            default: MONTH
                          value:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - unit
                          - value
                      autoUpgrade:
                        type: boolean
                        nullable: true
                      prorate:
                        type: boolean
                        nullable: true
                      isRevShare:
                        type: boolean
                        nullable: true
                      baseAmount:
                        type: number
                        nullable: true
                        minimum: 0
                      usageReset:
                        $ref: '#/components/schemas/ExternalUsageReset'
                    required:
                      - type
                      - tiers
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PER_UNIT
                      price:
                        type: number
                        minimum: 0
                      chunkSize:
                        type: number
                        nullable: true
                        minimum: 0
                        exclusiveMinimum: true
                      usageReset:
                        $ref: '#/components/schemas/ExternalUsageReset'
                      baseAmount:
                        type: number
                        nullable: true
                        minimum: 0
                    required:
                      - type
                      - price
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - FIXED_DEDUCTION
                      amountToDeduct:
                        type: number
                        minimum: 0
                        description: The fixed amount to deduct
                      installments:
                        type: integer
                        minimum: 0
                        description: >-
                          The number of installments to spread the deduction
                          over
                    required:
                      - type
                      - amountToDeduct
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PERCENTAGE_DEDUCTION
                      percentageToDeduct:
                        type: number
                        minimum: 0
                        description: The percentage to deduct
                      installments:
                        type: integer
                        minimum: 0
                        description: >-
                          The number of installments to spread the deduction
                          over
                    required:
                      - type
                      - percentageToDeduct
                description: The pricing of the product
              catalogProductId:
                type: string
                nullable: true
                description: >-
                  The id of the a product from the catalog to connect the
                  contract product to
              productErpId:
                type: string
                nullable: true
                description: The id of the product in NetSuite ERP
              nsClass:
                type: string
                nullable: true
                description: The class of the product in NetSuite ERP
              nsClassId:
                type: string
                nullable: true
                description: The id of the class of the product in NetSuite ERP
              commitment:
                type: object
                nullable: true
                properties:
                  units:
                    type: number
                    minimum: 0
                    description: Units to commit the customer for
                  price:
                    type: number
                    nullable: true
                    minimum: 0
                    description: Price to charge the customer for the committed units
                  type:
                    type: string
                    enum:
                      - PRICE
                      - UNITS
                    default: UNITS
                    description: >-
                      The type of commitment. UNITS means the commitment amount
                      is in units, PRICE means it is a monetary value. Defaults
                      to UNITS.
                  scheduling:
                    type: object
                    nullable: true
                    properties:
                      billingDay:
                        type: integer
                        minimum: 1
                        maximum: 31
                        default: 1
                        description: The day of the month for the commitment scheduling
                      duration:
                        type: object
                        properties:
                          unit:
                            type: string
                            enum:
                              - DAY
                              - WEEK
                              - MONTH
                              - YEAR
                            default: MONTH
                          value:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - unit
                          - value
                        description: >-
                          The duration of the commitment scheduling cycle. Unit
                          must be MONTH or YEAR.
                    required:
                      - duration
                    description: >-
                      Scheduling for recurring commitment. Duration unit must be
                      MONTH or YEAR.
                  overageStrategy:
                    $ref: '#/components/schemas/ExternalOverageStrategy'
                required:
                  - units
                description: The commitment of the product
              paymentTerm:
                $ref: '#/components/schemas/PaymentTerm'
              isCalendarAligned:
                type: boolean
                description: >-
                  Whether the invoicing period should be calendar aligned. If
                  not provided, it will default to false. ONE_TIME and
                  COMMERCIAL_TERMS pricing models cannot be calendar aligned.
                  This field is ignored if the product is part of a
                  ProductGroup.
              cloudProviderSettings:
                $ref: '#/components/schemas/ProductCloudProviderSettings'
            required:
              - displayName
              - scheduling
              - pricing
          description: The products that the contract is associated with
        productGroups:
          type: array
          items:
            $ref: '#/components/schemas/ProductGroup'
          description: >-
            Product groups are list of products that can be grouped as a single
            line item with shared settings like ERP settings, commitment
            settings, etc.
        accountManager:
          type: string
          nullable: true
          description: The name of the account manager of the contract
        shouldProRateInvoices:
          type: boolean
          description: >-
            Whether to pro rate the invoices for the contract. If not provided,
            it will default to false
          deprecated: true
        autoRenewContract:
          type: boolean
          description: >-
            Whether the contract is set to auto renew. If not provided, it will
            be treated as true
        customFields:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CustomField'
          description: Custom fields from CRM systems (Salesforce, HubSpot, etc.)
        customFieldValues:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CustomFieldValue'
          description: The stored custom field values associated with the contract
        status:
          $ref: '#/components/schemas/ContractStatus'
        purchaseOrder:
          type: string
          description: The purchase order number of the contract
        currency:
          allOf:
            - $ref: '#/components/schemas/Currency'
            - description: >-
                The currency of the contract. Overrides the customer-level
                currency for all invoices under this contract. If not provided,
                the customer currency or account default (USD) is used.
      required:
        - startDate
        - customerId
        - name
    CreateContractResponse:
      type: object
      properties:
        contract:
          type: object
          properties:
            startDate:
              type: string
              description: The start date of the contract
              format: date-time
            customerId:
              type: string
              pattern: ^[0-9a-fA-F]{24}$
              description: The id of the customer that the contract is associated with
            name:
              type: string
              description: The name of the contract
            salesForceOpportunityId:
              type: string
              nullable: true
              description: >-
                The id of the sales force opportunity that the contract is
                associated with
            endDate:
              type: string
              nullable: true
              description: The end date of the contract
              format: date-time
            signatureDate:
              type: string
              nullable: true
              description: The signature date of the contract
              format: date-time
            products:
              type: array
              items:
                type: object
                properties:
                  displayName:
                    type: string
                    description: The display name of the product
                  description:
                    type: string
                    nullable: true
                    description: The description of the product
                  scheduling:
                    type: object
                    properties:
                      billingDay:
                        type: integer
                        minimum: 1
                        maximum: 31
                        default: 1
                        description: The day of the month that the product is billed
                      duration:
                        type: object
                        properties:
                          unit:
                            type: string
                            enum:
                              - DAY
                              - WEEK
                              - MONTH
                              - YEAR
                            default: MONTH
                          value:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - unit
                          - value
                        description: The duration of the product
                    required:
                      - duration
                    description: The scheduling of the product
                  pricing:
                    oneOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - ONE_TIME
                          price:
                            type: number
                            minimum: 0
                          discount:
                            type: object
                            nullable: true
                            properties:
                              name:
                                type: string
                                minLength: 1
                                description: >-
                                  The name of the discount. Will appear on the
                                  invoice.
                              type:
                                type: string
                                enum:
                                  - FIXED
                                  - PERCENTAGE
                                description: >-
                                  The type of discount — FIXED for a fixed
                                  amount, PERCENTAGE for a percentage-based
                                  discount.
                              amount:
                                type: number
                                minimum: 0
                                description: >-
                                  The discount amount. Interpreted as a currency
                                  amount for FIXED or a percentage for
                                  PERCENTAGE.
                              recurring:
                                type: integer
                                minimum: 1
                                description: >-
                                  The number of billing periods the discount
                                  applies for. If not provided, the discount
                                  recurs indefinitely.
                            required:
                              - name
                              - type
                              - amount
                            description: An optional discount to apply to this product
                          isCreditPurchase:
                            type: boolean
                            description: >-
                              Whether this one-time fee is a credit purchase.
                              When true, the product is treated as a prepaid
                              credit that the customer can use later. Defaults
                              to false.
                        required:
                          - type
                          - price
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - CONTRACT_TERMS
                          price:
                            type: number
                            minimum: 0
                          installments:
                            type: array
                            nullable: true
                            items:
                              type: object
                              properties:
                                installmentDate:
                                  type: string
                                  format: date-time
                                amount:
                                  type: number
                                  minimum: 0
                              required:
                                - installmentDate
                                - amount
                          discount:
                            type: object
                            nullable: true
                            properties:
                              name:
                                type: string
                                minLength: 1
                                description: >-
                                  The name of the discount. Will appear on the
                                  invoice.
                              type:
                                type: string
                                enum:
                                  - FIXED
                                  - PERCENTAGE
                                description: >-
                                  The type of discount — FIXED for a fixed
                                  amount, PERCENTAGE for a percentage-based
                                  discount.
                              amount:
                                type: number
                                minimum: 0
                                description: >-
                                  The discount amount. Interpreted as a currency
                                  amount for FIXED or a percentage for
                                  PERCENTAGE.
                              recurring:
                                type: integer
                                minimum: 1
                                description: >-
                                  The number of billing periods the discount
                                  applies for. If not provided, the discount
                                  recurs indefinitely.
                            required:
                              - name
                              - type
                              - amount
                            description: An optional discount to apply to this product
                        required:
                          - type
                          - price
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - SUBSCRIPTION
                          price:
                            type: number
                            minimum: 0
                          subscriptionCadence:
                            type: object
                            properties:
                              unit:
                                type: string
                                enum:
                                  - DAY
                                  - WEEK
                                  - MONTH
                                  - YEAR
                                default: MONTH
                              value:
                                type: integer
                                minimum: 0
                                maximum: 1000
                            required:
                              - unit
                              - value
                          discount:
                            type: object
                            nullable: true
                            properties:
                              name:
                                type: string
                                minLength: 1
                                description: >-
                                  The name of the discount. Will appear on the
                                  invoice.
                              type:
                                type: string
                                enum:
                                  - FIXED
                                  - PERCENTAGE
                                description: >-
                                  The type of discount — FIXED for a fixed
                                  amount, PERCENTAGE for a percentage-based
                                  discount.
                              amount:
                                type: number
                                minimum: 0
                                description: >-
                                  The discount amount. Interpreted as a currency
                                  amount for FIXED or a percentage for
                                  PERCENTAGE.
                              recurring:
                                type: integer
                                minimum: 1
                                description: >-
                                  The number of billing periods the discount
                                  applies for. If not provided, the discount
                                  recurs indefinitely.
                            required:
                              - name
                              - type
                              - amount
                            description: An optional discount to apply to this product
                        required:
                          - type
                          - price
                          - subscriptionCadence
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - TIERED
                          tiers:
                            type: array
                            items:
                              type: object
                              properties:
                                fromInclusive:
                                  type: number
                                  minimum: 0
                                toExclusive:
                                  type: number
                                  nullable: true
                                  minimum: 0
                                rate:
                                  type: number
                                  nullable: true
                                  minimum: 0
                                flatFee:
                                  type: number
                                  nullable: true
                                  minimum: 0
                                packageSize:
                                  type: number
                                  nullable: true
                                  minimum: 0
                              required:
                                - fromInclusive
                          subscriptionCadence:
                            type: object
                            nullable: true
                            properties:
                              unit:
                                type: string
                                enum:
                                  - DAY
                                  - WEEK
                                  - MONTH
                                  - YEAR
                                default: MONTH
                              value:
                                type: integer
                                minimum: 0
                                maximum: 1000
                            required:
                              - unit
                              - value
                          autoUpgrade:
                            type: boolean
                            nullable: true
                          prorate:
                            type: boolean
                            nullable: true
                          isRevShare:
                            type: boolean
                            nullable: true
                          baseAmount:
                            type: number
                            nullable: true
                            minimum: 0
                          usageReset:
                            $ref: '#/components/schemas/ExternalUsageReset'
                        required:
                          - type
                          - tiers
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - PER_UNIT
                          price:
                            type: number
                            minimum: 0
                          chunkSize:
                            type: number
                            nullable: true
                            minimum: 0
                            exclusiveMinimum: true
                          usageReset:
                            $ref: '#/components/schemas/ExternalUsageReset'
                          baseAmount:
                            type: number
                            nullable: true
                            minimum: 0
                        required:
                          - type
                          - price
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - FIXED_DEDUCTION
                          amountToDeduct:
                            type: number
                            minimum: 0
                            description: The fixed amount to deduct
                          installments:
                            type: integer
                            minimum: 0
                            description: >-
                              The number of installments to spread the deduction
                              over
                        required:
                          - type
                          - amountToDeduct
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - PERCENTAGE_DEDUCTION
                          percentageToDeduct:
                            type: number
                            minimum: 0
                            description: The percentage to deduct
                          installments:
                            type: integer
                            minimum: 0
                            description: >-
                              The number of installments to spread the deduction
                              over
                        required:
                          - type
                          - percentageToDeduct
                    description: The pricing of the product
                  catalogProductId:
                    type: string
                    nullable: true
                    description: >-
                      The id of the a product from the catalog to connect the
                      contract product to
                  productErpId:
                    type: string
                    nullable: true
                    description: The id of the product in NetSuite ERP
                  nsClass:
                    type: string
                    nullable: true
                    description: The class of the product in NetSuite ERP
                  nsClassId:
                    type: string
                    nullable: true
                    description: The id of the class of the product in NetSuite ERP
                  commitment:
                    type: object
                    nullable: true
                    properties:
                      units:
                        type: number
                        minimum: 0
                        description: Units to commit the customer for
                      price:
                        type: number
                        nullable: true
                        minimum: 0
                        description: Price to charge the customer for the committed units
                      type:
                        type: string
                        enum:
                          - PRICE
                          - UNITS
                        default: UNITS
                        description: >-
                          The type of commitment. UNITS means the commitment
                          amount is in units, PRICE means it is a monetary
                          value. Defaults to UNITS.
                      scheduling:
                        type: object
                        nullable: true
                        properties:
                          billingDay:
                            type: integer
                            minimum: 1
                            maximum: 31
                            default: 1
                            description: The day of the month for the commitment scheduling
                          duration:
                            type: object
                            properties:
                              unit:
                                type: string
                                enum:
                                  - DAY
                                  - WEEK
                                  - MONTH
                                  - YEAR
                                default: MONTH
                              value:
                                type: integer
                                minimum: 0
                                maximum: 1000
                            required:
                              - unit
                              - value
                            description: >-
                              The duration of the commitment scheduling cycle.
                              Unit must be MONTH or YEAR.
                        required:
                          - duration
                        description: >-
                          Scheduling for recurring commitment. Duration unit
                          must be MONTH or YEAR.
                      overageStrategy:
                        $ref: '#/components/schemas/ExternalOverageStrategy'
                    required:
                      - units
                    description: The commitment of the product
                  paymentTerm:
                    $ref: '#/components/schemas/PaymentTerm'
                  isCalendarAligned:
                    type: boolean
                    description: >-
                      Whether the invoicing period should be calendar aligned.
                      If not provided, it will default to false. ONE_TIME and
                      COMMERCIAL_TERMS pricing models cannot be calendar
                      aligned. This field is ignored if the product is part of a
                      ProductGroup.
                  cloudProviderSettings:
                    $ref: '#/components/schemas/ProductCloudProviderSettings'
                required:
                  - displayName
                  - scheduling
                  - pricing
              description: The products that the contract is associated with
            productGroups:
              type: array
              items:
                $ref: '#/components/schemas/ProductGroup'
              description: >-
                Product groups are list of products that can be grouped as a
                single line item with shared settings like ERP settings,
                commitment settings, etc.
            accountManager:
              type: string
              nullable: true
              description: The name of the account manager of the contract
            shouldProRateInvoices:
              type: boolean
              description: >-
                Whether to pro rate the invoices for the contract. If not
                provided, it will default to false
              deprecated: true
            autoRenewContract:
              type: boolean
              description: >-
                Whether the contract is set to auto renew. If not provided, it
                will be treated as true
            customFields:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/CustomField'
              description: Custom fields from CRM systems (Salesforce, HubSpot, etc.)
            customFieldValues:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/CustomFieldValue'
              description: The stored custom field values associated with the contract
            status:
              $ref: '#/components/schemas/ContractStatus'
            purchaseOrder:
              type: string
              description: The purchase order number of the contract
            currency:
              allOf:
                - $ref: '#/components/schemas/Currency'
                - description: >-
                    The currency of the contract. Overrides the customer-level
                    currency for all invoices under this contract. If not
                    provided, the customer currency or account default (USD) is
                    used.
            id:
              type: string
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
          required:
            - startDate
            - customerId
            - name
            - id
            - createdAt
            - updatedAt
      required:
        - contract
    ExternalUsageReset:
      type: integer
      nullable: true
      description: 'Usage reset is represented in months and must be one of: 1, 2, 3, 6, 12'
    ExternalOverageStrategy:
      type: string
      nullable: true
      enum:
        - IGNORE
        - BLOCK
        - UPGRADE_PLAN
        - TOP_UP
      default: IGNORE
      description: The strategy to apply when the overage occurs
    PaymentTerm:
      type: string
      nullable: true
      enum:
        - Prepayment
        - Postpayment
      description: >-
        The payment term of the product. Can be prepayment or postpayment. If
        not provided, the payment term will be determined by the pricing model.
    ProductCloudProviderSettings:
      type: object
      nullable: true
      properties:
        cloudProvider:
          type: string
          enum:
            - AWS
        cloudProviderMarketplaceId:
          type: string
        dimension:
          type: string
      description: Cloud provider settings for the product
    ProductGroup:
      type: object
      properties:
        displayName:
          type: string
          description: The display name of the product
        description:
          type: string
          nullable: true
          description: The description of the product
        productErpId:
          type: string
          nullable: true
          description: The id of the product in NetSuite ERP
        nsClass:
          type: string
          nullable: true
          description: The class of the product in NetSuite ERP
        nsClassId:
          type: string
          nullable: true
          description: The id of the class of the product in NetSuite ERP
        products:
          type: array
          items:
            type: object
            properties:
              displayName:
                type: string
                description: The display name of the product
              description:
                type: string
                nullable: true
                description: The description of the product
              scheduling:
                type: object
                properties:
                  billingDay:
                    type: integer
                    minimum: 1
                    maximum: 31
                    default: 1
                    description: The day of the month that the product is billed
                  duration:
                    type: object
                    properties:
                      unit:
                        type: string
                        enum:
                          - DAY
                          - WEEK
                          - MONTH
                          - YEAR
                        default: MONTH
                      value:
                        type: integer
                        minimum: 0
                        maximum: 1000
                    required:
                      - unit
                      - value
                    description: The duration of the product
                required:
                  - duration
                description: The scheduling of the product
              pricing:
                oneOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - ONE_TIME
                      price:
                        type: number
                        minimum: 0
                      discount:
                        type: object
                        nullable: true
                        properties:
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the discount. Will appear on the
                              invoice.
                          type:
                            type: string
                            enum:
                              - FIXED
                              - PERCENTAGE
                            description: >-
                              The type of discount — FIXED for a fixed amount,
                              PERCENTAGE for a percentage-based discount.
                          amount:
                            type: number
                            minimum: 0
                            description: >-
                              The discount amount. Interpreted as a currency
                              amount for FIXED or a percentage for PERCENTAGE.
                          recurring:
                            type: integer
                            minimum: 1
                            description: >-
                              The number of billing periods the discount applies
                              for. If not provided, the discount recurs
                              indefinitely.
                        required:
                          - name
                          - type
                          - amount
                        description: An optional discount to apply to this product
                      isCreditPurchase:
                        type: boolean
                        description: >-
                          Whether this one-time fee is a credit purchase. When
                          true, the product is treated as a prepaid credit that
                          the customer can use later. Defaults to false.
                    required:
                      - type
                      - price
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - CONTRACT_TERMS
                      price:
                        type: number
                        minimum: 0
                      installments:
                        type: array
                        nullable: true
                        items:
                          type: object
                          properties:
                            installmentDate:
                              type: string
                              format: date-time
                            amount:
                              type: number
                              minimum: 0
                          required:
                            - installmentDate
                            - amount
                      discount:
                        type: object
                        nullable: true
                        properties:
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the discount. Will appear on the
                              invoice.
                          type:
                            type: string
                            enum:
                              - FIXED
                              - PERCENTAGE
                            description: >-
                              The type of discount — FIXED for a fixed amount,
                              PERCENTAGE for a percentage-based discount.
                          amount:
                            type: number
                            minimum: 0
                            description: >-
                              The discount amount. Interpreted as a currency
                              amount for FIXED or a percentage for PERCENTAGE.
                          recurring:
                            type: integer
                            minimum: 1
                            description: >-
                              The number of billing periods the discount applies
                              for. If not provided, the discount recurs
                              indefinitely.
                        required:
                          - name
                          - type
                          - amount
                        description: An optional discount to apply to this product
                    required:
                      - type
                      - price
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - SUBSCRIPTION
                      price:
                        type: number
                        minimum: 0
                      subscriptionCadence:
                        type: object
                        properties:
                          unit:
                            type: string
                            enum:
                              - DAY
                              - WEEK
                              - MONTH
                              - YEAR
                            default: MONTH
                          value:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - unit
                          - value
                      discount:
                        type: object
                        nullable: true
                        properties:
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the discount. Will appear on the
                              invoice.
                          type:
                            type: string
                            enum:
                              - FIXED
                              - PERCENTAGE
                            description: >-
                              The type of discount — FIXED for a fixed amount,
                              PERCENTAGE for a percentage-based discount.
                          amount:
                            type: number
                            minimum: 0
                            description: >-
                              The discount amount. Interpreted as a currency
                              amount for FIXED or a percentage for PERCENTAGE.
                          recurring:
                            type: integer
                            minimum: 1
                            description: >-
                              The number of billing periods the discount applies
                              for. If not provided, the discount recurs
                              indefinitely.
                        required:
                          - name
                          - type
                          - amount
                        description: An optional discount to apply to this product
                    required:
                      - type
                      - price
                      - subscriptionCadence
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - TIERED
                      tiers:
                        type: array
                        items:
                          type: object
                          properties:
                            fromInclusive:
                              type: number
                              minimum: 0
                            toExclusive:
                              type: number
                              nullable: true
                              minimum: 0
                            rate:
                              type: number
                              nullable: true
                              minimum: 0
                            flatFee:
                              type: number
                              nullable: true
                              minimum: 0
                            packageSize:
                              type: number
                              nullable: true
                              minimum: 0
                          required:
                            - fromInclusive
                      subscriptionCadence:
                        type: object
                        nullable: true
                        properties:
                          unit:
                            type: string
                            enum:
                              - DAY
                              - WEEK
                              - MONTH
                              - YEAR
                            default: MONTH
                          value:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - unit
                          - value
                      autoUpgrade:
                        type: boolean
                        nullable: true
                      prorate:
                        type: boolean
                        nullable: true
                      isRevShare:
                        type: boolean
                        nullable: true
                      baseAmount:
                        type: number
                        nullable: true
                        minimum: 0
                      usageReset:
                        $ref: '#/components/schemas/ExternalUsageReset'
                    required:
                      - type
                      - tiers
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PER_UNIT
                      price:
                        type: number
                        minimum: 0
                      chunkSize:
                        type: number
                        nullable: true
                        minimum: 0
                        exclusiveMinimum: true
                      usageReset:
                        $ref: '#/components/schemas/ExternalUsageReset'
                      baseAmount:
                        type: number
                        nullable: true
                        minimum: 0
                    required:
                      - type
                      - price
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - FIXED_DEDUCTION
                      amountToDeduct:
                        type: number
                        minimum: 0
                        description: The fixed amount to deduct
                      installments:
                        type: integer
                        minimum: 0
                        description: >-
                          The number of installments to spread the deduction
                          over
                    required:
                      - type
                      - amountToDeduct
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - PERCENTAGE_DEDUCTION
                      percentageToDeduct:
                        type: number
                        minimum: 0
                        description: The percentage to deduct
                      installments:
                        type: integer
                        minimum: 0
                        description: >-
                          The number of installments to spread the deduction
                          over
                    required:
                      - type
                      - percentageToDeduct
                description: The pricing of the product
              catalogProductId:
                type: string
                nullable: true
                description: >-
                  The id of the a product from the catalog to connect the
                  contract product to
              productErpId:
                type: string
                nullable: true
                description: The id of the product in NetSuite ERP
              nsClass:
                type: string
                nullable: true
                description: The class of the product in NetSuite ERP
              nsClassId:
                type: string
                nullable: true
                description: The id of the class of the product in NetSuite ERP
              commitment:
                type: object
                nullable: true
                properties:
                  units:
                    type: number
                    minimum: 0
                    description: Units to commit the customer for
                  price:
                    type: number
                    nullable: true
                    minimum: 0
                    description: Price to charge the customer for the committed units
                  type:
                    type: string
                    enum:
                      - PRICE
                      - UNITS
                    default: UNITS
                    description: >-
                      The type of commitment. UNITS means the commitment amount
                      is in units, PRICE means it is a monetary value. Defaults
                      to UNITS.
                  scheduling:
                    type: object
                    nullable: true
                    properties:
                      billingDay:
                        type: integer
                        minimum: 1
                        maximum: 31
                        default: 1
                        description: The day of the month for the commitment scheduling
                      duration:
                        type: object
                        properties:
                          unit:
                            type: string
                            enum:
                              - DAY
                              - WEEK
                              - MONTH
                              - YEAR
                            default: MONTH
                          value:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - unit
                          - value
                        description: >-
                          The duration of the commitment scheduling cycle. Unit
                          must be MONTH or YEAR.
                    required:
                      - duration
                    description: >-
                      Scheduling for recurring commitment. Duration unit must be
                      MONTH or YEAR.
                  overageStrategy:
                    $ref: '#/components/schemas/ExternalOverageStrategy'
                required:
                  - units
                description: The commitment of the product
              paymentTerm:
                $ref: '#/components/schemas/PaymentTerm'
              isCalendarAligned:
                type: boolean
                description: >-
                  Whether the invoicing period should be calendar aligned. If
                  not provided, it will default to false. ONE_TIME and
                  COMMERCIAL_TERMS pricing models cannot be calendar aligned.
                  This field is ignored if the product is part of a
                  ProductGroup.
              cloudProviderSettings:
                $ref: '#/components/schemas/ProductCloudProviderSettings'
            required:
              - displayName
              - scheduling
              - pricing
          minItems: 1
          description: The products that the product group is associated with
        baseAmount:
          type: number
          nullable: true
          description: >-
            The base amount for the customer to pay even if the amount based on
            usage is lower
        commitment:
          type: object
          nullable: true
          properties:
            units:
              type: number
              minimum: 0
              description: Units to commit the customer for
            price:
              type: number
              nullable: true
              minimum: 0
              description: Price to charge the customer for the committed units
            type:
              type: string
              enum:
                - PRICE
                - UNITS
              default: UNITS
              description: >-
                The type of commitment. UNITS means the commitment amount is in
                units, PRICE means it is a monetary value. Defaults to UNITS.
            scheduling:
              type: object
              nullable: true
              properties:
                billingDay:
                  type: integer
                  minimum: 1
                  maximum: 31
                  default: 1
                  description: The day of the month for the commitment scheduling
                duration:
                  type: object
                  properties:
                    unit:
                      type: string
                      enum:
                        - DAY
                        - WEEK
                        - MONTH
                        - YEAR
                      default: MONTH
                    value:
                      type: integer
                      minimum: 0
                      maximum: 1000
                  required:
                    - unit
                    - value
                  description: >-
                    The duration of the commitment scheduling cycle. Unit must
                    be MONTH or YEAR.
              required:
                - duration
              description: >-
                Scheduling for recurring commitment. Duration unit must be MONTH
                or YEAR.
            overageStrategy:
              $ref: '#/components/schemas/ExternalOverageStrategy'
          required:
            - units
          description: >-
            The commitment of the product group. units are aggregated for all
            products in the group
        isCalendarAligned:
          type: boolean
          description: >-
            Whether the invoicing period should be calendar aligned. If not
            provided, it will default to false. ONE_TIME and COMMERCIAL_TERMS
            pricing models cannot be calendar aligned.
      required:
        - displayName
        - products
    CustomField:
      type: object
      properties:
        integrationSource:
          type: string
          enum:
            - NetSuite
            - QuickBooks
            - Stripe
            - Salesforce
            - Hubspot
            - Vayu
            - Slack
            - S3
            - Morning
            - Snowflake
            - Anrok
            - Connact
            - Xero
          description: The integration provider (e.g., "Salesforce", "HubSpot")
        integrationEntityType:
          $ref: '#/components/schemas/IntegrationEntityTypes'
        fieldPath:
          type: string
          description: The path to the field in the integration (e.g., "root.path.field")
        vayuCustomFieldName:
          type: string
          description: The name of the field in Vayu (e.g., "AE Name")
        valueType:
          $ref: '#/components/schemas/CustomFieldValueTypes'
        value:
          nullable: true
          description: The actual value of the custom field
      required:
        - vayuCustomFieldName
        - valueType
    CustomFieldValue:
      type: object
      properties:
        customFieldDefinitionId:
          type: string
        value:
          type: string
        fieldName:
          type: string
      required:
        - customFieldDefinitionId
    ContractStatus:
      type: string
      enum:
        - InReview
        - Active
        - Inactive
        - Expired
        - Terminated
        - PendingTermination
        - Error
      description: The status of the contract
    Currency:
      type: string
      nullable: true
      enum:
        - USD
        - EUR
        - GBP
        - ILS
        - CAD
        - AUD
        - COP
        - BRL
      description: The billing currency of the customer
    IntegrationEntityTypes:
      type: string
      enum:
        - Account
        - Invoice
        - SalesOrder
        - Item
        - Deal
        - Company
        - Opportunity
      description: The entity type in the integration (e.g., "Opportunity", "Deal")
    CustomFieldValueTypes:
      type: string
      enum:
        - String
        - Number
        - Boolean
      description: 'The type of the value: "String", "Number", or "Boolean"'
  securitySchemes:
    BearerAuthorizer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````