> ## 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.

# Get contract by integration id

> Use this endpoint to get a specific contract using its integration provider and identifier.



## OpenAPI

````yaml get /contracts/integration/{integrationType}/{integrationId}
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/integration/{integrationType}/{integrationId}:
    get:
      tags:
        - contracts
      summary: Get contract by integration id
      description: >-
        Use this endpoint to get a specific contract using its integration
        provider and identifier.
      operationId: getContractByIntegrationId
      parameters:
        - schema:
            $ref: '#/components/schemas/IntegrationProviders'
          required: true
          in: path
          name: integrationType
        - schema:
            $ref: '#/components/schemas/IntegrationId'
          required: true
          in: path
          name: integrationId
      responses:
        '200':
          $ref: '#/components/responses/GetContractByIntegrationIdResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponse'
        '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:
  schemas:
    IntegrationProviders:
      type: string
      enum:
        - Hubspot
        - Stripe
        - NetSuite
        - Salesforce
        - QuickBooks
        - Slack
        - S3
        - Vayu
        - Morning
        - Anrok
        - Snowflake
        - Connact
        - Xero
        - Paddle
    IntegrationId:
      type: string
    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
        requiredScope:
          type: string
          description: Scope the token was missing, present on insufficient_scope errors
        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
        requiredScope:
          type: string
          description: Scope the token was missing, present on insufficient_scope errors
      required:
        - type
        - code
        - message
    NotFoundErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
        code:
          type: string
          enum:
            - resource_not_found
        message:
          type: string
          description: Human-readable error explanation
        requiredScope:
          type: string
          description: Scope the token was missing, present on insufficient_scope errors
      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
        requiredScope:
          type: string
          description: Scope the token was missing, present on insufficient_scope errors
      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
        requiredScope:
          type: string
          description: Scope the token was missing, present on insufficient_scope errors
      required:
        - type
        - code
        - message
    GetContractByIntegrationIdResponse:
      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
            planId:
              type: string
              pattern: ^[0-9a-fA-F]{24}$
              description: >-
                The id of an existing plan to attach to this contract. When
                provided, products/productGroups are ignored and the plan is
                used as-is. Mutually exclusive with inline product definition.
            name:
              type: string
              description: The name of the contract. Required when planId is not provided.
            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
                  disableDescription:
                    type: boolean
                    nullable: true
                    description: >-
                      Whether to disable the default description on generated
                      line items
                  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: >-
                              Deprecated. Legacy prepaid-credit marker: sets a
                              fixed Credit product type and prepayment, but does
                              NOT fund a credit pool. For the credit pool
                              system, use the contract-level creditGrants field
                              instead. Defaults to false.
                            deprecated: true
                          issuedSeparately:
                            type: boolean
                            description: >-
                              When true, this product is billed on its own
                              invoice instead of being combined with other
                              products in the same contract. Defaults to false.
                        required:
                          - type
                          - price
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - CONTRACT_TERMS
                          price:
                            type: number
                            minimum: 0
                          quantity:
                            type: integer
                            minimum: 0
                            description: >-
                              The number of units this term is charged for. When
                              set, `price` is the rate per unit and the term is
                              worth price x quantity. Leave unset for a flat
                              fee.
                          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
                          issuedSeparately:
                            type: boolean
                            description: >-
                              When true, this product is billed on its own
                              invoice instead of being combined with other
                              products in the same contract. Defaults to false.
                          seats:
                            type: integer
                            minimum: 0
                            description: The number of seats for this subscription 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
                  externalIntegrations:
                    type: array
                    nullable: true
                    items:
                      $ref: '#/components/schemas/ProductExternalIntegration'
                    description: >-
                      Links the product to matching products in V3 integrations
                      (e.g. Paddle). For each entry, the product is linked to
                      that external integration after the contract is created,
                      so invoices for this product are exported to it. At most
                      one entry per provider. Currently only Paddle is
                      supported.
                  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'
                  consumesCreditProductIds:
                    type: array
                    nullable: true
                    items:
                      type: string
                      pattern: ^[0-9a-fA-F]{24}$
                    description: >-
                      IDs of credit products whose pools are drawn down when
                      this usage product is invoiced. Each ID matches the
                      creditProductId of a credit grant on the same contract
                      that funds the pool. Pools are drawn in the order listed.
                      If omitted, no credits are applied and the product is
                      billed at full price. Not supported inside productGroups.
                required:
                  - displayName
                  - scheduling
                  - pricing
              description: The products that the contract is associated with
            creditGrants:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/ExternalCreditGrant'
              description: >-
                Credit grants that fund credit pools for the customer under this
                contract. Each grant credits a pool identified by its
                creditProductId; usage products draw down those pools via
                consumesCreditProductIds.
            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.
            isTrial:
              type: boolean
              description: >-
                Whether the contract is a trial. All invoices under a trial
                contract are flagged with isTrial: true. If not provided, it
                defaults to false.
            externalId:
              type: string
              nullable: true
              description: >-
                A caller-owned external id for the contract. Once set, the
                contract can be fetched or deleted by passing this value in
                place of the Vayu id on the /contracts/{contractId} endpoints.
            id:
              type: string
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
          required:
            - startDate
            - customerId
            - id
            - createdAt
            - updatedAt
    ExternalUsageReset:
      type: integer
      nullable: true
      description: 'Usage reset is represented in months and must be one of: 1, 2, 3, 6, 12'
    ProductExternalIntegration:
      type: object
      properties:
        provider:
          type: string
          enum:
            - Paddle
          description: >-
            The V3 integration provider to link the product to. Currently only
            Paddle is supported.
        externalId:
          type: string
          description: >-
            The id of the matching product in the external integration (e.g. the
            Paddle product id). The product must already exist in the connected
            integration; it is fetched and linked when the contract is created
            so that invoices for this product are exported to that integration.
      required:
        - provider
        - externalId
    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
            - GCP
            - Azure
        cloudProviderMarketplaceId:
          type: string
        dimension:
          type: string
      description: Cloud provider settings for the product
    ExternalCreditGrant:
      type: object
      properties:
        name:
          type: string
          description: >-
            Name of the credit grant. Used as the invoice line-item label when
            the grant is charged.
        creditProductId:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: >-
            ID of the credit product whose pool this grant funds. A usage
            product debits the same pool by listing this ID in
            consumesCreditProductIds. Discover IDs via GET /credit-products.
        balanceKind:
          type: string
          enum:
            - MONETARY
            - UNIT
          description: >-
            What grantAmount represents: a monetary value in the contract
            currency (MONETARY) or a quantity of units (UNIT).
        grantAmount:
          type: number
          minimum: 0
          description: >-
            Amount granted into the pool per grant period — a currency amount
            when balanceKind is MONETARY (e.g. 500 = $500), or a unit quantity
            when balanceKind is UNIT.
        price:
          type: number
          nullable: true
          minimum: 0
          description: >-
            Amount charged to the customer for this grant, in the contract
            currency. Required when balanceKind is UNIT (a unit quantity has no
            currency value of its own) — e.g. grant 1000 units for a price of 20
            ($20). Optional when balanceKind is MONETARY: if omitted, the grant
            is sold at face value (price equals grantAmount).
        schedule:
          type: string
          enum:
            - ONE_TIME
            - RECURRING_MONTHLY
            - RECURRING_QUARTERLY
            - RECURRING_YEARLY
          description: >-
            How often the grant is applied: ONE_TIME grants once at contract
            start; RECURRING_MONTHLY, RECURRING_QUARTERLY and RECURRING_YEARLY
            re-grant each corresponding period.
        expirationDate:
          type: string
          nullable: true
          description: >-
            Explicit date after which unused granted credits expire. Only
            supported on ONE_TIME grants. For policy-based expiry on recurring
            grants, use expirationPolicy instead.
          format: date-time
        expirationPolicy:
          type: string
          enum:
            - AT_NEXT_GRANT
            - NEVER
            - END_OF_INVOICE
            - END_OF_RENEWAL_PERIOD
            - END_OF_CONTRACT
          description: >-
            Controls when unused credits from a grant period expire.
            AT_NEXT_GRANT: credits expire at the end of each billing period
            (default for recurring). NEVER: credits never expire (default for
            ONE_TIME). END_OF_INVOICE: credits expire at the end of the invoice
            period. END_OF_RENEWAL_PERIOD: credits expire at the end of the
            contract renewal period. END_OF_CONTRACT: credits expire when the
            contract ends. AT_NEXT_GRANT and END_OF_INVOICE are not available
            for ONE_TIME grants.
        applyAutomatically:
          type: boolean
          description: >-
            Whether granted credits are applied to usage automatically. Defaults
            to true.
        externalIntegrations:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ProductExternalIntegration'
          description: >-
            Links the subscription created for a recurring credit grant to
            matching products in V3 integrations (e.g. Paddle). The grant's
            inferred product is linked to each external integration after the
            contract is created, so invoices for the grant are exported to it.
            At most one entry per provider. Applies only to credit grants on a
            contract — ignored on credit top-ups. Currently only Paddle is
            supported.
      required:
        - name
        - creditProductId
        - balanceKind
        - grantAmount
        - schedule
    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
              disableDescription:
                type: boolean
                nullable: true
                description: >-
                  Whether to disable the default description on generated line
                  items
              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: >-
                          Deprecated. Legacy prepaid-credit marker: sets a fixed
                          Credit product type and prepayment, but does NOT fund
                          a credit pool. For the credit pool system, use the
                          contract-level creditGrants field instead. Defaults to
                          false.
                        deprecated: true
                      issuedSeparately:
                        type: boolean
                        description: >-
                          When true, this product is billed on its own invoice
                          instead of being combined with other products in the
                          same contract. Defaults to false.
                    required:
                      - type
                      - price
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - CONTRACT_TERMS
                      price:
                        type: number
                        minimum: 0
                      quantity:
                        type: integer
                        minimum: 0
                        description: >-
                          The number of units this term is charged for. When
                          set, `price` is the rate per unit and the term is
                          worth price x quantity. Leave unset for a flat fee.
                      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
                      issuedSeparately:
                        type: boolean
                        description: >-
                          When true, this product is billed on its own invoice
                          instead of being combined with other products in the
                          same contract. Defaults to false.
                      seats:
                        type: integer
                        minimum: 0
                        description: The number of seats for this subscription 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
              externalIntegrations:
                type: array
                nullable: true
                items:
                  $ref: '#/components/schemas/ProductExternalIntegration'
                description: >-
                  Links the product to matching products in V3 integrations
                  (e.g. Paddle). For each entry, the product is linked to that
                  external integration after the contract is created, so
                  invoices for this product are exported to it. At most one
                  entry per provider. Currently only Paddle is supported.
              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'
              consumesCreditProductIds:
                type: array
                nullable: true
                items:
                  type: string
                  pattern: ^[0-9a-fA-F]{24}$
                description: >-
                  IDs of credit products whose pools are drawn down when this
                  usage product is invoiced. Each ID matches the creditProductId
                  of a credit grant on the same contract that funds the pool.
                  Pools are drawn in the order listed. If omitted, no credits
                  are applied and the product is billed at full price. Not
                  supported inside productGroups.
            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
            - Paddle
          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
        - Scheduled
        - 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
        - ARS
        - INR
        - MXN
        - CHF
      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
        - Enum
      description: 'The type of the value: "String", "Number", or "Boolean"'
  responses:
    GetContractByIntegrationIdResponse:
      description: Response contains the contract matching the provided integration id
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GetContractByIntegrationIdResponse'
  securitySchemes:
    BearerAuthorizer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.