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

# Approve Material Request



## OpenAPI

````yaml /api/openapi-cutmake.json post /api/v1/material-requests/{mr_id}/approve
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/material-requests/{mr_id}/approve:
    post:
      tags:
        - Material Requests
      summary: Approve Material Request
      operationId: approve_material_request_api_v1_material_requests__mr_id__approve_post
      parameters:
        - name: mr_id
          in: path
          required: true
          schema:
            type: string
            title: Mr 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/ApproveRequest'
                - type: 'null'
              title: Payload
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaterialRequestResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    ApproveRequest:
      properties:
        comments:
          anyOf:
            - type: string
            - type: 'null'
          title: Comments
      type: object
      title: ApproveRequest
    MaterialRequestResponse:
      properties:
        id:
          type: string
          title: Id
        documentId:
          type: string
          title: Documentid
        urgency:
          anyOf:
            - type: string
            - type: 'null'
          title: Urgency
        productionOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Productionorderid
        productionOrderDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Productionorderdocumentid
        salesOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Salesorderid
        salesOrderDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Salesorderdocumentid
        purchaseOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Purchaseorderid
        purchaseOrderDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Purchaseorderdocumentid
        status:
          type: string
          title: Status
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        submittedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Submittedat
        approvedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Approvedat
        rejectedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Rejectedat
        submittedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Submittedbyid
        submittedByName:
          anyOf:
            - type: string
            - type: 'null'
          title: Submittedbyname
        approvedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Approvedbyid
        approvedByName:
          anyOf:
            - type: string
            - type: 'null'
          title: Approvedbyname
        rejectedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Rejectedbyid
        rejectedByName:
          anyOf:
            - type: string
            - type: 'null'
          title: Rejectedbyname
        rejectionReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Rejectionreason
        bomId:
          anyOf:
            - type: string
            - type: 'null'
          title: Bomid
        bomDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Bomdocumentid
        wastagePercent:
          anyOf:
            - type: number
            - type: 'null'
          title: Wastagepercent
        autoGenerated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Autogenerated
        lineItemsCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Lineitemscount
        totalEstimatedAmount:
          anyOf:
            - type: number
            - type: 'null'
          title: Totalestimatedamount
        production_order:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Production Order
        purchase_order:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Purchase Order
        lineItems:
          anyOf:
            - items:
                $ref: '#/components/schemas/MaterialRequestLineItem'
              type: array
            - type: 'null'
          title: Lineitems
        approvalHistory:
          anyOf:
            - items:
                $ref: '#/components/schemas/MaterialRequestApprovalHistory'
              type: array
            - type: 'null'
          title: Approvalhistory
        linkedPurchaseOrders:
          anyOf:
            - items:
                $ref: '#/components/schemas/MaterialRequestLinkedPurchaseOrder'
              type: array
            - type: 'null'
          title: Linkedpurchaseorders
      type: object
      required:
        - id
        - documentId
        - status
      title: MaterialRequestResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MaterialRequestLineItem:
      properties:
        id:
          type: string
          title: Id
        materialRequestId:
          type: string
          title: Materialrequestid
        itemNumber:
          anyOf:
            - type: integer
            - type: 'null'
          title: Itemnumber
        materialId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialid
        materialName:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialname
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        supplierName:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliername
        requiredQty:
          type: number
          title: Requiredqty
        warehouseAvailableQty:
          type: number
          title: Warehouseavailableqty
        qtyToPurchase:
          type: number
          title: Qtytopurchase
        uom:
          anyOf:
            - type: string
            - type: 'null'
          title: Uom
        unitPrice:
          anyOf:
            - type: number
            - type: 'null'
          title: Unitprice
        estimatedAmount:
          anyOf:
            - type: number
            - type: 'null'
          title: Estimatedamount
        linkedPoLineId:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedpolineid
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
      type: object
      required:
        - id
        - materialRequestId
        - requiredQty
        - warehouseAvailableQty
        - qtyToPurchase
      title: MaterialRequestLineItem
    MaterialRequestApprovalHistory:
      properties:
        id:
          type: string
          title: Id
        materialRequestId:
          type: string
          title: Materialrequestid
        action:
          type: string
          title: Action
        status:
          type: string
          title: Status
        performedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Performedbyid
        performedByName:
          anyOf:
            - type: string
            - type: 'null'
          title: Performedbyname
        performedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Performedat
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        comments:
          anyOf:
            - type: string
            - type: 'null'
          title: Comments
      type: object
      required:
        - id
        - materialRequestId
        - action
        - status
      title: MaterialRequestApprovalHistory
    MaterialRequestLinkedPurchaseOrder:
      properties:
        id:
          type: string
          title: Id
        documentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentid
        supplierName:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliername
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        total:
          anyOf:
            - type: number
            - type: 'null'
          title: Total
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        linkedMrId:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedmrid
      type: object
      required:
        - id
      title: MaterialRequestLinkedPurchaseOrder
    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

````