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

# Compare Versions



## OpenAPI

````yaml /api/openapi-cutmake.json get /bom/{bom_id}/versions/{version_a}/compare/{version_b}
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /bom/{bom_id}/versions/{version_a}/compare/{version_b}:
    get:
      tags:
        - BOM
      summary: Compare Versions
      operationId: >-
        compare_versions_bom__bom_id__versions__version_a__compare__version_b__get
      parameters:
        - name: bom_id
          in: path
          required: true
          schema:
            type: string
            title: Bom Id
        - name: version_a
          in: path
          required: true
          schema:
            type: integer
            title: Version A
        - name: version_b
          in: path
          required: true
          schema:
            type: integer
            title: Version B
        - name: X-Org-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Org-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BOMVersionComparison'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    BOMVersionComparison:
      properties:
        bomId:
          type: string
          title: Bomid
        versionA:
          $ref: '#/components/schemas/BOMVersionSummary'
        versionB:
          $ref: '#/components/schemas/BOMVersionSummary'
        lineItemDiffs:
          items:
            $ref: '#/components/schemas/BOMLineItemDiff'
          type: array
          title: Lineitemdiffs
      type: object
      required:
        - bomId
        - versionA
        - versionB
      title: BOMVersionComparison
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BOMVersionSummary:
      properties:
        id:
          type: string
          title: Id
        documentId:
          type: string
          title: Documentid
        versionNumber:
          type: integer
          title: Versionnumber
        changeDescription:
          anyOf:
            - type: string
            - type: 'null'
          title: Changedescription
        createdAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createdat
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        submittedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Submittedat
        submittedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Submittedbyid
        approvedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Approvedbyid
        rejectionReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Rejectionreason
        isFinal:
          type: boolean
          title: Isfinal
          default: false
        finalizedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finalizedat
        finalizedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Finalizedbyid
      type: object
      required:
        - id
        - documentId
        - versionNumber
      title: BOMVersionSummary
    BOMLineItemDiff:
      properties:
        changeType:
          type: string
          enum:
            - added
            - removed
            - modified
          title: Changetype
        materialId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialid
        skuId:
          anyOf:
            - type: string
            - type: 'null'
          title: Skuid
        materialName:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialname
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        supplierName:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliername
        oldValues:
          anyOf:
            - $ref: '#/components/schemas/LineItemSnapshot'
            - type: 'null'
        newValues:
          anyOf:
            - $ref: '#/components/schemas/LineItemSnapshot'
            - type: 'null'
        fieldDifferences:
          items:
            $ref: '#/components/schemas/LineItemFieldDiff'
          type: array
          title: Fielddifferences
      type: object
      required:
        - changeType
      title: BOMLineItemDiff
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    LineItemSnapshot:
      properties:
        lineItemId:
          type: string
          title: Lineitemid
        materialId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialid
        skuId:
          anyOf:
            - type: string
            - type: 'null'
          title: Skuid
        materialName:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialname
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        supplierName:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliername
        grossConsumption:
          anyOf:
            - type: number
            - type: 'null'
          title: Grossconsumption
        sellingTolerance:
          anyOf:
            - type: number
            - type: 'null'
          title: Sellingtolerance
        netSellingConsumption:
          anyOf:
            - type: number
            - type: 'null'
          title: Netsellingconsumption
        buyingTolerance:
          anyOf:
            - type: number
            - type: 'null'
          title: Buyingtolerance
        netBuyingConsumption:
          anyOf:
            - type: number
            - type: 'null'
          title: Netbuyingconsumption
        materialCostInNativeCurrency:
          anyOf:
            - type: number
            - type: 'null'
          title: Materialcostinnativecurrency
        nativeCurrency:
          anyOf:
            - type: string
            - type: 'null'
          title: Nativecurrency
        materialCostInUsd:
          anyOf:
            - type: number
            - type: 'null'
          title: Materialcostinusd
        estimatedMaterialPreparationLeadTime:
          anyOf:
            - type: integer
            - type: 'null'
          title: Estimatedmaterialpreparationleadtime
      type: object
      required:
        - lineItemId
      title: LineItemSnapshot
    LineItemFieldDiff:
      properties:
        field:
          type: string
          title: Field
        oldValue:
          anyOf:
            - {}
            - type: 'null'
          title: Oldvalue
        newValue:
          anyOf:
            - {}
            - type: 'null'
          title: Newvalue
      type: object
      required:
        - field
      title: LineItemFieldDiff
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````