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

# Post Stock Take

> Stock-take: record counted quantities and post the deltas as
``adjustment`` movements (backlog 1c — services/stock_reconciliation's
adjusting-entry semantics through the LIVE movement path).

For each counted lot: delta = counted − lot.qty_current. A non-zero delta
writes a stock_ledger ``adjustment`` movement via the standard writer
(balance upsert + lot update + GL queue), so the perpetual-inventory GL
hook posts Dr/Cr inventory vs inventory_adjustment exactly as any other
movement — the GL and the stock ledger can never diverge from one another
here. Zero-delta counts are acknowledged but post nothing. The whole count
sheet is one transaction: either every adjustment lands or none do.



## OpenAPI

````yaml /api/openapi-cutmake.json post /stock/stock-take
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /stock/stock-take:
    post:
      tags:
        - Stock
      summary: Post Stock Take
      description: >-
        Stock-take: record counted quantities and post the deltas as

        ``adjustment`` movements (backlog 1c — services/stock_reconciliation's

        adjusting-entry semantics through the LIVE movement path).


        For each counted lot: delta = counted − lot.qty_current. A non-zero
        delta

        writes a stock_ledger ``adjustment`` movement via the standard writer

        (balance upsert + lot update + GL queue), so the perpetual-inventory GL

        hook posts Dr/Cr inventory vs inventory_adjustment exactly as any other

        movement — the GL and the stock ledger can never diverge from one
        another

        here. Zero-delta counts are acknowledged but post nothing. The whole
        count

        sheet is one transaction: either every adjustment lands or none do.
      operationId: post_stock_take_stock_stock_take_post
      parameters:
        - name: X-Org-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Org-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StockTakeRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockTakeResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    StockTakeRequest:
      properties:
        counts:
          items:
            $ref: '#/components/schemas/StockTakeCount'
          type: array
          title: Counts
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
      type: object
      required:
        - counts
      title: StockTakeRequest
    StockTakeResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/StockTakeResultRow'
          type: array
          title: Data
        adjustedCount:
          type: integer
          title: Adjustedcount
      type: object
      required:
        - data
        - adjustedCount
      title: StockTakeResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StockTakeCount:
      properties:
        stockLotId:
          type: string
          title: Stocklotid
        stockLocationId:
          type: string
          title: Stocklocationid
        countedQty:
          type: number
          title: Countedqty
      type: object
      required:
        - stockLotId
        - stockLocationId
        - countedQty
      title: StockTakeCount
    StockTakeResultRow:
      properties:
        stockLotId:
          type: string
          title: Stocklotid
        previousQty:
          type: number
          title: Previousqty
        countedQty:
          type: number
          title: Countedqty
        qtyDelta:
          type: number
          title: Qtydelta
        movementId:
          anyOf:
            - type: string
            - type: 'null'
          title: Movementid
      type: object
      required:
        - stockLotId
        - previousQty
        - countedQty
        - qtyDelta
      title: StockTakeResultRow
    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
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````