---
title: "إنشاء طلبية"
method: POST
path: "/v1/orders"
tags: ["orders"]
---

# إنشاء طلبية

`POST /v1/orders`

الأسعار تُحسب على الخادم من قاعدة البيانات؛ أي سعر يرسله العميل يُتجاهل. الطلبية لا تخصم المخزون.

## Headers

- `Idempotency-Key` string

## Request body

- OrderInput
  - `customer_id` integer, nullable
  - `customer` object
    - `name` string
    - `phone` string
    - `email` string
    - `address` string
    - `region_id` integer
  - `warehouse_id` integer
  - `branch_id` integer
  - `salesman_id` integer
  - `price_list` 1 | 2 | 3
  - `payment_method` 'cash' | 'card' | 'transfer' | 'on_delivery' | 'credit'
  - `delivery_fee` number
  - `discount` number
  - `vat_percent` number
  - `check_stock` boolean
  - `notes` string
  - `items` object[], required
    - `item_id` integer
    - `barcode` string
    - `unit_id` integer
    - `qty` number, required
    - `discount` number
    - `vat_percent` number
    - `notes` string

## Response `200`

طلبية سابقة بنفس Idempotency-Key

## Other responses

- `201` — أُنشئت
- `422` — بيانات غير صحيحة

---

[API](https://skmtc.dev/softpro/apis/softpro-api.md) · [All operations](https://skmtc.dev/softpro/apis/softpro-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/softpro/softpro-api/revisions/f30e0a849354/schema)
