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

# Get Costing By Id

> Get single costing by ID for detail view.

Returns full data matching the frontend Costing interface.
Used by the costing detail page.

- **costing_id**: The document ID of the cost sheet



## OpenAPI

````yaml /api/openapi-cutmake.json get /costings/{costing_id}
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /costings/{costing_id}:
    get:
      tags:
        - Costing Management
      summary: Get Costing By Id
      description: |-
        Get single costing by ID for detail view.

        Returns full data matching the frontend Costing interface.
        Used by the costing detail page.

        - **costing_id**: The document ID of the cost sheet
      operationId: get_costing_by_id_costings__costing_id__get
      parameters:
        - name: costing_id
          in: path
          required: true
          schema:
            type: string
            description: The costing document ID (e.g., CS-2024-001)
            title: Costing Id
          description: The costing document ID (e.g., CS-2024-001)
        - name: version
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            description: Optional version number. Omit to load the latest/current version.
            title: Version
          description: Optional version number. Omit to load the latest/current version.
        - 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/Costing'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    Costing:
      properties:
        id:
          type: string
          title: Id
        costSheetName:
          anyOf:
            - type: string
            - type: 'null'
          title: Costsheetname
        styleCode:
          type: string
          title: Stylecode
        styleName:
          type: string
          title: Stylename
        styleId:
          anyOf:
            - type: string
            - type: 'null'
          title: Styleid
        clientName:
          anyOf:
            - type: string
            - type: 'null'
          title: Clientname
        clientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Clientid
        version:
          type: integer
          title: Version
        currentVersion:
          anyOf:
            - type: integer
            - type: 'null'
          title: Currentversion
        status:
          type: string
          title: Status
        stageKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagekey
        stageLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagelabel
        fits:
          items:
            $ref: '#/components/schemas/CostingFit'
          type: array
          title: Fits
          default: []
        date:
          type: string
          title: Date
        createdBy:
          type: string
          title: Createdby
        currency:
          type: string
          title: Currency
        orderQuantity:
          type: number
          title: Orderquantity
          default: 0
        orderTotalCost:
          type: number
          title: Ordertotalcost
          default: 0
        summary:
          $ref: '#/components/schemas/CostingSummary'
        materials:
          items:
            $ref: '#/components/schemas/CostingMaterial'
          type: array
          title: Materials
        processing:
          items:
            $ref: '#/components/schemas/CostingProcessing'
          type: array
          title: Processing
        logistics:
          items:
            $ref: '#/components/schemas/CostingLogistics'
          type: array
          title: Logistics
          default: []
        overhead:
          $ref: '#/components/schemas/CostingOverhead'
        profitScenarios:
          items:
            $ref: '#/components/schemas/CostingProfitScenarios'
          type: array
          title: Profitscenarios
        history:
          items:
            $ref: '#/components/schemas/CostingHistory'
          type: array
          title: History
        exchangeRates:
          items:
            $ref: '#/components/schemas/CostingExchangeRate'
          type: array
          title: Exchangerates
        bundleEntries:
          items:
            $ref: '#/components/schemas/BundleEntry'
          type: array
          title: Bundleentries
          default: []
        approvalHistory:
          items:
            $ref: '#/components/schemas/CostingApprovalHistoryEntry'
          type: array
          title: Approvalhistory
          default: []
      type: object
      required:
        - id
        - styleCode
        - styleName
        - version
        - status
        - date
        - createdBy
        - currency
        - summary
        - materials
        - processing
        - overhead
        - profitScenarios
        - history
        - exchangeRates
      title: Costing
      description: |-
        Full costing response matching frontend TypeScript interface.

        Used by:
        - GET /costings (list view)
        - GET /costings/{id} (detail view)
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CostingFit:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        stageKey:
          type: string
          title: Stagekey
        stageLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagelabel
        sortOrder:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sortorder
        currentVersion:
          anyOf:
            - type: integer
            - type: 'null'
          title: Currentversion
        finalVersion:
          anyOf:
            - type: integer
            - type: 'null'
          title: Finalversion
      type: object
      required:
        - stageKey
      title: CostingFit
      description: A fit (sample stage) over the cost sheet's versions.
    CostingSummary:
      properties:
        material:
          type: number
          title: Material
        processing:
          type: number
          title: Processing
        logistics:
          type: number
          title: Logistics
          default: 0
        logisticsShipment:
          type: number
          title: Logisticsshipment
          default: 0
        overhead:
          type: number
          title: Overhead
        total:
          type: number
          title: Total
        orderTotal:
          type: number
          title: Ordertotal
          default: 0
      type: object
      required:
        - material
        - processing
        - overhead
        - total
      title: CostingSummary
      description: Summary totals for the cost sheet
    CostingMaterial:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        materialId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialid
        name:
          type: string
          title: Name
        type:
          type: string
          title: Type
        consumption:
          type: number
          title: Consumption
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        unitCost:
          type: number
          title: Unitcost
        total:
          type: number
          title: Total
        sourceBundleId:
          anyOf:
            - type: string
            - type: 'null'
          title: Sourcebundleid
      type: object
      required:
        - name
        - type
        - consumption
        - unitCost
        - total
      title: CostingMaterial
      description: Single BOM line item
    CostingProcessing:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          type: string
          title: Type
        vendor:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        supplierName:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliername
        supplierCountry:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliercountry
        supplierApproved:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Supplierapproved
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        status:
          type: string
          title: Status
        cost:
          type: number
          title: Cost
      type: object
      required:
        - type
        - status
        - cost
      title: CostingProcessing
      description: Single processing cost item
    CostingLogistics:
      properties:
        calculationMode:
          anyOf:
            - type: string
            - type: 'null'
          title: Calculationmode
        transportMode:
          anyOf:
            - type: string
            - type: 'null'
          title: Transportmode
        basis:
          anyOf:
            - type: string
            - type: 'null'
          title: Basis
        quantity:
          type: number
          title: Quantity
          default: 0
        rate:
          type: number
          title: Rate
          default: 0
        handlingFee:
          type: number
          title: Handlingfee
          default: 0
        baseCost:
          type: number
          title: Basecost
          default: 0
        contingencyPercent:
          type: number
          title: Contingencypercent
          default: 0
        contingencyAmount:
          type: number
          title: Contingencyamount
          default: 0
        shipmentTotal:
          type: number
          title: Shipmenttotal
          default: 0
        orderQuantity:
          type: number
          title: Orderquantity
          default: 0
        unitCost:
          type: number
          title: Unitcost
          default: 0
        costAmount:
          type: number
          title: Costamount
          default: 0
        currency:
          type: string
          title: Currency
          default: USD
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
      type: object
      title: CostingLogistics
      description: Single logistics estimate line.
    CostingOverhead:
      properties:
        tier2:
          items:
            $ref: '#/components/schemas/CostingOverheadTier2'
          type: array
          title: Tier2
        tier3:
          items:
            $ref: '#/components/schemas/CostingOverheadTier3'
          type: array
          title: Tier3
      type: object
      required:
        - tier2
        - tier3
      title: CostingOverhead
      description: Combined overhead structure
    CostingProfitScenarios:
      properties:
        quotedPrice:
          type: number
          title: Quotedprice
        quotedCurrency:
          type: string
          title: Quotedcurrency
        grossMargin:
          type: number
          title: Grossmargin
        grossIncome:
          type: number
          title: Grossincome
        netMargin:
          type: number
          title: Netmargin
        netIncome:
          type: number
          title: Netincome
      type: object
      required:
        - quotedPrice
        - quotedCurrency
        - grossMargin
        - grossIncome
        - netMargin
        - netIncome
      title: CostingProfitScenarios
      description: Profit analysis (single scenario for now)
    CostingHistory:
      properties:
        version:
          type: string
          title: Version
        versionNumber:
          anyOf:
            - type: integer
            - type: 'null'
          title: Versionnumber
        isCurrent:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Iscurrent
        date:
          type: string
          title: Date
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        user:
          type: string
          title: User
        description:
          type: string
          title: Description
        stageKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagekey
        stageLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagelabel
      type: object
      required:
        - version
        - date
        - user
        - description
      title: CostingHistory
      description: Version history entry
    CostingExchangeRate:
      properties:
        from:
          type: string
          title: From
        to:
          type: string
          title: To
        rate:
          type: number
          title: Rate
        date:
          type: string
          title: Date
      type: object
      required:
        - from
        - to
        - rate
        - date
      title: CostingExchangeRate
      description: Exchange rate snapshot - placeholder for future use
    BundleEntry:
      properties:
        id:
          type: string
          title: Id
        bundleMaterialId:
          type: string
          title: Bundlematerialid
        bundleName:
          type: string
          title: Bundlename
        inputConsumption:
          type: number
          title: Inputconsumption
      type: object
      required:
        - id
        - bundleMaterialId
        - bundleName
        - inputConsumption
      title: BundleEntry
      description: Represents a bundle that was added to the BOM
    CostingApprovalHistoryEntry:
      properties:
        version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Version
        action:
          type: string
          title: Action
        status:
          type: string
          title: Status
        performedAt:
          type: string
          title: Performedat
        performedBy:
          type: string
          title: Performedby
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        comments:
          anyOf:
            - type: string
            - type: 'null'
          title: Comments
      type: object
      required:
        - action
        - status
        - performedAt
        - performedBy
      title: CostingApprovalHistoryEntry
      description: Approval workflow history entry
    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
    CostingOverheadTier2:
      properties:
        name:
          type: string
          title: Name
        cost:
          type: number
          title: Cost
      type: object
      required:
        - name
        - cost
      title: CostingOverheadTier2
      description: Tier 2 overhead (percentage-based)
    CostingOverheadTier3:
      properties:
        type:
          type: string
          title: Type
        description:
          type: string
          title: Description
        cost:
          type: number
          title: Cost
        currency:
          type: string
          title: Currency
      type: object
      required:
        - type
        - description
        - cost
        - currency
      title: CostingOverheadTier3
      description: Tier 3 overhead (fixed amount)
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````