Add New Order

POST/api/orders

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
client_id number Mandatory Client ID
order_date string Mandatory Order date (Y-m-d)
status_id number Mandatory Status ID
note string optional Optional Order note
project_id number optional Optional Project ID
discount_amount number optional Optional Discount amount
created_by number optional Optional RISE user ID. Default: 1. Use for proper attribution.
items Object[] optional Optional order lines, in the same shape GET /api/orders/:id/items returns. Omit the key to keep the previous behaviour of creating a header with no lines. An empty array is rejected with a 400.
items.title String Mandatory line title. A description is accepted instead.
items.description String optional Optional line description
items.quantity Number Mandatory quantity, numeric
items.rate Number Mandatory unit rate, numeric
items.unit_type String optional Optional unit type, maximum 20 characters
items.sort Number optional Optional display order. Defaults to the array position.
items.item_id Number optional Optional items library ID
curl -X POST "https://yoursite.com/api/orders" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "client_id": "...", "order_date": "...", "status_id": "...", "items.title": "...", "items.quantity": "...", "items.rate": "..." }'

Success-Response:

HTTP/1.1 201 Created
{
  "status": 200,
  "messages": {"success": "Order add success"},
  "id": 1
}
MethodPOST
Path/api/orders
GroupOrders
Sincev1.0.0
Defined inRestApi/Controllers/OrdersController.php