Create
DevelopingPOST
/ordersConstant
Use the constants below according to the field names and rules for each request
Constant | Value |
---|---|
source |
ADMIN_APP ADMIN_WEB LANDING_APP LANDING_WEB GRUBTECH |
type |
TAKE_AWAY DINING DRIVE_THROUGH DELIVERY |
status |
WAITING PROCESS COMPLETED CANCELED DELIVERY |
Validation
Field | Type | Rule | Description |
---|---|---|---|
market_id |
string |
required |
Id from Market model |
branch_id |
string |
required |
Id from Branch model |
source |
string |
required |
From source constant above |
type |
string |
required |
From type constant above |
status |
string |
required |
WAITING PROCESS |
notes |
string |
nullable |
|
discount_id |
string |
nullable |
Id from Discount model |
table_id |
integer |
nullable |
Id from Table model |
customer_id |
string |
nullable |
Id from Customer model |
cashier_id |
string |
nullable |
Id from Cashier model |
products |
array |
required |
|
products.*.product_id |
string |
required |
Id from Product model |
products.*.qty |
integer |
required min:0 |
|
products.*.modifiers |
array |
required |
|
products.*.modifiers.*.product_modifier_id |
integer |
required |
Id from ProductModifier model |
products.*.modifiers.*.weight |
numeric |
nullable min:0 |
|
payments |
array |
nullable |
|
payments.*.payment_method_key |
string |
required |
Key from PaymentMethod model |
payments.*.value |
numeric |
required min:0 |
|
payments.*.given |
numeric |
nullable min:0 |
The rules on the fields will change depending on conditions, including the following
Field | Rule | Condition |
---|---|---|
customer_id |
required |
User authentication role CUSTOMER |
cashier_id |
required |
User authentication role not CUSTOMER |
Request
Body Params application/json
market_id
string
required
branch_id
string
required
source
string
required
type
string
required
status
string
required
notes
string
optional
discount_id
string
optional
table_id
integer
optional
customer_id
string
optional
cashier_id
string
optional
products
array [object {3}]
required
product_id
string
required
qty
integer
required
modifiers
array [object {2}]
required
payments
array [object {3}]
optional
payment_method_key
string
required
value
number
required
given
number
optional
Example
{
"market_id": "be7407f3-8d36-4a01-a20f-f306f044f496",
"branch_id": "de1a6526-34de-4d1f-87e3-831e1af19853",
"cashier_id": "0756d11b-4a6e-4739-adf7-899e58de0885",
"products": [
{
"product_id": "8447de4e-740e-4181-a377-6dfa3f4d3aa2",
"qty": 2,
"modifiers": [
{
"product_modifier_id": 5626
}
]
},
{
"product_id": "cfcdf305-4cfe-495c-9a33-c8dfc7a6b8c5",
"qty": 1,
"modifiers": [
{
"product_modifier_id": 5567,
"weight": 2
}
]
}
],
"customer_id": null,
"type": "TAKE_AWAY",
"notes": null,
"table_id": null,
"source": "ADMIN_WEB",
"discount_id": null,
"status": "WAITING"
}
Request samples
Responses
OK(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
meta
object
required
code
integer
required
status
string
required
message
string
required
data
object
required
id
string
required
market_id
string
required
branch_id
string
required
number
string
required
source
string
required
type
string
required
status
string
required
table_code
null
required
notes
null
required
customer_id
null
required
cashier_id
string
required
created_at
integer
required
updated_at
integer
required
deleted_at
null
required
is_product_changed
boolean
required
table_id
null
required
qr_img
string
required
market
object
required
customer
null
required
cashier
object
required
table
null
required
status_logs
array [object {4}]
required
transaction
object
required
products
array [object {21}]
required
return_products
array[string]
required
changed_products
array[string]
required
product_discount_fees
array[string]
required
product_tax_fees
array [object {14}]
required
Example
{
"meta": {
"code": 200,
"status": "success",
"message": "Order Successfully Created"
},
"data": {
"id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"number": "0001",
"source": "ADMIN_WEB",
"type": "TAKE_AWAY",
"status": "WAITING",
"table_code": null,
"notes": null,
"customer_id": null,
"cashier_id": "0756d11b-4a6e-4739-adf7-899e58de0885",
"created_at": 1698586104719,
"updated_at": 1698586104719,
"deleted_at": null,
"is_product_changed": false,
"table_id": null,
"qr_img": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAIAAACx0UUtAAAABnRSTlMA/wD/AP83WBt9AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFb0lEQVR4nO3dwW7cOhBFweeH/P8vO3stFAhsUseeqm1G0sRzQahBsvn1/f39H4T9//YXgH+QUepklDo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HqZNR6mSUOhmlbuPavPu35mPHJh3rp/DWpqtH9v1Geo3zuWSUOhmlTkapm5xn2rft5mLwbf2tLg/3X+PRhwcP3j12ptQjxlHqZJQ6GaVORqmL9oB41Llg0FtNECIVZLPFu3GUOhmlTkapk1HqlnpAXO+17fjUwRmdwX1Ux6ys+mtunHrEOEqdjFIno9TJKHWT80yPPrzvyNfBnVLNo2YvmlWgeSY+iIxSJ6PUySh1k/NMxwxunFq59lhnvPtv9ehWkfbhjxhHqZNR6mSUOhml7tw804rBvUH7Pvxo09W+rnqPDLaTcD4Tn0tGqZNR6mSUuqWa6eKtY1vvrcwzDe7QemSwBca+UubYLJRxlDoZpU5GqZNR6iZrpou3WlOvFBz71putbLoaPCdpsJK7cD4Tn0tGqZNR6mSUuo010z4/Yl/Rytd4ZN8JvxfHDrG9MI5SJ6PUySh1Mkrdj6yZ9s0VvTXP9OjDx2qX+y95bB7ROEqdjFIno9TJKHUba6a33uUH9+gM7hwa3Ef16EErnSkiPRWNo9TJKHUySp2MUjdZM0VOgF3Z/XOsMfnKfqZHInuhzDPxm8kodTJKnYxS9yPPZ+KjGEepk1HqZJQ6GaVORqmTUepklDoZpU5GqZNR6mSUOhmlTkapk1HqZJQ6GaVORqmTUepklLq/aYnEzzpSeNwAAAAASUVORK5CYII=",
"market": {
"id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"sector_id": 1,
"name_en": "First Restaurant",
"name_ar": "First Restaurant",
"description_en": "Ut maxime commodi natus id tenetur ullam. Repudiandae aut quia est perspiciatis facilis dolores repellendus ea eum. Iusto occaecati libero ea voluptas dolore qui qui maxime quod. Eum ut vel possimus sunt doloribus saepe repellendus et.",
"description_ar": "العظمى إستيلاء الأوروبية، حين عل. هو وبعد قتيل، العالمي ولم, يونيو مساعدة التاريخ، وصل تم. بـ سكان الجو اليابان تحت, يتم لأداء تكتيكاً قُدُماً ان. نفس موالية الجنوبي ما, أضف تم غضون أسابيع وقوعها،. وبدون ميناء الأمريكية فقد عل, قتيل، معارضة ضرب عن, دول وبعض لفرنسا تزامناً ثم. أي أدوات استبدال جعل. يكن لغات مشروط من.",
"logo_img": null,
"cover_img": null,
"email": "[email protected]",
"phone_prefix": "966",
"phone": "579112767",
"crn": null,
"tax_number": "12345611",
"created_by": null,
"email_verified_at": null,
"phone_verified_at": null,
"created_at": 1680271006362,
"updated_at": 1683019078189,
"deleted_at": null
},
"customer": null,
"cashier": {
"id": "0756d11b-4a6e-4739-adf7-899e58de0885",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": null,
"permission_id": 2,
"user": {
"id": "f64b8da0-429b-4377-9a03-19724f43465b",
"userable_id": "0756d11b-4a6e-4739-adf7-899e58de0885",
"role": "SUBSCRIBER",
"name": "Subscriber 1",
"username": "subscriber1",
"email": "[email protected]",
"phone_prefix": "966",
"phone": null,
"lang": "en",
"fcm_token": null,
"is_active": true,
"email_verified_at": null,
"phone_verified_at": null,
"created_at": 1680271006727,
"updated_at": 1684892194280,
"deleted_at": null
}
},
"table": null,
"status_logs": [
{
"id": 147,
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"status": "WAITING",
"created_at": 1698586104785
}
],
"transaction": {
"id": 18000043781,
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"discount": 0,
"tax": 3.3,
"subtotal": 22,
"total": 25.3,
"cost": 9,
"profit": 2,
"created_at": 1698586104738,
"updated_at": 1698586104738,
"status": "UNPAID",
"discount_id": null,
"payment_fees": 0,
"related_discount": null,
"payments": [],
"return_payments": []
},
"products": [
{
"id": 9000044906,
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"product_category_id": 2,
"product_id": "8447de4e-740e-4181-a377-6dfa3f4d3aa2",
"qty": 2,
"price": 5.5,
"discount": 0,
"tax": 1.65,
"subtotal": 11,
"total": 12.65,
"cost": 4.5,
"profit": 1,
"is_done": false,
"created_at": 1698586104742,
"updated_at": 1698586104742,
"status": "RELATED",
"product": {
"id": "8447de4e-740e-4181-a377-6dfa3f4d3aa2",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"product_category_id": 2,
"name_en": "Burger Deluxe",
"name_ar": "برجر ديلوكس",
"description_en": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"description_ar": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"preparation_time": 15,
"stock": 766,
"order": 2,
"images": [
"https://cdn-flavours.fra1.digitaloceanspaces.com/img/uploads/products/1680365973-0.jpg"
],
"is_active": true,
"created_at": 1680271006454,
"updated_at": 1684589809294,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 64,
"sold_revenue": 64.5,
"qoyod_id": null
},
"modifiers": [
{
"id": 2757,
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"order_product_id": 9000044906,
"product_modifier_id": 5626,
"weight": null,
"price": 5.5,
"discount": 0,
"tax": 1.65,
"total": 6.33,
"cost": 4.5,
"profit": 1,
"modifier": {
"id": 5626,
"product_id": "8447de4e-740e-4181-a377-6dfa3f4d3aa2",
"name_en": "Small",
"name_ar": "صغير",
"type": "OPTION",
"calorie": 300,
"price": 5.5,
"tax": 0.83,
"total": 6.33,
"cost": 4.5,
"profit": 1,
"is_tax_included": false,
"deleted_at": null,
"barcode": null,
"barcode_img": null,
"weight_amount": null,
"weight_unit": null
}
}
],
"tax_fees": [
{
"id": 30326,
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"order_product_id": 9000044906,
"feeable_id": "cc49a82a-ea28-4541-b4e6-8131457607a1",
"feeable_type": "TAX",
"qty": 2,
"amount": 0.83,
"total": 1.65,
"created_at": 1698586104758,
"updated_at": 1698586104758,
"order_product_modifier_id": null
}
]
},
{
"id": 9000044907,
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"product_category_id": 3,
"product_id": "cfcdf305-4cfe-495c-9a33-c8dfc7a6b8c5",
"qty": 1,
"price": 11,
"discount": 0,
"tax": 1.65,
"subtotal": 11,
"total": 12.65,
"cost": 4.5,
"profit": 1,
"is_done": false,
"created_at": 1698586104742,
"updated_at": 1698586104742,
"status": "RELATED",
"product": {
"id": "cfcdf305-4cfe-495c-9a33-c8dfc7a6b8c5",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"product_category_id": 3,
"name_en": "Twister Lunch Edited",
"name_ar": "Twister Lunch",
"description_en": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"description_ar": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"preparation_time": 20,
"stock": 818,
"order": 1,
"images": [
"https://cdn-flavours.fra1.digitaloceanspaces.com/img/uploads/products/1680366096-0.jpg"
],
"is_active": true,
"created_at": 1680271006458,
"updated_at": 1684246940577,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 31,
"sold_revenue": 39.09,
"qoyod_id": null
},
"modifiers": [
{
"id": 2758,
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"order_product_id": 9000044907,
"product_modifier_id": 5567,
"weight": "2.00",
"price": 11,
"discount": 0,
"tax": 1.65,
"total": 12.65,
"cost": 4.5,
"profit": 1,
"modifier": {
"id": 5567,
"product_id": "cfcdf305-4cfe-495c-9a33-c8dfc7a6b8c5",
"name_en": "Small",
"name_ar": "Small",
"type": "OPTION",
"calorie": 300,
"price": 5.5,
"tax": 0.83,
"total": 6.33,
"cost": 4.5,
"profit": 1,
"is_tax_included": false,
"deleted_at": null,
"barcode": null,
"barcode_img": null,
"weight_amount": "1.00",
"weight_unit": "Kg"
}
}
],
"tax_fees": [
{
"id": 30327,
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"order_product_id": 9000044907,
"feeable_id": "cc49a82a-ea28-4541-b4e6-8131457607a1",
"feeable_type": "TAX",
"qty": 1,
"amount": 1.65,
"total": 1.65,
"created_at": 1698586104758,
"updated_at": 1698586104758,
"order_product_modifier_id": null
}
]
}
],
"return_products": [],
"changed_products": [],
"product_discount_fees": [],
"product_tax_fees": [
{
"id": 30326,
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"order_product_id": 9000044906,
"feeable_id": "cc49a82a-ea28-4541-b4e6-8131457607a1",
"feeable_type": "TAX",
"qty": 2,
"amount": 0.83,
"total": 1.65,
"created_at": 1698586104758,
"updated_at": 1698586104758,
"order_product_modifier_id": null,
"feeable": {
"id": "cc49a82a-ea28-4541-b4e6-8131457607a1",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": null,
"name_en": "Tax",
"name_ar": "ضريبة",
"value": 15,
"value_type": "PERCENT",
"is_active": true,
"created_at": 2023,
"updated_at": 2023,
"deleted_at": null,
"is_calculate": true
}
},
{
"id": 30327,
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"order_id": "ad757b52-c1c7-4996-a029-83d218cacb66",
"order_product_id": 9000044907,
"feeable_id": "cc49a82a-ea28-4541-b4e6-8131457607a1",
"feeable_type": "TAX",
"qty": 1,
"amount": 1.65,
"total": 1.65,
"created_at": 1698586104758,
"updated_at": 1698586104758,
"order_product_modifier_id": null,
"feeable": {
"id": "cc49a82a-ea28-4541-b4e6-8131457607a1",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": null,
"name_en": "Tax",
"name_ar": "ضريبة",
"value": 15,
"value_type": "PERCENT",
"is_active": true,
"created_at": 2023,
"updated_at": 2023,
"deleted_at": null,
"is_calculate": true
}
}
]
}
}
Last modified: 2 months ago