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

# Update Inventory Contract



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json patch /api/admin/inventory/contracts/{contract_id}
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/admin/inventory/contracts/{contract_id}:
    patch:
      tags:
        - admin-inventory
      summary: Update Inventory Contract
      operationId: >-
        update_inventory_contract_api_admin_inventory_contracts__contract_id__patch
      parameters:
        - name: contract_id
          in: path
          required: true
          schema:
            type: string
            title: Contract Id
        - name: dryRun
          in: query
          required: false
          schema:
            type: boolean
            title: Dryrun
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContractMutationRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse_MutationResult_'
        '401':
          description: Authorization failed
        '403':
          description: Insufficient permissions
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ContractMutationRequest:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference
        type:
          anyOf:
            - $ref: '#/components/schemas/InventoryContractTypeEnum'
            - type: 'null'
        status:
          anyOf:
            - $ref: '#/components/schemas/InventoryContractStatusEnum'
            - type: 'null'
        startDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Startdate
        endDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Enddate
        billingPeriod:
          anyOf:
            - $ref: '#/components/schemas/InventoryContractBillingPeriodEnum'
            - type: 'null'
        paymentTiming:
          anyOf:
            - $ref: '#/components/schemas/InventoryContractPaymentTimingEnum'
            - type: 'null'
        autoRenew:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Autorenew
        noticePeriodDays:
          anyOf:
            - type: integer
            - type: 'null'
          title: Noticeperioddays
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        extra:
          anyOf:
            - type: object
            - type: 'null'
          title: Extra
        vendorId:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendorid
        continuesFromId:
          anyOf:
            - type: string
            - type: 'null'
          title: Continuesfromid
        nodeTypes:
          anyOf:
            - items:
                $ref: '#/components/schemas/ContractNodeTypeTerm'
              type: array
              maxItems: 1000
            - type: 'null'
          title: Nodetypes
        carryOverNodeIds:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 1000
            - type: 'null'
          title: Carryovernodeids
      additionalProperties: false
      type: object
      title: ContractMutationRequest
      description: >-
        Contract create/update. All fields optional (partial update); create

        validates `name`, `vendor_id` and `start_date` in the service.


        `node_types` and `carry_over_node_ids` are create-only conveniences:
        they are

        not columns, they seed the term set and the initial node membership.
    GenericResponse_MutationResult_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/MutationResult'
            - type: 'null'
          description: Response data
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Response status
      type: object
      title: GenericResponse[MutationResult]
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    InventoryContractTypeEnum:
      type: string
      enum:
        - ONE_OFF
        - RECURRING
        - RENEWABLE
      title: InventoryContractTypeEnum
    InventoryContractStatusEnum:
      type: string
      enum:
        - DRAFT
        - ACTIVE
        - ENDED
        - CANCELLED
      title: InventoryContractStatusEnum
    InventoryContractBillingPeriodEnum:
      type: string
      enum:
        - ONE_TIME
        - DAILY
        - WEEKLY
        - BIWEEKLY
        - MONTHLY
        - BIMONTHLY
        - QUARTERLY
        - SEMI_ANNUAL
        - ANNUAL
        - BIENNIAL
      title: InventoryContractBillingPeriodEnum
    InventoryContractPaymentTimingEnum:
      type: string
      enum:
        - ADVANCE
        - ARREARS
      title: InventoryContractPaymentTimingEnum
    ContractNodeTypeTerm:
      properties:
        nodeTypeId:
          type: string
          title: Nodetypeid
        committedNodeCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Committednodecount
        pricePerGpuHr:
          anyOf:
            - type: number
            - type: 'null'
          title: Pricepergpuhr
        pricePerNodeHr:
          anyOf:
            - type: number
            - type: 'null'
          title: Pricepernodehr
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        extra:
          anyOf:
            - type: object
            - type: 'null'
          title: Extra
      type: object
      required:
        - nodeTypeId
      title: ContractNodeTypeTerm
      description: >-
        Pricing and commitment for one node type under a contract. A node can
        only

        be attached to the contract once its node type has a term row here.
    MutationResult:
      properties:
        operationId:
          type: string
          title: Operationid
        targetId:
          anyOf:
            - type: string
            - type: 'null'
          title: Targetid
        targetName:
          anyOf:
            - type: string
            - type: 'null'
          title: Targetname
        message:
          type: string
          title: Message
        created:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created
        updated:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated
        assigned:
          anyOf:
            - type: integer
            - type: 'null'
          title: Assigned
        detached:
          anyOf:
            - type: integer
            - type: 'null'
          title: Detached
        retired:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retired
      type: object
      required:
        - operationId
        - message
      title: MutationResult
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````