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

# Create Boms From Costing



## OpenAPI

````yaml /api/openapi-cutmake.json post /api/v1/bom/from-costing/{costing_id}
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/bom/from-costing/{costing_id}:
    post:
      tags:
        - BOM
      summary: Create Boms From Costing
      operationId: create_boms_from_costing_api_v1_bom_from_costing__costing_id__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
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/BOMFromCostingCommit'
                - type: 'null'
              title: Payload
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BOMGenerateFromCostingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    BOMFromCostingCommit:
      properties:
        selections:
          anyOf:
            - items:
                $ref: '#/components/schemas/BOMFromCostingSkuSelection'
              type: array
            - type: 'null'
          title: Selections
      type: object
      title: BOMFromCostingCommit
      description: >-
        Optional per-SKU variant picks for the from-costing generator. When
        omitted the

        generator keeps its color/size auto-match behavior (back-compat).
    BOMGenerateFromCostingResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        costSheetId:
          anyOf:
            - type: string
            - type: 'null'
          title: Costsheetid
        costSheetDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Costsheetdocumentid
        sourceBomId:
          anyOf:
            - type: string
            - type: 'null'
          title: Sourcebomid
        sourceBomDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Sourcebomdocumentid
        styleId:
          type: string
          title: Styleid
        styleName:
          anyOf:
            - type: string
            - type: 'null'
          title: Stylename
        styleSkuCount:
          type: integer
          title: Styleskucount
        materialLineCount:
          type: integer
          title: Materiallinecount
        createdCount:
          type: integer
          title: Createdcount
        existingCount:
          type: integer
          title: Existingcount
        createdMaterialVariantCount:
          type: integer
          title: Createdmaterialvariantcount
        items:
          items:
            $ref: '#/components/schemas/BOMGeneratedItem'
          type: array
          title: Items
        createdMaterialVariants:
          items:
            $ref: '#/components/schemas/BOMMaterialVariantCreated'
          type: array
          title: Createdmaterialvariants
      type: object
      required:
        - success
        - message
        - styleId
        - styleSkuCount
        - materialLineCount
        - createdCount
        - existingCount
        - createdMaterialVariantCount
      title: BOMGenerateFromCostingResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BOMFromCostingSkuSelection:
      properties:
        styleSkuId:
          type: string
          title: Styleskuid
        lines:
          items:
            $ref: '#/components/schemas/BOMFromCostingSelectionLine'
          type: array
          title: Lines
      type: object
      required:
        - styleSkuId
      title: BOMFromCostingSkuSelection
    BOMGeneratedItem:
      properties:
        bomId:
          type: string
          title: Bomid
        bomDocumentId:
          type: string
          title: Bomdocumentid
        styleSkuId:
          type: string
          title: Styleskuid
        styleSkuDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Styleskudocumentid
        status:
          type: string
          enum:
            - created
            - existing
          title: Status
        lineItemCount:
          type: integer
          title: Lineitemcount
      type: object
      required:
        - bomId
        - bomDocumentId
        - styleSkuId
        - status
        - lineItemCount
      title: BOMGeneratedItem
    BOMMaterialVariantCreated:
      properties:
        materialId:
          type: string
          title: Materialid
        materialName:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialname
        materialSkuId:
          type: string
          title: Materialskuid
        materialSkuDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialskudocumentid
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
      type: object
      required:
        - materialId
        - materialSkuId
      title: BOMMaterialVariantCreated
    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
    BOMFromCostingSelectionLine:
      properties:
        materialId:
          type: string
          title: Materialid
        materialSkuId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialskuid
      type: object
      required:
        - materialId
      title: BOMFromCostingSelectionLine
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````