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

# Update Material

> Update a material.



## OpenAPI

````yaml /api/openapi-cutmake.json patch /api/v1/materials/{material_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/materials/{material_id}:
    patch:
      tags:
        - Materials
      summary: Update Material
      description: Update a material.
      operationId: update_material_api_v1_materials__material_id__patch
      parameters:
        - name: material_id
          in: path
          required: true
          schema:
            type: string
            title: Material Id
        - 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/MaterialUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaterialDetailResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    MaterialUpdate:
      properties:
        materialName:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialname
        refId:
          anyOf:
            - type: string
            - type: 'null'
          title: Refid
        materialType:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialtype
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        costPerUnit:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Costperunit
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        verificationStatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Verificationstatus
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        weight:
          anyOf:
            - type: number
            - type: 'null'
          title: Weight
        weightUom:
          anyOf:
            - type: string
            - type: 'null'
          title: Weightuom
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        keyword:
          anyOf:
            - type: string
            - type: 'null'
          title: Keyword
        picture:
          anyOf:
            - type: string
            - type: 'null'
          title: Picture
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        width:
          anyOf:
            - type: number
            - type: 'null'
          title: Width
        widthUom:
          anyOf:
            - type: string
            - type: 'null'
          title: Widthuom
        composition:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Composition
        shrinkage:
          anyOf:
            - type: number
            - type: 'null'
          title: Shrinkage
        countryOfOrigin:
          anyOf:
            - type: string
            - type: 'null'
          title: Countryoforigin
      type: object
      title: MaterialUpdate
    MaterialDetailResponse:
      properties:
        documentId:
          type: string
          title: Documentid
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        masterMaterialId:
          anyOf:
            - type: string
            - type: 'null'
          title: Mastermaterialid
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        refId:
          anyOf:
            - type: string
            - type: 'null'
          title: Refid
        materialType:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialtype
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        supplier:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplier
        supplierName:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliername
        countryOfOrigin:
          anyOf:
            - type: string
            - type: 'null'
          title: Countryoforigin
        keyword:
          anyOf:
            - type: string
            - type: 'null'
          title: Keyword
        picture:
          anyOf:
            - type: string
            - type: 'null'
          title: Picture
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        updatedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Updatedat
        submittedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Submittedat
        lastVerifiedDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastverifieddate
        costDisplay:
          anyOf:
            - type: string
            - type: 'null'
          title: Costdisplay
        originalCostPerUnit:
          anyOf:
            - type: number
            - type: 'null'
          title: Originalcostperunit
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        weight:
          anyOf:
            - type: number
            - type: 'null'
          title: Weight
        weightUom:
          anyOf:
            - type: string
            - type: 'null'
          title: Weightuom
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        width:
          anyOf:
            - type: number
            - type: 'null'
          title: Width
        widthUom:
          anyOf:
            - type: string
            - type: 'null'
          title: Widthuom
        composition:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Composition
        shrinkage:
          anyOf:
            - type: number
            - type: 'null'
          title: Shrinkage
        verificationStatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Verificationstatus
        skus:
          items:
            $ref: '#/components/schemas/MaterialSKUResponse'
          type: array
          title: Skus
        skuCount:
          type: integer
          title: Skucount
          default: 0
      type: object
      required:
        - documentId
      title: MaterialDetailResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MaterialSKUResponse:
      properties:
        id:
          type: string
          title: Id
        documentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentid
        refId:
          anyOf:
            - type: string
            - type: 'null'
          title: Refid
        masterMaterialId:
          anyOf:
            - type: string
            - type: 'null'
          title: Mastermaterialid
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
        qrData:
          anyOf:
            - type: string
            - type: 'null'
          title: Qrdata
        skuCostOverride:
          type: number
          title: Skucostoverride
          default: 0
      type: object
      required:
        - id
      title: MaterialSKUResponse
    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

````