> ## 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 Purchase Order

> Create a new purchase order.



## OpenAPI

````yaml /api/openapi-cutmake.json post /api/v1/purchase-orders
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/purchase-orders:
    post:
      tags:
        - Purchase Orders
      summary: Create Purchase Order
      description: Create a new purchase order.
      operationId: create_purchase_order_api_v1_purchase_orders_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/PurchaseOrderCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrderResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    PurchaseOrderCreate:
      properties:
        poType:
          type: string
          title: Potype
        orderType:
          anyOf:
            - type: string
            - type: 'null'
          title: Ordertype
          default: bulk
        workOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Workorderid
        workOrderDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Workorderdocumentid
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        supplierRefPo:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierrefpo
        materialRequestId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialrequestid
        productionOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Productionorderid
        salesOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Salesorderid
        orderDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Orderdate
        expectedDeliveryDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Expecteddeliverydate
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        subtotal:
          anyOf:
            - type: number
            - type: 'null'
          title: Subtotal
        taxRate:
          anyOf:
            - type: number
            - type: 'null'
          title: Taxrate
        taxAmount:
          anyOf:
            - type: number
            - type: 'null'
          title: Taxamount
        total:
          anyOf:
            - type: number
            - type: 'null'
          title: Total
        purpose:
          anyOf:
            - type: string
            - type: 'null'
          title: Purpose
        expenseCategory:
          anyOf:
            - type: string
            - type: 'null'
          title: Expensecategory
        frequency:
          anyOf:
            - type: string
            - type: 'null'
          title: Frequency
        managementAccountId:
          anyOf:
            - type: string
            - type: 'null'
          title: Managementaccountid
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        lineItems:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Lineitems
      type: object
      required:
        - poType
      title: PurchaseOrderCreate
    PurchaseOrderResponse:
      properties:
        id:
          type: string
          title: Id
        documentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentid
        poType:
          type: string
          title: Potype
        orderType:
          anyOf:
            - type: string
            - type: 'null'
          title: Ordertype
        workOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Workorderid
        workOrderDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Workorderdocumentid
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        supplierVendor:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliervendor
        supplierRefPo:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierrefpo
        materialRequestId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialrequestid
        mrIds:
          anyOf:
            - type: string
            - type: 'null'
          title: Mrids
        mrDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Mrdocumentid
        productionOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Productionorderid
        salesOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Salesorderid
        orderDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Orderdate
        expectedDeliveryDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Expecteddeliverydate
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        subtotal:
          anyOf:
            - type: number
            - type: 'null'
          title: Subtotal
        taxRate:
          anyOf:
            - type: number
            - type: 'null'
          title: Taxrate
        taxAmount:
          anyOf:
            - type: number
            - type: 'null'
          title: Taxamount
        total:
          anyOf:
            - type: number
            - type: 'null'
          title: Total
        purpose:
          anyOf:
            - type: string
            - type: 'null'
          title: Purpose
        expenseCategory:
          anyOf:
            - type: string
            - type: 'null'
          title: Expensecategory
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        frequency:
          anyOf:
            - type: string
            - type: 'null'
          title: Frequency
        managementAccountId:
          anyOf:
            - type: string
            - type: 'null'
          title: Managementaccountid
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        itemsCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Itemscount
        dueDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Duedate
        lineItems:
          anyOf:
            - items:
                $ref: '#/components/schemas/PurchaseOrderLineItem'
              type: array
            - type: 'null'
          title: Lineitems
      type: object
      required:
        - id
        - poType
      title: PurchaseOrderResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PurchaseOrderLineItem:
      properties:
        id:
          type: string
          title: Id
        purchaseOrderId:
          type: string
          title: Purchaseorderid
        itemNumber:
          anyOf:
            - type: integer
            - type: 'null'
          title: Itemnumber
        materialId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialid
        materialSkuId:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialskuid
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        supplierName:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliername
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
        uom:
          anyOf:
            - type: string
            - type: 'null'
          title: Uom
        qty:
          anyOf:
            - type: number
            - type: 'null'
          title: Qty
        unitPrice:
          anyOf:
            - type: number
            - type: 'null'
          title: Unitprice
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
        linkedMrLineId:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedmrlineid
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      type: object
      required:
        - id
        - purchaseOrderId
      title: PurchaseOrderLineItem
    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

````