> ## Documentation Index
> Fetch the complete documentation index at: https://useidalia.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create purchaseOrders

> Create purchase orders



## OpenAPI

````yaml /openapi.json post /purchase-orders
openapi: 3.0.0
info:
  title: Idalia API
  version: 1.0.0
  description: REST API for Idalia. Authenticate with an API key in the X-API-KEY header.
servers:
  - url: https://idalia.app/api
    description: Idalia API server
security: []
paths:
  /purchase-orders:
    post:
      tags:
        - Purchase-orders
      summary: Create purchaseOrders
      description: Create purchase orders
      operationId: createPurchaseOrders
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePurchaseOrdersParams'
        description: Array of data to create purchase orders
      responses:
        '200':
          description: Returns a list of the newly created purchase order objects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrdersQueryResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreatePurchaseOrdersParams:
      type: array
      items:
        $ref: '#/components/schemas/CreatePurchaseOrderSchema'
    PurchaseOrdersQueryResponse:
      type: array
      items:
        $ref: '#/components/schemas/PurchaseOrderResponse'
    CreatePurchaseOrderSchema:
      type: object
      properties:
        poNumber:
          type: string
          description: Purchase order number
        status:
          type: string
          nullable: true
          description: Purchase order status
        approvalStatus:
          type: string
          nullable: true
          description: Purchase order approval status
        currency:
          type: string
          nullable: true
          description: ISO 4217 currency code
        total:
          type: number
          nullable: true
          description: Purchase order total in the PO currency
      required:
        - poNumber
    PurchaseOrderResponse:
      type: object
      properties:
        id:
          type: string
          description: ID of the purchase order
        createdAt:
          type: string
          description: Datetime the purchase order was created
        createdById:
          type: string
          nullable: true
          description: ID of the user that created the purchase order
        updatedAt:
          type: string
          nullable: true
          description: Datetime the purchase order was last updated
        updatedById:
          type: string
          nullable: true
          description: ID of the user that last updated the purchase order
        workspaceId:
          type: string
          description: ID of the workspace the purchase order belongs to
        poNumber:
          type: string
          description: Purchase order number
        status:
          type: string
          nullable: true
          description: Purchase order status
        approvalStatus:
          type: string
          nullable: true
          description: Purchase order approval status
        currency:
          type: string
          nullable: true
          description: ISO 4217 currency code
        total:
          type: number
          nullable: true
          description: Purchase order total in the PO currency
      required:
        - id
        - createdAt
        - workspaceId
        - poNumber
  responses:
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Invalid request parameters
              code:
                type: string
                example: '400'
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Authentication required
              code:
                type: string
                example: '401'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Access denied
              code:
                type: string
                example: '403'
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: An unexpected error occurred
              code:
                type: string
                example: '500'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.