Market
Create Market
Create a new market with user, branch, and subscription plan.
Authorization
default AuthorizationBearer <token>
You can retrieve your token by logging in.
In: header
Header Parameters
X-API-Version*string
API contract version to target. See the Changelog for what changed in each version.
Default
"2.0.0"Value in
"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"Request Body
application/json
includes*array<>
user?
market?
branch?
plan?
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:8000/api/v2/markets" \ -H "X-API-Version: 2.3.0" \ -H "Content-Type: application/json" \ -d '{ "includes": [ "ipsum" ] }'{
"meta": {
"code": 200,
"status": "success",
"message": "Business created successfully."
},
"data": {
"id": "02bc9531-daa0-4699-9daa-7dbad7ecd9ec",
"sector_id": 1,
"name_en": "Mraz-Lowe",
"name_ar": "Mraz-Lowe",
"description_en": null,
"description_ar": null,
"logo_img": null,
"cover_img": null,
"email": null,
"phone_prefix": "966",
"phone_number": null,
"crn": null,
"tax_number": null,
"created_by": "74d67cdd-0f52-4bf2-a5e1-47aa0337cd80",
"email_verified_at": null,
"phone_verified_at": null,
"created_at": 1782824837262,
"updated_at": 1782824837262,
"deleted_at": null,
"is_active": true,
"merchant_id": null,
"reseller_id": null,
"slug": null,
"code": "ENT-0000000002",
"links": {
"website": null,
"instagram": null,
"youtube": null,
"x": null,
"call_center": null
},
"branches_count": 1,
"active_branches_count": 0,
"inactive_branches_count": 1,
"level": null,
"phone": null,
"merchant": null,
"reseller": null,
"location": null,
"plans": [],
"setting": {
"id": 1,
"market_id": "02bc9531-daa0-4699-9daa-7dbad7ecd9ec",
"income": 0,
"receipt_message_en": null,
"receipt_message_ar": null,
"currency": "SAR",
"order_num_start": null,
"is_tax_details": false,
"is_offline_calculate": false,
"country_code": null,
"country_id": null,
"plan_key": "BASIC",
"receipt_second_msg": null,
"receipt_print_top": false,
"receipt_print_bottom": false,
"due_date": null,
"has_loyapro": null,
"has_flavours_payment": false,
"has_tap_payment": false,
"gateway": {
"external": false,
"internal": false
},
"balance": 0,
"plan_option_key": "YEARLY",
"subscription_key": "BASIC",
"subscription_option_key": "YEARLY",
"country": null,
"plan": {
"key": "BASIC",
"name_en": "Qflavours Basic",
"name_ar": "فليفرز - الباقة الأساسية",
"description_en": "Step up with essential upgrades",
"description_ar": "ارتقِ مع الترقيات الأساسية",
"options": [
{
"key": "YEARLY",
"total": 2300,
"price": 2000,
"tax": 300,
"is_tax_included": true
}
],
"created_at": 1782824825915,
"updated_at": 1782824825915,
"deleted_at": null,
"priority": 2
},
"subscription": {
"key": "BASIC",
"name_en": "Qflavours Basic",
"name_ar": "فليفرز - الباقة الأساسية",
"description_en": "Step up with essential upgrades",
"description_ar": "ارتقِ مع الترقيات الأساسية",
"options": [
{
"key": "YEARLY",
"total": 2300,
"price": 2000,
"tax": 300,
"is_tax_included": true
}
],
"created_at": 1782824825915,
"updated_at": 1782824825915,
"deleted_at": null,
"priority": 2
}
},
"sector": {
"id": 1,
"icon": "🥤",
"name_en": "et et",
"name_ar": "et et",
"type": "COMMON",
"deleted_at": null,
"pages": [],
"features": []
}
}
}{
"meta": {
"code": 401,
"status": "error",
"message": "Unauthenticated."
},
"data": null
}{
"meta": {
"code": 403,
"status": "error",
"message": "Unauthorized."
},
"data": null
}{
"meta": {
"code": 404,
"status": "error",
"message": "Resource not found."
},
"data": null
}{
"meta": {
"code": 422,
"status": "error",
"message": "The user.username must be at least 6 characters. (and 11 more errors)"
},
"data": [
{
"code": 0,
"message": "The user.username must be at least 6 characters.",
"field": "user.username"
},
{
"code": 0,
"message": "The user.password must be at least 8 characters.",
"field": "user.password"
},
{
"code": 0,
"message": "The user.password confirmation does not match.",
"field": "user.password"
},
{
"code": 0,
"message": "The password must contain at least 6 characters, at least one uppercase letter, at least one number and at least one special character.",
"field": "user.password"
},
{
"code": 0,
"message": "The market.sector field is required.",
"field": "market.sector"
},
{
"code": 0,
"message": "The market.name en field is required.",
"field": "market.name_en"
},
{
"code": 0,
"message": "The branch.name en field is required.",
"field": "branch.name_en"
},
{
"code": 0,
"message": "The branch.latitude field is required.",
"field": "branch.latitude"
},
{
"code": 0,
"message": "The branch.longitude field is required.",
"field": "branch.longitude"
},
{
"code": 0,
"message": "The plan.key field is required.",
"field": "plan.key"
},
{
"code": 0,
"message": "The plan.start at field is required.",
"field": "plan.start_at"
},
{
"code": 0,
"message": "The plan.close at field is required.",
"field": "plan.close_at"
}
]
}{
"meta": {
"code": 500,
"status": "error",
"message": "Internal server error."
},
"data": null
}