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

# Create purchase order

> Create a new purchase order with lines



## OpenAPI

````yaml /api-reference/openapi.json post /admin/api/v1/purchases/purchase-orders
openapi: 3.0.3
info:
  title: ARUKZ ERP API
  version: v1
  description: >-
    The REST API of ARUKZ ERP: sales, purchases, inventory, products, partners,
    accounts, projects and reference data. Every call acts as the user whose
    token it carries and sees only that user's company.
servers:
  - url: https://erp.arukz.com
    description: ARUKZ ERP (hosted)
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Sign in for a token and sign out.
  - name: Sales
    description: Quotations, sales orders and their lines, deliveries and invoices.
  - name: Purchases
    description: Purchase orders, receipts, bills, agreements and vendor price lists.
  - name: Inventory
    description: >-
      Warehouses, locations, lots, stock quantities, receipts, deliveries,
      transfers and scrap.
  - name: Products
    description: 'The product catalogue: categories, attributes, variants and packaging.'
  - name: Partners
    description: Customers, vendors, contacts, addresses and bank accounts.
  - name: Accounts
    description: >-
      Invoices, bills, credit notes, refunds, taxes, journals and the chart of
      accounts.
  - name: Projects
    description: Projects, tasks, stages and milestones.
  - name: Reference data
    description: Currencies and rates, banks, countries, states and units of measure.
paths:
  /admin/api/v1/purchases/purchase-orders:
    post:
      tags:
        - Purchases
      summary: Create purchase order
      description: Create a new purchase order with lines
      operationId: purchases-purchase-orders-create-purchase-order
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                partner_id:
                  type: integer
                  description: >-
                    Vendor partner ID. The `id` of an existing record in the
                    partners_partners table.
                  example: 12
                currency_id:
                  type: integer
                  description: >-
                    Currency ID. The `id` of an existing record in the
                    currencies table.
                  example: 1
                ordered_at:
                  type: string
                  description: Order deadline datetime. Must be a valid date.
                  example: '2026-02-20 10:00:00'
                company_id:
                  type: integer
                  description: >-
                    Company ID. The `id` of an existing record in the companies
                    table.
                  example: 1
                partner_reference:
                  type: string
                  description: Vendor reference. Must not be greater than 255 characters.
                  nullable: true
                  example: VEN-REF-009
                requisition_id:
                  type: integer
                  description: >-
                    Purchase agreement ID. The `id` of an existing record in the
                    purchases_requisitions table.
                  nullable: true
                  example: 5
                planned_at:
                  type: string
                  description: Must be a valid date.
                  nullable: true
                  example: '2026-03-03T04:25:45'
                user_id:
                  type: integer
                  description: >-
                    Buyer user ID. The `id` of an existing record in the users
                    table.
                  nullable: true
                  example: 2
                payment_term_id:
                  type: integer
                  description: >-
                    Payment term ID. The `id` of an existing record in the
                    accounts_payment_terms table.
                  nullable: true
                  example: 4
                incoterm_id:
                  type: integer
                  description: >-
                    Incoterm ID. The `id` of an existing record in the
                    accounts_incoterms table.
                  nullable: true
                  example: 3
                description:
                  type: string
                  description: Terms and conditions / internal description.
                  nullable: true
                  example: Please ship in one lot.
                origin:
                  type: string
                  description: Must not be greater than 255 characters.
                  nullable: true
                  example: b
                lines:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: >-
                          The `id` of an existing record in the
                          purchases_order_lines table.
                        nullable: true
                        example: 16
                      product_id:
                        type: integer
                        description: >-
                          The `id` of an existing record in the
                          products_products table.
                        example: 16
                      planned_at:
                        type: string
                        description: Must be a valid date.
                        example: '2026-03-03T04:25:45'
                      product_qty:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        example: 22
                      uom_id:
                        type: integer
                        description: >-
                          The `id` of an existing record in the unit_of_measures
                          table.
                        nullable: true
                        example: 16
                      product_packaging_qty:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        nullable: true
                        example: 22
                      product_packaging_id:
                        type: integer
                        description: >-
                          The `id` of an existing record in the
                          products_packagings table.
                        nullable: true
                        example: 16
                      price_unit:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        example: 22
                      taxes:
                        type: array
                        items:
                          type: integer
                        description: >-
                          The `id` of an existing record in the accounts_taxes
                          table.
                        example:
                          - 16
                      discount:
                        type: number
                        description: Must be at least 0. Must not be greater than 100.
                        nullable: true
                        example: 22
                      qty_received:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        nullable: true
                        example: 7
                      qty_received_manual:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        nullable: true
                        example: 16
                    required:
                      - planned_at
                      - price_unit
                      - product_id
                      - product_qty
                  description: >-
                    Array of purchase order lines with writable fields from the
                    order form. Must have at least 1 items.
                  example:
                    - product_id: 101
                      planned_at: '2026-02-28 12:00:00'
                      product_qty: 20
                      uom_id: 1
                      product_packaging_id: null
                      product_packaging_qty: 0
                      price_unit: 80
                      discount: 5
                      qty_received: 0
                      qty_received_manual: 0
                      taxes:
                        - 1
                        - 2
              required:
                - company_id
                - currency_id
                - lines
                - ordered_at
                - partner_id
      responses:
        '201':
          description: Created
          content:
            application/json:
              example:
                data:
                  id: 1
                  name: PO/1
                  description: <p></p>
                  priority: '0'
                  origin: null
                  partner_reference: EH-1234
                  state: purchase
                  invoice_status: invoiced
                  receipt_status: full
                  untaxed_amount: 35000
                  tax_amount: 5250
                  total_amount: 40250
                  total_cc_amount: 40250
                  currency_rate: 0
                  mail_reminder_confirmed: true
                  mail_reception_confirmed: false
                  mail_reception_declined: false
                  invoice_count: 0
                  ordered_at: '2026-01-08T12:53:13.000000Z'
                  approved_at: '2026-01-08T12:56:13.000000Z'
                  planned_at: '2026-03-11T00:00:00.000000Z'
                  calendar_start_at: '2026-01-08T12:53:13.000000Z'
                  incoterm_location: null
                  effective_date: null
                  report_grids: false
                  requisition_id: null
                  purchases_group_id: null
                  partner_id: 41
                  currency_id: 1
                  fiscal_position_id: null
                  payment_term_id: null
                  incoterm_id: null
                  user_id: 1
                  company_id: 1
                  creator_id: 1
                  operation_type_id: 1
                  created_at: '2026-01-08T12:55:43.000000Z'
                  updated_at: '2026-01-08T12:56:52.000000Z'
                message: Purchase order created successfully.
        '401':
          description: Unauthenticated
          content:
            application/json:
              example:
                message: Unauthenticated.
        '422':
          description: Validation error
          content:
            application/json:
              example:
                message: The given data was invalid.
                errors:
                  partner_id:
                    - The partner id field is required.
                  lines:
                    - The lines field is required.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API token from [Sign in](/api-reference/authentication), sent as
        `Authorization: Bearer <token>`. Tokens last 30 days.

````

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