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

> Create a new order with line items



## OpenAPI

````yaml /api-reference/openapi.json post /admin/api/v1/sales/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/sales/orders:
    post:
      tags:
        - Sales
      summary: Create order
      description: Create a new order with line items
      operationId: sales-orders-create-order
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                partner_id:
                  type: integer
                  description: >-
                    Customer (partner) ID. The `id` of an existing record in the
                    partners_partners table.
                  example: 1
                payment_term_id:
                  type: integer
                  description: >-
                    Payment term ID. The `id` of an existing record in the
                    accounts_payment_terms table.
                  example: 1
                date_order:
                  type: string
                  description: Order date in YYYY-MM-DD format. Must be a valid date.
                  example: '2026-02-18'
                validity_date:
                  type: string
                  description: >-
                    Quotation validity date in YYYY-MM-DD format. Must be a
                    valid date.
                  nullable: true
                  example: '2026-02-28'
                commitment_date:
                  type: string
                  description: Must be a valid date.
                  nullable: true
                  example: '2026-03-03T04:25:46'
                client_order_ref:
                  type: string
                  description: Must not be greater than 255 characters.
                  nullable: true
                  example: b
                origin:
                  type: string
                  description: Must not be greater than 255 characters.
                  nullable: true
                  example: 'n'
                note:
                  type: string
                  description: Terms and conditions or internal note.
                  nullable: true
                  example: Delivery within 7 business days.
                user_id:
                  type: integer
                  description: The `id` of an existing record in the users table.
                  nullable: true
                  example: 16
                company_id:
                  type: integer
                  description: >-
                    Company ID. The `id` of an existing record in the companies
                    table.
                  nullable: true
                  example: 1
                currency_id:
                  type: integer
                  description: >-
                    Currency ID. The `id` of an existing record in the
                    currencies table.
                  nullable: true
                  example: 1
                campaign_id:
                  type: integer
                  description: The `id` of an existing record in the utm_campaigns table.
                  nullable: true
                  example: 16
                utm_source_id:
                  type: integer
                  description: The `id` of an existing record in the utm_sources table.
                  nullable: true
                  example: 16
                medium_id:
                  type: integer
                  description: The `id` of an existing record in the utm_mediums table.
                  nullable: true
                  example: 16
                sales_order_tags:
                  type: array
                  items:
                    type: integer
                  description: The `id` of an existing record in the sales_tags table.
                  example:
                    - 16
                lines:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: >-
                          The `id` of an existing record in the
                          sales_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
                      product_qty:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        example: 22
                      qty_delivered:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        nullable: true
                        example: 7
                      product_packaging_qty:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        nullable: true
                        example: 16
                      price_unit:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        example: 17
                      discount:
                        type: number
                        description: Must be at least 0. Must not be greater than 100.
                        nullable: true
                        example: 15
                      customer_lead:
                        type: number
                        description: >-
                          Must be at least 0. Must not be greater than
                          99999999999.
                        nullable: true
                        example: 8
                      product_uom_id:
                        type: integer
                        description: >-
                          The `id` of an existing record in the unit_of_measures
                          table.
                        nullable: true
                        example: 16
                      product_packaging_id:
                        type: integer
                        description: >-
                          The `id` of an existing record in the
                          products_packagings table.
                        nullable: true
                        example: 16
                      taxes:
                        type: array
                        items:
                          type: integer
                        description: >-
                          The `id` of an existing record in the accounts_taxes
                          table.
                        example:
                          - 16
                    required:
                      - price_unit
                      - product_id
                      - product_qty
                  description: >-
                    Array of order line items with writable fields from the
                    quotation form. Must have at least 1 items.
                  example:
                    - product_id: 10
                      product_qty: 2
                      product_uom_id: 1
                      price_unit: 120.5
                      discount: 5
                      customer_lead: 0
                      product_packaging_id: null
                      product_packaging_qty: 0
                      taxes:
                        - 1
                        - 2
              required:
                - date_order
                - lines
                - partner_id
                - payment_term_id
      responses:
        '201':
          description: Created
          content:
            application/json:
              example:
                data:
                  id: 1
                  name: SO/1
                  state: sale
                  invoice_status: invoiced
                  client_order_ref: null
                  origin: null
                  reference: null
                  date_order: '2026-01-07'
                  validity_date: '2026-02-06'
                  commitment_date: null
                  currency_rate: 0
                  amount_untaxed: 2440
                  amount_tax: 366
                  amount_total: 2806
                  locked: true
                  require_signature: false
                  require_payment: false
                  signed_by: null
                  signed_on: null
                  prepayment_percent: 0
                  note: <p></p>
                  access_token: null
                  partner_id: 33
                  partner_invoice_id: 33
                  partner_shipping_id: 33
                  user_id: 1
                  team_id: null
                  company_id: 1
                  currency_id: 1
                  payment_term_id: 2
                  fiscal_position_id: null
                  journal_id: null
                  campaign_id: null
                  utm_source_id: null
                  medium_id: null
                  warehouse_id: 5
                  created_at: '2026-01-07T11:12:56+00:00'
                  updated_at: '2026-01-08T12:59:31+00:00'
                  deleted_at: null
                  partner:
                    id: 33
                    account_type: individual
                    sub_type: customer
                    name: Lyle Holman
                    email: lyle@example.com
                    phone: '12121221212'
                    mobile: '1212121215294'
                    avatar: null
                    avatar_url: null
                    job_title: >-
                      Itaque ratione dicta tenetur omnis reiciendis quidem
                      consequatur
                    website: https://www.zecikapuleze.mobi
                    tax_id: Esse dolorum quo vel animi fugiat ipsum dicta et
                    company_registry: TEST COMPANY
                    reference: Ea aliquid debitis m
                    is_active: true
                    color: null
                    street1: Street 69
                    street2: >-
                      Reprehenderit eos saepe deserunt ut eu ea aliquam magnam
                      saepe reprehenderit cum alias dicta amet ducimus saepe
                      excepturi facere qui
                    city: California
                    zip: '90006'
                    country_id: 233
                    state_id: 13
                    parent_id: 18
                    title_id: 1
                    company_id: null
                    industry_id: null
                    user_id: 2
                    creator_id: null
                    created_at: '2025-04-10T10:45:51.000000Z'
                    updated_at: '2025-12-09T11:12:13.000000Z'
                    deleted_at: null
                    country:
                      id: 233
                      name: United States
                      code: US
                      phone_code: '1'
                      state_required: true
                      zip_required: true
                      currency_id: 1
                      created_at: '2025-04-07T12:34:34.000000Z'
                      updated_at: '2025-04-07T12:34:34.000000Z'
                    state:
                      id: 13
                      name: California
                      code: CA
                      country_id: 233
                      created_at: '2025-04-07T12:34:34.000000Z'
                      updated_at: '2025-04-07T12:34:34.000000Z'
                  lines:
                    - id: 1
                      sort: 1
                      name: Big Vision 4K Action Camera - Fisheye Lens
                      display_type: null
                      product_uom_qty: 5
                      product_qty: 5
                      qty_delivered: 5
                      qty_invoiced: 5
                      qty_to_invoice: 0
                      product_packaging_qty: 0.5
                      price_unit: 210
                      technical_price_unit: 210
                      discount: 0
                      price_subtotal: 1050
                      price_tax: 157.5
                      price_total: 1207.5
                      price_reduce_taxexcl: 210
                      price_reduce_taxinc: 241.5
                      purchase_price: 100
                      margin: 0
                      margin_percent: 0
                      untaxed_amount_invoiced: 0
                      untaxed_amount_to_invoice: 1050
                      state: sale
                      invoice_status: invoiced
                      qty_delivered_method: stock_move
                      virtual_id: null
                      linked_virtual_id: null
                      is_downpayment: false
                      is_expense: false
                      customer_lead: 0
                      analytic_distribution: null
                      order_id: 1
                      product_id: 2
                      linked_sale_order_sale_id: null
                      product_uom_id: 1
                      product_packaging_id: 1
                      currency_id: 1
                      order_partner_id: 33
                      salesman_id: 1
                      warehouse_id: 5
                      route_id: null
                      company_id: 1
                      created_at: '2026-01-07T11:12:56+00:00'
                      updated_at: '2026-01-08T12:59:31+00:00'
                    - id: 2
                      sort: 2
                      name: Bass Blaze Waterproof Bluetooth Speaker - Blue
                      display_type: null
                      product_uom_qty: 4
                      product_qty: 4
                      qty_delivered: 4
                      qty_invoiced: 4
                      qty_to_invoice: 0
                      product_packaging_qty: 0.2
                      price_unit: 60
                      technical_price_unit: 60
                      discount: 0
                      price_subtotal: 240
                      price_tax: 36
                      price_total: 276
                      price_reduce_taxexcl: 60
                      price_reduce_taxinc: 69
                      purchase_price: 45
                      margin: 0
                      margin_percent: 0
                      untaxed_amount_invoiced: 0
                      untaxed_amount_to_invoice: 240
                      state: sale
                      invoice_status: invoiced
                      qty_delivered_method: stock_move
                      virtual_id: null
                      linked_virtual_id: null
                      is_downpayment: false
                      is_expense: false
                      customer_lead: 0
                      analytic_distribution: null
                      order_id: 1
                      product_id: 12
                      linked_sale_order_sale_id: null
                      product_uom_id: 1
                      product_packaging_id: 2
                      currency_id: 1
                      order_partner_id: 33
                      salesman_id: 1
                      warehouse_id: 5
                      route_id: null
                      company_id: 1
                      created_at: '2026-01-07T11:12:56+00:00'
                      updated_at: '2026-01-08T12:59:31+00:00'
                    - id: 3
                      sort: 3
                      name: Flim Rocket Mini Projector - Telecentric Lens
                      display_type: null
                      product_uom_qty: 5
                      product_qty: 5
                      qty_delivered: 5
                      qty_invoiced: 5
                      qty_to_invoice: 0
                      product_packaging_qty: 0.5
                      price_unit: 230
                      technical_price_unit: 230
                      discount: 0
                      price_subtotal: 1150
                      price_tax: 172.5
                      price_total: 1322.5
                      price_reduce_taxexcl: 230
                      price_reduce_taxinc: 264.5
                      purchase_price: 120
                      margin: 0
                      margin_percent: 0
                      untaxed_amount_invoiced: 0
                      untaxed_amount_to_invoice: 1150
                      state: sale
                      invoice_status: invoiced
                      qty_delivered_method: stock_move
                      virtual_id: null
                      linked_virtual_id: null
                      is_downpayment: false
                      is_expense: false
                      customer_lead: 0
                      analytic_distribution: null
                      order_id: 1
                      product_id: 8
                      linked_sale_order_sale_id: null
                      product_uom_id: 1
                      product_packaging_id: 1
                      currency_id: 1
                      order_partner_id: 33
                      salesman_id: 1
                      warehouse_id: 5
                      route_id: null
                      company_id: 1
                      created_at: '2026-01-07T11:12:56+00:00'
                      updated_at: '2026-01-08T12:59:31+00:00'
                message: 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.