> ## 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 Next Ref

> Generate the next available VM-#### reference id for the org.

The id is a single global series ("VM-001", "VM-002", ...) shared by every
material regardless of type, so the number stays unique org-wide. materialType
is accepted for backward compatibility but no longer affects the prefix.



## OpenAPI

````yaml /api/openapi-cutmake.json get /materials/next-ref
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /materials/next-ref:
    get:
      tags:
        - Materials
      summary: Get Next Ref
      description: >-
        Generate the next available VM-#### reference id for the org.


        The id is a single global series ("VM-001", "VM-002", ...) shared by
        every

        material regardless of type, so the number stays unique org-wide.
        materialType

        is accepted for backward compatibility but no longer affects the prefix.
      operationId: get_next_ref_materials_next_ref_get
      parameters:
        - name: materialType
          in: query
          required: true
          schema:
            type: string
            description: Material type used to generate the next VM/reference id
            title: Materialtype
          description: Material type used to generate the next VM/reference id
        - 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/NextRefResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    NextRefResponse:
      properties:
        refId:
          type: string
          title: Refid
      type: object
      required:
        - refId
      title: NextRefResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````