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

# Create Template



## OpenAPI

````yaml /api/openapi-cutmake.json post /api/v1/expense-templates
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/expense-templates:
    post:
      tags:
        - 'Admin Sector: Expense Templates'
      summary: Create Template
      operationId: create_template_api_v1_expense_templates_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/routers__admin_sector__expense_templates__TemplateResponse
        '401':
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    TemplateCreate:
      properties:
        name:
          type: string
          minLength: 1
          title: Name
        requestType:
          type: string
          title: Requesttype
          default: direct_payment
        paymentMethod:
          type: string
          title: Paymentmethod
          default: direct_payment
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        currency:
          type: string
          title: Currency
          default: VND
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        frequency:
          type: string
          title: Frequency
        startDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Startdate
        lineItems:
          items:
            $ref: '#/components/schemas/TemplateLineItem'
          type: array
          title: Lineitems
      type: object
      required:
        - name
        - frequency
      title: TemplateCreate
    routers__admin_sector__expense_templates__TemplateResponse:
      properties:
        id:
          type: string
          title: Id
        orgId:
          type: string
          title: Orgid
        name:
          type: string
          title: Name
        requestType:
          type: string
          title: Requesttype
        paymentMethod:
          type: string
          title: Paymentmethod
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        currency:
          type: string
          title: Currency
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        frequency:
          type: string
          title: Frequency
        nextRunDate:
          type: string
          title: Nextrundate
        isActive:
          type: boolean
          title: Isactive
        lastGeneratedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastgeneratedat
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        lineItems:
          items:
            $ref: '#/components/schemas/TemplateLineItemResponse'
          type: array
          title: Lineitems
      type: object
      required:
        - id
        - orgId
        - name
        - requestType
        - paymentMethod
        - currency
        - frequency
        - nextRunDate
        - isActive
      title: TemplateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TemplateLineItem:
      properties:
        description:
          type: string
          title: Description
        quantity:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
          default: '1'
        unitPrice:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Unitprice
        amount:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
      type: object
      required:
        - description
        - amount
      title: TemplateLineItem
    TemplateLineItemResponse:
      properties:
        description:
          type: string
          title: Description
        quantity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
          default: '1'
        unitPrice:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Unitprice
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        id:
          type: string
          title: Id
        expenseTemplateId:
          type: string
          title: Expensetemplateid
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
      type: object
      required:
        - description
        - amount
        - id
        - expenseTemplateId
      title: TemplateLineItemResponse
    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

````