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

# Preview Boms From Costing

> Read-only plan for the from-costing generator: the style SKUs that need a BOM and,
per material line, the variants to choose from (scoped to each cost-sheet material).



## OpenAPI

````yaml /api/openapi-cutmake.json post /bom/from-costing/{costing_id}/preview
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /bom/from-costing/{costing_id}/preview:
    post:
      tags:
        - BOM
      summary: Preview Boms From Costing
      description: >-
        Read-only plan for the from-costing generator: the style SKUs that need
        a BOM and,

        per material line, the variants to choose from (scoped to each
        cost-sheet material).
      operationId: preview_boms_from_costing_bom_from_costing__costing_id__preview_post
      parameters:
        - name: costing_id
          in: path
          required: true
          schema:
            type: string
            title: Costing Id
        - 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/BOMFromCostingPreviewResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    BOMFromCostingPreviewResponse:
      properties:
        costSheetId:
          type: string
          title: Costsheetid
        costSheetDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Costsheetdocumentid
        styleId:
          type: string
          title: Styleid
        styleName:
          anyOf:
            - type: string
            - type: 'null'
          title: Stylename
        materials:
          items:
            $ref: '#/components/schemas/BOMPreviewMaterial'
          type: array
          title: Materials
        skus:
          items:
            $ref: '#/components/schemas/BOMPreviewSku'
          type: array
          title: Skus
      type: object
      required:
        - costSheetId
        - styleId
      title: BOMFromCostingPreviewResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BOMPreviewMaterial:
      properties:
        materialId:
          type: string
          title: Materialid
        materialName:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialname
        variants:
          items:
            $ref: '#/components/schemas/BOMPreviewVariant'
          type: array
          title: Variants
      type: object
      required:
        - materialId
      title: BOMPreviewMaterial
    BOMPreviewSku:
      properties:
        styleSkuId:
          type: string
          title: Styleskuid
        documentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentid
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
        alreadyHasBom:
          type: boolean
          title: Alreadyhasbom
          default: false
        lines:
          items:
            $ref: '#/components/schemas/BOMPreviewSkuLine'
          type: array
          title: Lines
      type: object
      required:
        - styleSkuId
      title: BOMPreviewSku
    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
    BOMPreviewVariant:
      properties:
        materialSkuId:
          type: string
          title: Materialskuid
        documentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentid
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
        unitCost:
          anyOf:
            - type: number
            - type: 'null'
          title: Unitcost
      type: object
      required:
        - materialSkuId
      title: BOMPreviewVariant
    BOMPreviewSkuLine:
      properties:
        materialId:
          type: string
          title: Materialid
        materialName:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialname
        suggestedMaterialSkuId:
          anyOf:
            - type: string
            - type: 'null'
          title: Suggestedmaterialskuid
        consumption:
          anyOf:
            - type: number
            - type: 'null'
          title: Consumption
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        unitCost:
          anyOf:
            - type: number
            - type: 'null'
          title: Unitcost
      type: object
      required:
        - materialId
      title: BOMPreviewSkuLine
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````