General
Start with the API base URL, headers, authentication conventions, response formats, and public information endpoints.
Complete reference for the Laravel API routes: conventions, authentication, catalog, subscriptions, orders, payments, and Foodics integration. Provider configuration, enabled payment methods, and Foodics configuration can change which options are available at runtime.
This guide explains how to work with the public and authenticated REST API, what each part of the documentation covers, and where to find endpoint details. Use the navigation or search above to jump directly to a topic or endpoint.
Start with the API base URL, headers, authentication conventions, response formats, and public information endpoints.
Browse products and cart behavior, then review addresses, delivery areas, branch operating hours, and delivery-area preferences.
Find profile, verification, KYC, notifications, subscription-plan, and subscription-purchase workflows.
Review daily orders, subscription deliveries, payment initiation, payment status, and transaction behavior.
Understand Foodics integration endpoints, detailed endpoint contracts, and implementation notes or known gaps.
Each detailed contract describes its request fields, successful response, validation or empty-data behavior, and relevant failure responses. Example values are illustrative unless stated otherwise.
All endpoints below are relative to:
https://behealthy.dataduck.in/api
Send JSON requests with:
Accept: application/json Content-Type: application/json
Authenticated endpoints require a Sanctum bearer token:
Authorization: Bearer <ACCESS_TOKEN>
Multipart requests (for example KYC fields or support attachments) should use multipart/form-data.
API language can be selected using ?lang=en or ?lang=ar; otherwise the API uses the supported Accept-Language preference/default. Supported codes are en and ar. Arabic JSON response payloads may be localized.
Most successful API responses use:
{
"remark": "operation_name",
"status": "success",
"message": {
"success": ["Human-readable message"]
},
"data": {}
}
Most controller-generated errors use:
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Reason"]
}
}
"status": "error"; do not infer success solely from the HTTP status. Newer validation endpoints generally use 422. Authentication failures, missing records, conflicts, and provider failures may return 401, 403, 404, 409, 429, or 5xx. API-level throttling is enabled; the numeric rate is not specified in the route configuration. Do not retry non-idempotent operations blindly.
Authorization is checked before controller validation. Apply the route family's requirements even when an endpoint has no request body. For an authorized call, send the token returned by login, registration, or OTP verification:
GET /api/orders Accept: application/json Authorization: ******;ACCESS_TOKEN>
| Route family | Access requirement | Missing/invalid token or ineligible account |
|---|---|---|
| Public information and catalog reads; subscription-plan reads; login/register, OTP, and password recovery | No bearer token required. A supplied token may affect personalized fields on endpoints that inspect the current user. | No route-level 401. Endpoint validation, throttling, and provider responses still apply. |
/auth/logout, /logout, account verification routes, payment status/navigation routes, FCM token routes, authenticated Foodics subscription/pickup/diagnostic routes | Sanctum token; these routes do not add check.status or registration.complete unless stated in their endpoint contract. | Missing/invalid token: HTTP 401. A valid token does not bypass caller ownership checks. |
POST /user-data-submit and GET /payment-methods | Sanctum. Both route declarations include check.status but their route names are allowlisted by that middleware; neither requires profile completion. | Missing/invalid token: HTTP 401. These allowlisted routes do not return the verification-gate error; controller validation and business errors still apply. |
| Account, cart mutations, subscription checkout/lifecycle, and order routes under their documented route groups | Sanctum plus the route's declared verification and/or profile-completion middleware. Allowlisted routes may bypass one or both account gates; see each operation's contract. | Missing/invalid token: HTTP 401. Verification/profile gate failures use their JSON error envelopes, commonly HTTP 200. KYC-gated withdrawal routes have an additional middleware configuration caveat in Known gaps. |
POST /foodics/webhook, POST /payment/webhook | Public route declarations. Foodics additionally supports configured X-Foodics-Webhook-Secret verification and both webhooks are throttled. | Foodics secret mismatch: HTTP 401. The payment webhook action is currently unresolved; do not treat it as a working authenticated or public API. |
{
"message": "Unauthenticated."
}In the following middleware example, is_ban is the raw account status field (shown as enabled); the denial is caused by the unverified flags.
{
"remark": "unverified",
"status": "error",
"message": {
"error": ["You need to verify your account first."]
},
"data": {
"is_ban": 1,
"email_verified": 0,
"mobile_verified": 0,
"twofa_verified": 0
}
}{
"remark": "profile_incomplete",
"status": "error",
"message": {
"error": ["Please complete your profile to go next"]
}
}The middleware-denial examples are distinct from controller validation errors. A foreign record can return either 403 or 404 depending on the operation; use that endpoint's contract rather than assuming one global ownership response. For every response, check the HTTP status and the JSON status/remark.
Authorization header using Bearer <ACCESS_TOKEN>.check.status requires enabled account and verification flags (status, email, mobile, and 2FA where applicable); routes on its allowlist have relaxed checks.registration.complete requires completed profile except for allowlisted browsing/profile/address routes."status": "success"./api/foodics/webhook and /api/payment/webhook are unauthenticated route declarations. The payment webhook route currently points to a handler not found in the API payment controller; see Payments.All routes in this section are public GET endpoints unless specified.
| Method & path | Request | Result & conditions |
|---|---|---|
GET/general-setting | None | data.general_setting includes the public site_name field. |
GET/onboarding | None | Returns active intro screens in sort order and the first active get-started screen. Fields include text/localized text, image, background colors/type, and sort order. |
GET/faqs | None | Returns active FAQs grouped by category, plus category names. |
GET/faqs/{id} | Path id | Returns FAQ details. A missing ID is a framework 404. This detail route does not apply the active-only filter used by list/search routes. |
GET/faqs/category/{category} | Path category | Returns active FAQs for the category, sorted by configured order. |
GET/faqs/search/query?q={text} | Optional query q | Searches active FAQ question/answer text. Empty/missing q is not explicitly validated. |
GET/support/help | None | Returns the configured static support-method descriptors (WhatsApp, email, phone). |
GET/contact | None | Returns active contact methods/configuration. |
GET/get-countries | None | Returns countries with country name, dialing code, and country code from the bundled country data. |
The endpoints below are public GET requests with no authentication, request body, endpoint-specific query parameters, or pagination unless stated. The API-wide optional ?lang=en or ?lang=ar selector still applies. Send Accept: application/json. Each endpoint documents its empty-result behavior and any endpoint-defined error. A successful empty result still has status: "success"; it is not an API error.
GET /general-settingReturns remark: "general_setting" and data.general_setting. The endpoint selects only site_name; it does not expose the full private/admin settings record. If no settings row exists, general_setting is null. No endpoint-specific validation errors are defined.
{
"remark": "general_setting",
"status": "success",
"message": {"success": ["General setting data"]},
"data": {
"general_setting": {"site_name": "Be Healthy"}
}
}
Empty data: if the settings table has no row, this endpoint still succeeds and returns general_setting: null. There is no endpoint-specific 4xx response.
{
"remark": "general_setting",
"status": "success",
"message": {"success": ["General setting data"]},
"data": {"general_setting": null}
}
GET /onboardingReturns remark: "onboarding_data", ordered active intro data.screens[], and the first active, ordered data.get_started screen (or null). Screens are sorted by sort_order, then ID. Each screen contains ID/type/language; title, highlight, subtitle and button text with localized variants; image URL or null; background type/colors/angle; text color; and sort order. The endpoint does not filter records by their language field; it chooses localized text for Arabic requests when a localized value exists. No active intro screens means an empty array.
{
"remark": "onboarding_data",
"status": "success",
"message": {"success": ["Onboarding screens loaded"]},
"data": {
"screens": [
{
"id": 1,
"screen_type": "intro",
"language": "en",
"title": "Eat well",
"title_localized": null,
"highlight": "Feel better",
"highlight_localized": null,
"subtitle": "Healthy meals for every day",
"subtitle_localized": null,
"button_text": "Next",
"button_text_localized": null,
"image": "https://example.com/onboarding.png",
"background": {
"type": "solid",
"start_color": "#f4e7d6",
"end_color": "#e7d9c1",
"angle": 90
},
"background_color": "#f4e7d6",
"text_color": "#1d4d3c",
"sort_order": 1
}
],
"get_started": null
}
}
Empty data: when there are no active intro or get-started screens, both values are empty/null. The endpoint does not return a validation error for an empty configuration.
{
"remark": "onboarding_data",
"status": "success",
"message": {"success": ["Onboarding screens loaded"]},
"data": {
"screens": [],
"get_started": null
}
}
GET /faqsReturns active FAQs ordered by category and configured sort order. data.categories[] contains the category keys; data.faqs is an object keyed by category, each value an array of id, category, question, and answer. Categories with no active FAQs are absent. An empty result is a successful empty collection.
{
"remark": "faq_list",
"status": "success",
"message": {"success": ["FAQs loaded"]},
"data": {
"categories": ["Orders"],
"faqs": {
"Orders": [
{
"id": 4,
"category": "Orders",
"question": "How can I track my order?",
"answer": "Open order details in your account."
}
]
}
}
}
Empty data: when no active FAQs exist, the grouped collection serializes as an empty list and there are no categories. This is HTTP 200, not 404.
{
"remark": "faq_list",
"status": "success",
"message": {"success": ["FAQs loaded"]},
"data": {
"categories": [],
"faqs": []
}
}
GET /faqs/{id}Path id is the FAQ record ID; no explicit validation rule is applied. Success returns remark: "faq_detail" and data.faq with ID/category/question/answer. Unlike the list, category, and search endpoints, this handler does not filter inactive FAQs. A missing ID uses Laravel's not-found response (404).
{
"remark": "faq_detail",
"status": "success",
"message": {"success": ["FAQ loaded"]},
"data": {
"faq": {
"id": 4,
"category": "Orders",
"question": "How can I track my order?",
"answer": "Open order details in your account."
}
}
}
Error: a nonexistent FAQ ID is handled by Laravel as HTTP 404. In production JSON mode, the framework returns the model-not-found message; debug configuration may expose additional exception details.
{
"message": "No query results for model [App\\Models\\Faq] 999"
}
GET /faqs/category/{category}The category is a path string matched exactly. Returns active FAQs ordered by sort_order as data.faqs[] with ID/question/answer, plus the requested data.category. No explicit category validation; an unknown category returns an empty list.
{
"remark": "faq_by_category",
"status": "success",
"message": {"success": ["FAQs loaded"]},
"data": {
"category": "Orders",
"faqs": [
{
"id": 4,
"question": "How can I track my order?",
"answer": "Open order details in your account."
}
]
}
}
Empty data: an unknown category or one without active FAQs returns the requested category and an empty array, with HTTP 200.
{
"remark": "faq_by_category",
"status": "success",
"message": {"success": ["FAQs loaded"]},
"data": {
"category": "Unknown category",
"faqs": []
}
}
GET /faqs/search/query?q={text}Optional query string q is matched case-insensitively as a substring against active FAQ question or answer text. Results are ordered by sort_order. Returns data.query, data.results_count, and data.faqs[] with ID/category/question/answer. There is no pagination or explicit input validation; a missing/empty query is not rejected and is still used to form the SQL LIKE pattern, so its result depends on stored values.
{
"remark": "faq_search",
"status": "success",
"message": {"success": ["Search results loaded"]},
"data": {
"query": "track",
"results_count": 1,
"faqs": [
{
"id": 4,
"category": "Orders",
"question": "How can I track my order?",
"answer": "Open order details in your account."
}
]
}
}
Empty data: a search term with no matches returns HTTP 200 with results_count: 0 and an empty faqs array. No query-validation error is defined; if q is omitted, the response's query is null.
{
"remark": "faq_search",
"status": "success",
"message": {"success": ["Search results loaded"]},
"data": {
"query": "no-matching-question",
"results_count": 0,
"faqs": []
}
}
GET /support/helpReturns three static choices in data.support_methods[]: WhatsApp, email, and phone. Each contains id, name, description, icon, and color. These are informational choices; contact values are provided separately by GET /contact. This handler always constructs the three choices, so it has no configured empty state or endpoint-specific error response; only framework/runtime failures can prevent a response.
GET /contactReturns active contact-option records ordered by sort_order, then ID, in data.contact_options[]. Each has id, label, type, value, and details. Contact values/details are admin-configured and returned as stored; this handler does not localize those fields. No filters or explicit validation; no active options yields an empty array.
{
"remark": "support_help",
"status": "success",
"message": {"success": ["Help options loaded"]},
"data": {
"support_methods": [
{
"id": "whatsapp",
"name": "WhatsApp Support",
"description": "Chat instantly with our support team",
"icon": "whatsapp",
"color": "#25D366"
}
]
}
}
{
"remark": "contact_options",
"status": "success",
"message": {"success": ["Contact options loaded"]},
"data": {
"contact_options": [
{
"id": 1,
"label": "Email us",
"type": "email",
"value": "support@example.com",
"details": null
}
]
}
}
Empty data: if there are no active configured contact options, the endpoint returns an empty array with HTTP 200. No endpoint-specific validation error is defined.
{
"remark": "contact_options",
"status": "success",
"message": {"success": ["Contact options loaded"]},
"data": {"contact_options": []}
}
GET /get-countriesReturns remark: "country_data" and data.countries[] built from the bundled country JSON. Each item has country (display name), dial_code, and country_code (the source JSON key, generally a two-letter code). This endpoint does not accept a country filter; clients can filter the returned array locally. The returned list is driven by the bundled resource rather than a live country/provider API.
{
"remark": "country_data",
"status": "success",
"message": {"success": ["General setting data"]},
"data": {
"countries": [
{"country": "United Arab Emirates", "dial_code": "971", "country_code": "AE"},
{"country": "United States", "dial_code": "1", "country_code": "US"}
]
}
}
Empty data: if the bundled country JSON contains no entries, the route returns countries: [] with HTTP 200. The route has no country-filter validation or custom error envelope. A missing or unreadable bundled file is a server/runtime failure, not an empty-list response.
{
"remark": "country_data",
"status": "success",
"message": {"success": ["General setting data"]},
"data": {"countries": []}
}
POST /support/ticketPOST /support/ticket is an authenticated account endpoint; it is not public. Requires Sanctum, a verified account, and a completed profile. Send JSON when there is no attachment, or multipart/form-data when uploading one. Required: full_name (string ≤255), valid email (≤255), subject (string ≤255), and message (string). Optional: phone (string ≤20), attachment (file ≤5120 KB; PDF, DOC, DOCX, JPG, JPEG, PNG). Success creates an open, normal-priority ticket and returns data.ticket_id and formatted TKT-000001-style reference_number; authenticated user receives a notification. Field/file validation returns HTTP 422 with field errors; upload failure returns HTTP 400 with remark: "file_error". Missing/invalid authentication is HTTP 401. The verification and profile middleware can instead return HTTP 200 with status: "error". An attachment is optional.
{
"full_name": "Customer Name",
"email": "customer@example.com",
"phone": "+971501234567",
"subject": "Order question",
"message": "Please help me with my order."
}
{
"remark": "support_ticket_created",
"status": "success",
"message": {"success": ["Support ticket submitted successfully"]},
"data": {
"ticket_id": 25,
"reference_number": "TKT-000025"
}
}
Validation error: Laravel's validator returns HTTP 422 and field-keyed arrays in message. This example shows required fields missing.
{
"remark": "validation_error",
"status": "error",
"message": {
"full_name": ["The full name field is required."],
"email": ["The email field is required."],
"subject": ["The subject field is required."],
"message": ["The message field is required."]
}
}
An unsupported or oversized attachment can also return HTTP 422 with an attachment error. If the file upload itself fails after validation, the controller returns HTTP 400:
{
"remark": "file_error",
"status": "error",
"message": {
"error": ["Couldn't upload attachment"]
}
}
Authentication and account middleware errors occur before ticket validation. A missing/invalid bearer token returns HTTP 401; an authenticated user who is unverified or has not completed registration receives the corresponding HTTP 200 error envelope. In the verification response, is_ban is the middleware's raw account status value, not a separately calculated ban flag.
{
"message": "Unauthenticated."
}
{
"remark": "unverified",
"status": "error",
"message": {
"error": ["You need to verify your account first."]
},
"data": {
"is_ban": 1,
"email_verified": 0,
"mobile_verified": 1,
"twofa_verified": 1
}
}
{
"remark": "profile_incomplete",
"status": "error",
"message": {
"error": ["Please complete your profile to go next"]
}
}
| Method & path | Request | Result & errors |
|---|---|---|
POST/auth/login | username or email, and password (required strings). | Success returns the user and a Sanctum access_token (token_type: "Bearer"). Invalid credentials/input return an error envelope; current controller branches may use HTTP 200. Administrative accounts are not accepted as customer API logins. |
POST/auth/register | Required: email, integer mobile, password, password_confirmation, mobile_code, country_code, country. Optional: firstname, lastname, username, captcha, agree (required only when configured), reference. | Email/mobile/username uniqueness and configured country data are checked. Username must use permitted lowercase alphanumeric/underscore characters and meet minimum length. Password must meet minimum length and configured security policy. Success creates the customer and returns user/token data. Manual validation errors may use HTTP 200. Foodics customer-sync failure does not undo successful account creation. |
GET/auth/logout | Sanctum | Revokes all personal access tokens for the current user. |
GET/logout | Sanctum | Alias for logout; revokes all current user's tokens. |
Example login:
{
"username": "customer@example.com",
"password": "your-password"
}
All OTP routes are public.
| Method & path | Required body | Conditions & response |
|---|---|---|
POST/auth/otp/request | mobile_code, mobile (5–15 digits), country_code (two characters) | Dial code and country code must correspond. Success returns code expiry (300s) and resend wait (60s). Validation/country mismatch: 422; cooldown/rate limit: 429; Twilio unavailable: 503; delivery failure: 502. |
POST/auth/otp/resend | mobile_code, mobile | Resends an active challenge. Missing/expired challenge: 422; cooldown/rate limit: 429. Success includes expiry and resend interval. |
POST/auth/otp/verify | mobile_code, mobile, four-digit otp | Incorrect/expired code: 422; excessive failed attempts: 429. Existing active account is verified and receives a bearer token. New phone receives profile_required and a time-limited profile_token (15 minutes). Unavailable account: 403. |
POST/auth/otp/complete-profile | profile_token, full_name (?255); optional unique email, gender (male/female), date_of_birth (YYYY-MM-DD) | Creates account from verified phone. Expired token: 422; existing phone account: 409. Success returns user and bearer token. Foodics sync failure is non-fatal. |
| Method & path | Request | Conditions & response |
|---|---|---|
POST/auth/password/email | value string containing email or username | Sends a six-digit reset code by email. Success returns target email and 600-second expiry (not the code). Missing account: 404; throttled: 429; delivery failure: 503; validation: 422. |
POST/auth/password/verify-code | email, six-character code | Success returns reset_token and expiry. Invalid/expired: 422; missing account: 404; throttled: 429. |
POST/auth/password/reset | email, token (min 32), password, password_confirmation | Password minimum is six characters and may include configured complexity requirements. Invalid/expired token: 422; missing account: 404. Success changes password and invalidates reset token. |
GET/authorization | Sanctum | Returns/sends whichever email, SMS, or 2FA verification is currently required based on account flags. Already-verified/account errors may be HTTP 200. |
GET/resend-verify/{type} | Sanctum; path type | type=email sends email code; other values use SMS behavior. Two-minute resend window returns a wait/error message (currently commonly HTTP 200). |
POST/verify-email | Sanctum; code | Verifies email. Missing/incorrect code returns error JSON (manual branches may be HTTP 200). |
POST/verify-mobile | Sanctum; code | Verifies mobile. Missing/incorrect code returns error JSON (manual branches may be HTTP 200). |
POST/verify-g2fa | Sanctum; code | Confirms 2FA. Missing/incorrect code returns error JSON (manual branches may be HTTP 200). |
All token values shown here are fictional sample values for illustrating JSON shape. They are not real credentials and will not authenticate.
Each operation below lists its authentication requirement, request fields, successful response shape, and endpoint-specific failures with HTTP statuses. Login and registration use manual validation branches that return an error envelope with HTTP 200; the OTP and password-recovery APIs generally use explicit 4xx/5xx statuses. For every error, branch on both the HTTP status and JSON status/remark; do not treat HTTP 200 alone as success.
POST /auth/login or POST /auth/register for email/password accounts. For phone-first registration, call POST /auth/otp/request, then /auth/otp/verify; existing active users receive a bearer token, while new phone numbers receive a short-lived profile token that must be exchanged using /auth/otp/complete-profile. Send returned access tokens as Authorization: Bearer <ACCESS_TOKEN> to Sanctum routes. Password recovery is a separate three-step flow: request email code, verify it to obtain a reset token, then submit that token with the new password. Never log or persist OTPs/profile/reset/access tokens in client logs.
| Endpoint group | Authentication | Typical error statuses | Notes |
|---|---|---|---|
POST /auth/login, POST /auth/register | Public | Manual input/credential errors use HTTP 200 with status: "error". | Always inspect the JSON status. Admin accounts cannot use customer login. |
POST /auth/otp/* | Public | 422 validation/challenge errors, 403 unavailable account, 409 existing account at profile completion, 429 throttling, 502 SMS delivery, 503 SMS not configured. | Phone OTP expires in 5 minutes; resend wait is 60 seconds; new-user profile token expires in 15 minutes. |
POST /auth/password/* | Public | 422 invalid/expired inputs or tokens, 404 unknown account, 429 rate limit, 503 email delivery. | Email code and resulting reset token each expire in 10 minutes. |
GET /auth/logout, GET /logout, GET /authorization, GET /resend-verify/{type}, POST /verify-* | Sanctum | 401 unauthenticated; application verification errors often use HTTP 200 with status: "error". | Verification codes use the account's configured email/SMS/2FA mechanism; resend has a two-minute cooldown. |
/auth/login · LoginPublic; no bearer token is needed. Send email or username plus a string password. If both identity fields are supplied, username takes precedence; otherwise, a valid email address selects email lookup and any other identity selects username lookup. It does not accept a phone number as a login identity. Administrative identities are rejected even if their credentials are correct. A successful login creates a Sanctum token and records the login; token_type is Bearer.
{
"email": "customer@example.com",
"password": "your-password"
}
Success · HTTP 200
{
"remark": "login_success",
"status": "success",
"message": {
"success": [
"Login Successful"
]
},
"data": {
"user": {
"id": 123,
"email": "customer@example.com"
},
"access_token": "<ACCESS_TOKEN_FROM_RESPONSE>",
"token_type": "Bearer"
}
}
Validation / invalid credentials · HTTP 200 in the current controller
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"Unauthorized user"
]
}
}
Missing identity/password also uses HTTP 200 and remark: "validation_error"; the selected identity field depends on the submitted value. Keep the error message as returned rather than depending on a particular ordering.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The username field is required.",
"The password field is required."
]
}
}
Missing or invalid bearer credentials on a protected endpoint (not on login itself) return HTTP 401 using Laravel's authentication response:
{
"message": "Unauthenticated."
}
/auth/register · RegisterPublic; no bearer token is needed. Required: email (valid and unique), integer mobile, password, matching password_confirmation, and mobile_code, country_code, and country values from the bundled country list. Optional: firstname/lastname (strings up to 255), username (unique alphanumeric, minimum six characters; it must also pass the controller's lowercase letters/digits/underscore check), captcha (required when CAPTCHA is enabled), agree (required when configured), and string reference. If username is omitted, the controller generates one from the email. Password is at least six characters; configured secure-password policy additionally requires mixed case, numbers, symbols, and an uncompromised password. The endpoint returns HTTP 200 for both successful registration and its manual validation errors. It creates a customer Sanctum token; Foodics customer-sync failure is logged and does not undo registration.
{
"firstname": "Sam",
"lastname": "Example",
"email": "sam@example.com",
"mobile": 501234567,
"mobile_code": "+971",
"country_code": "AE",
"country": "United Arab Emirates",
"username": "sam_example",
"password": "Example!234",
"password_confirmation": "Example!234",
"agree": true
}
Success · HTTP 200. A Foodics sync failure does not cancel account creation.
{
"remark": "registration_success",
"status": "success",
"message": {
"success": [
"Registration successful"
]
},
"data": {
"access_token": "<ACCESS_TOKEN_FROM_RESPONSE>",
"user": {
"id": 123,
"email": "sam@example.com",
"username": "sam_example"
},
"token_type": "Bearer"
}
}
Validation / duplicate email, mobile, or invalid fields · HTTP 200 in the current controller.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The email has already been taken."
]
}
}
Other registration failures use the same HTTP-200 error envelope, with a message describing the failed rule. A duplicate phone number is checked after field validation; an unsupported username character is checked after the framework validator.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["The mobile number already exists"]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["No special character, space or capital letters in username."]
}
}
/auth/otp/request · Request SMS codePublic; no bearer token is needed. mobile_code must match +?[0-9]{1,5}, mobile must contain 5–15 digits, and country_code must be two characters. After syntax validation, the country and dialing code are checked against the bundled country list. The challenge is keyed by the normalized dialing code plus phone digits; the OTP is sent by SMS and is not included in the response. A phone can request one code per 60 seconds and at most five per hour; an IP is limited to 20 requests per hour.
{
"mobile_code": "+971",
"mobile": "501234567",
"country_code": "AE"
}
Success · HTTP 200. The code is sent by SMS and is never returned in the response; it expires in 300 seconds.
{
"remark": "otp_sent",
"status": "success",
"message": {
"success": [
"Verification code sent."
]
},
"data": {
"mobile": "+971501234567",
"expires_in": 300,
"resend_after": 60
}
}
Validation · HTTP 422; cooldown/rate limit · HTTP 429; Twilio not configured · HTTP 503; SMS delivery failure · HTTP 502.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The selected country and dial code do not match."
]
},
"data": {}
}
{
"remark": "resend_cooldown",
"status": "error",
"message": {
"error": ["Please wait before requesting another code."]
},
"data": {
"retry_after": 37
}
}
{
"remark": "otp_rate_limited",
"status": "error",
"message": {
"error": ["Too many OTP requests. Please try again later."]
},
"data": {}
}
{
"remark": "sms_not_configured",
"status": "error",
"message": {
"error": ["Twilio SMS is not configured. Contact support."]
},
"data": {}
}
{
"remark": "otp_delivery_failed",
"status": "error",
"message": {
"error": ["We could not send your verification code. Please try again later."]
},
"data": {}
}
/auth/otp/resend · Resend SMS codePublic; no bearer token is needed. Requires an existing, unexpired OTP challenge; mobile_code and mobile identify the same normalized phone used for the original request. The code is replaced by a newly delivered code. The same 60-second cooldown and per-phone/per-IP hourly limits apply as for an initial request; invalid field formats return HTTP 422.
{
"mobile_code": "+971",
"mobile": "501234567"
}
Success · HTTP 200. The response has remark: "otp_resent" and the same expiry/resend fields as the request-code endpoint. Missing/expired challenge · HTTP 422; cooldown/rate limit · HTTP 429.
{
"remark": "otp_resent",
"status": "success",
"message": {
"success": ["Verification code sent."]
},
"data": {
"mobile": "+971501234567",
"expires_in": 300,
"resend_after": 60
}
}
{
"remark": "otp_expired",
"status": "error",
"message": {
"error": [
"Request a new verification code to continue."
]
},
"data": {}
}
{
"remark": "resend_cooldown",
"status": "error",
"message": {
"error": ["Please wait before requesting another code."]
},
"data": {
"retry_after": 37
}
}
Phone/IP hourly rate limit · HTTP 429 (no retry-after field is included in this branch):
{
"remark": "otp_rate_limited",
"status": "error",
"message": {
"error": ["Too many OTP requests. Please try again later."]
},
"data": {}
}
Resend uses the same SMS-provider configuration and delivery branches as the initial request. It can therefore also return the documented sms_not_configured (HTTP 503) and otp_delivery_failed (HTTP 502) error envelopes shown above.
{
"remark": "sms_not_configured",
"status": "error",
"message": {
"error": ["Twilio SMS is not configured. Contact support."]
},
"data": {}
}
{
"remark": "otp_delivery_failed",
"status": "error",
"message": {
"error": ["We could not send your verification code. Please try again later."]
},
"data": {}
}
/auth/otp/verify · Verify SMS codePublic; no bearer token is needed. Requires mobile_code, 5–15 digit mobile, and a four-digit otp. Challenges expire after five minutes. Five incorrect submissions are allowed; subsequent attempts are blocked with HTTP 429 and the challenge is removed, so request a new code. A correct code for an existing active account sets its mobile-verified flag and returns an access token; a correct code for a new number returns a profile token. An existing inactive/banned account returns HTTP 403 and is not logged in.
{
"mobile_code": "+971",
"mobile": "501234567",
"otp": "1234"
}
New phone success · HTTP 200; profile_token expires in 900 seconds.
{
"remark": "profile_required",
"status": "success",
"message": {
"success": [
"Phone number verified. Complete your profile to create your account."
]
},
"data": {
"is_new_user": true,
"profile_required": true,
"profile_token": "<PROFILE_TOKEN_FROM_RESPONSE>",
"expires_in": 900
}
}
Invalid/expired code · HTTP 422; too many incorrect attempts · HTTP 429; unavailable existing account · HTTP 403. An existing active user instead receives user, access_token, and token_type.
{
"remark": "invalid_otp",
"status": "error",
"message": {
"error": [
"The verification code is incorrect."
]
},
"data": {}
}
Existing active account success · HTTP 200 (user details are returned as the serialized user model):
{
"remark": "login_success",
"status": "success",
"message": {
"success": ["Login successful."]
},
"data": {
"is_new_user": false,
"profile_required": false,
"user": {
"id": 123,
"mobile": "971501234567"
},
"access_token": "<ACCESS_TOKEN_FROM_RESPONSE>",
"token_type": "Bearer"
}
}
{
"remark": "otp_attempts_exceeded",
"status": "error",
"message": {
"error": ["Too many incorrect codes. Request a new one."]
},
"data": {}
}
{
"remark": "account_unavailable",
"status": "error",
"message": {
"error": ["This account is unavailable. Contact support for help."]
},
"data": {}
}
/auth/otp/complete-profile · Complete SMS registrationPublic; the 64-character profile_token is the proof of phone verification (do not send a bearer token in its place). full_name is required and at most 255 characters. Optional fields are a unique valid email (maximum 255 characters), gender (male or female), and date_of_birth in YYYY-MM-DD format. The profile token expires after 15 minutes. A successful response creates the user, marks the verified phone, and returns a Sanctum access token; Foodics sync failure is non-fatal.
{
"profile_token": "<PROFILE_TOKEN_FROM_RESPONSE>",
"full_name": "Sam Example",
"email": "sam@example.com",
"gender": "female",
"date_of_birth": "1995-04-23"
}
Success · HTTP 200; returns the created user and Sanctum bearer token. Foodics sync failure is non-fatal.
{
"remark": "registration_success",
"status": "success",
"message": {
"success": [
"Profile completed successfully."
]
},
"data": {
"is_new_user": false,
"profile_required": false,
"user": {
"id": 123,
"mobile": "971501234567"
},
"access_token": "<ACCESS_TOKEN_FROM_RESPONSE>",
"token_type": "Bearer"
}
}
Invalid/expired token or fields · HTTP 422; phone account already exists · HTTP 409.
{
"remark": "verification_expired",
"status": "error",
"message": {
"error": [
"Phone verification expired. Request and verify a new code."
]
},
"data": {}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The full name field is required.",
"The email must be a valid email address."
]
},
"data": {}
}
{
"remark": "account_exists",
"status": "error",
"message": {
"error": ["An account already exists for this phone number. Please log in."]
},
"data": {}
}
/auth/password/email · Request password reset codePublic; no bearer token is needed. value is required as a string and may be the account email or username (email syntax selects email lookup; every other value is treated as a username). No code is returned in JSON. The generated six-digit email code expires after 600 seconds. Requests are limited to three attempts per 10 minutes per normalized value and client IP. A nonexistent account returns HTTP 404; delivery failure returns HTTP 503.
{
"value": "customer@example.com"
}
Success · HTTP 200.
{
"remark": "code_sent",
"status": "success",
"message": {
"success": [
"Verification code sent to mail"
]
},
"data": {
"email": "customer@example.com",
"expires_in": 600
}
}
Missing account · HTTP 404; rate limit · HTTP 429; mail delivery failure · HTTP 503; missing value · HTTP 422.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The value field is required."
]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Couldn't find any account with this information"]
}
}
{
"remark": "email_delivery_failed",
"status": "error",
"message": {
"error": ["Unable to send the reset code. Please check SMTP settings."]
}
}
{
"remark": "too_many_requests",
"status": "error",
"message": {
"error": ["Too many OTP requests. Please try again later."]
},
"data": {
"retry_after": 240
}
}
/auth/password/verify-code · Verify reset codePublic; no bearer token is needed. Requires a valid email and a six-character code delivered to that account. The code expires after 10 minutes. A valid code is replaced with a separate 64-character reset token that expires after another 10 minutes; the OTP cannot be reused. Failed verification attempts are limited to five per 10 minutes per email and client IP; after the limit, request a new code.
{
"email": "customer@example.com",
"code": "123456"
}
Success · HTTP 200.
{
"remark": "verified",
"status": "success",
"message": {
"success": [
"Verification successful. You can change your password."
]
},
"data": {
"email": "customer@example.com",
"reset_token": "<RESET_TOKEN_FROM_RESPONSE>",
"expires_in": 600
}
}
Invalid/expired code · HTTP 422; missing account · HTTP 404; too many attempts · HTTP 429.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"Verification code doesn't match"
]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Couldn't find any account with this email."]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Verification code has expired. Please request a new code."]
}
}
{
"remark": "too_many_requests",
"status": "error",
"message": {
"error": ["Too many verification attempts. Please request a new code."]
},
"data": {
"retry_after": 240
}
}
/auth/password/reset · Set new passwordPublic; no bearer token is needed. Requires the same email that received the reset code, the verified reset token (string, minimum 32 characters), and a password with matching password_confirmation. Password minimum is six characters; if secure-password policy is enabled it must also contain mixed case, numbers, and symbols and pass the uncompromised-password check. The reset token expires after 10 minutes and is invalidated after successful password change; all outstanding reset records for that email are then deleted.
{
"email": "customer@example.com",
"token": "<RESET_TOKEN_FROM_RESPONSE>",
"password": "NewExample!234",
"password_confirmation": "NewExample!234"
}
Success · HTTP 200. The reset token is invalidated.
{
"remark": "password_changed",
"status": "success",
"message": {
"success": [
"Password changed successfully"
]
}
}
Invalid/expired token or password rules · HTTP 422; missing account · HTTP 404.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"Invalid or expired reset token."
]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Couldn't find the account."]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The password confirmation does not match."
]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Reset token has expired. Please request a new password reset code."]
}
}
/auth/logout · LogoutRequires Authorization: Bearer <ACCESS_TOKEN>. No request body. Revokes all personal access tokens for the current user.
{
"remark": "logout",
"status": "ok",
"message": {
"success": [
"Logout Successful"
]
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
/logout · Logout aliasSame Sanctum authentication and behavior as /auth/logout. No request body; all current-user tokens are revoked.
{
"remark": "logout",
"status": "ok",
"message": {
"success": ["Logout Successful"]
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
/authorization · Start account verificationRequires a bearer token. No request body. Checks account state in this order: inactive/banned status, email verification, mobile verification, then 2FA. For email or SMS it creates and sends a six-digit verification code only if the previous code is no longer within its two-minute validity window. For an inactive/banned account it does not send a code, but still returns the generic code_sent success envelope. The response does not identify which verification type is required; for 2FA, submit the configured authenticator code to POST /verify-g2fa. If no verification step remains, it returns an error-status envelope with HTTP 200.
{
"remark": "code_sent",
"status": "success",
"message": {
"success": [
"Verify your account"
]
}
}
Already verified returns remark: "already_verified", status: "error", and an error message (controller currently uses HTTP 200). No request-body validation applies.
{
"remark": "already_verified",
"status": "error",
"message": {
"error": ["You are already verified"]
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
/resend-verify/{type} · Resend verification codeRequires a bearer token. Replace {type} with email to send email; every other path value follows the SMS branch. No request body. A two-minute resend cooldown applies based on the user's most recent verification-code timestamp. This route does not enforce that the requested type matches the account's current unverified flag.
{
"remark": "code_sent",
"status": "success",
"message": {
"success": [
"Verification code sent successfully"
]
}
}
During cooldown, returns remark: "validation_error" and a wait message (controller currently uses HTTP 200). No request-body validation applies.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Please try after 83 seconds"]
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
/verify-email · Verify emailRequires a bearer token and a code from the email verification message.
{
"code": "123456"
}
Success · HTTP 200.
{
"remark": "email_verified",
"status": "success",
"message": {
"success": [
"Email verified successfully"
]
}
}
Missing/incorrect code returns remark: "validation_error", status: "error" (manual branches currently use HTTP 200). Example: {"message":{"error":["Verification code doesn't match"]}}.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["The code field is required."]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Verification code doesn't match"]
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
/verify-mobile · Verify mobileRequires a bearer token and an SMS code.
{
"code": "123456"
}
Success · HTTP 200.
{
"remark": "mobile_verified",
"status": "success",
"message": {
"success": [
"Mobile verified successfully"
]
}
}
Missing/incorrect code returns a validation_error envelope; current manual error branches use HTTP 200.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["The code field is required."]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Verification code doesn't match"]
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
/verify-g2fa · Verify two-factor codeRequires a bearer token and the user's current 2FA code.
{
"code": "123456"
}
Success · HTTP 200.
{
"remark": "twofa_verified",
"status": "success",
"message": {
"success": [
"Verification successful"
]
}
}
Missing/incorrect code returns validation_error; current manual error branches use HTTP 200.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["The code field is required."]
}
}
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Wrong verification code"]
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
| Method & path | Request | Result & conditions |
|---|---|---|
GET/daily-order-home | Public; optional lang | Home payload includes locale, banner, announcements, active branches with daily-order hours/status, categories/products, trending/most-loved products, currency, and (when Sanctum-authenticated) user/cart/recent-order data. Top-level daily_order_status reports whether any branch is open. When all branches are closed, it includes a message and next opening; product/category arrays are empty. |
GET/categories | Public; optional lang | Returns active Be Healthy Foodics categories. Add-on/deleted/inactive categories are excluded. |
GET/products | Public. Optional category_id, category or meal_type, search, min_price, max_price, sort. | Lists eligible Be Healthy Foodics products. Search is substring-based; price bounds are numeric comparisons. sort: latest (default), price_asc, price_desc, title. Parameters are not explicitly validated. Response includes count, currency, product list, and filter metadata. Unlike home/detail, this handler does not explicitly filter local daily-menu channels. |
GET/products/{id} | Public; path product ID | Returns product details, currency, ratings, ingredients, and customization groups/options. Disabled/missing product, missing Foodics mapping, or product failing Foodics brand/active/ready/stock checks returns 404. |
GET/products/{id}/reviews | Sanctum bearer token; optional per_page, page | per_page defaults to 10 and is clamped to 1–50. Returns average, count, 1–5 distribution, and paginated reviews. Missing product: 404. Verification/profile completion is not required by these route middleware allowlists. |
POST/products/{id}/wishlist/toggle | Sanctum bearer token; no body | Adds or removes the caller's wishlist item; response reports wishlist_status (added/removed) and is_wishlist. Missing product: 404. Verification/profile completion is not required by the route middleware allowlists. |
The browse endpoints below are public unless noted. They have no request body. They are backed by Foodics and/or local catalog data as described for each operation. IDs, prices, image URLs, localized text, and provider fields in examples are illustrative; use values returned by the live API.
GET /daily-order-homeOptional language selection uses the API's ?lang=en or ?lang=ar convention. The route is public; if a valid Sanctum token is supplied, the response additionally includes that user's account/cart/order/subscription information. There are no other query parameters or pagination.
GET /api/daily-order-home?lang=en Accept: application/json
The top-level data includes locale, optional user, is_authenticated, banner, announcements[], enabled branches[] with daily_order_hours and daily_order_availability, daily_order_status, daily-menu categories[] with nested products, trending_meals[], most_loved[], currency, and authenticated-only cart, daily_order, and recent_orders[]. Guests receive null/empty values for the authenticated-only fields. If all branches are closed, daily_order_status contains the closed message and next opening, and the category/product arrays are empty. Home-feed products come from enabled local dishes marked for the daily menu; they are not the same source/filter as GET /products.
Each home-feed product includes the local product ID, localized title/category, Foodics product ID, menu channels, cart flag, price/formatted price, calories, image, ingredients, and rating summary. A category includes Foodics/local ID, localized name, reference, image, and its products. Errors from the catalog/database integrations can result in a provider/framework error response.
{
"remark": "daily_order_home",
"status": "success",
"message": {"success": ["Home"]},
"data": {
"locale": "en",
"user": null,
"is_authenticated": false,
"banner": null,
"announcements": [],
"branches": [
{"id": 3, "name": "Dubai Branch", "daily_order_availability": {"is_open": true}}
],
"daily_order_status": {"is_open": true, "message": null, "next_opening": null},
"categories": [
{
"id": 14,
"local_id": 3,
"name": "Meals",
"name_localized": null,
"reference": "BH-MEALS",
"image": "https://example.com/category.png",
"image_url": "https://example.com/category.png",
"products": [
{
"id": 12,
"title": "Chicken Bowl",
"title_localized": null,
"category_id": 14,
"category": "Meals",
"category_localized": null,
"meal_type": "Meals",
"foodics_product_id": "foodics-product-id",
"menu_channels": ["daily"],
"is_in_cart": false,
"price": 45,
"price_formatted": "AED 45.00",
"calories": 500,
"image": "https://example.com/product.png",
"ingredients": [],
"avg_rating": 0,
"total_rating": 0
}
]
}
],
"trending_meals": [],
"most_loved": [],
"cart": null,
"daily_order": null,
"recent_orders": [],
"currency": {"code": "AED", "symbol": "AED", "position": "before"}
}
}
GET /categoriesNo request fields. Returns remark: "categories", the resolved data.locale, and data.categories[] containing localized Foodics category objects, including the category image when Foodics supplies one. The image is passed through in Foodics' original shape (commonly an object with a url); it may be null or absent when no image is configured. This endpoint does not generate a fallback image URL. The controller filters categories to the Be Healthy brand, excludes names/references containing “addon”, and excludes deleted or inactive categories; results are sorted by localized display name. An empty result is a successful empty array. Foodics/provider failures may return a framework/provider error.
GET /api/categories?lang=en Accept: application/json
{
"remark": "categories",
"status": "success",
"message": {"success": ["Category list"]},
"data": {
"locale": "en",
"categories": [
{
"id": "foodics-category-id",
"name": "Meals",
"name_localized": null,
"reference": "BH-MEALS",
"image": {
"url": "https://foodics.example.test/category-images/meals.png"
},
"is_active": true
}
]
}
}
If Foodics returns no categories matching the storefront filters, the request remains successful and returns an empty array:
{
"remark": "categories",
"status": "success",
"message": {"success": ["Category list"]},
"data": {
"locale": "en",
"categories": []
}
}
The controller does not define a custom provider-error envelope; Foodics/network/runtime failures are handled by the framework/provider error behavior.
GET /productsNo body. Optional query fields:
| Query field | Behavior | Validation |
|---|---|---|
category_id | Exact match against the Foodics category ID. The product-list response's category_id is the local Be Healthy category ID, so use a category ID from the Foodics-backed filters.categories[] or categories endpoint as the query value. | No explicit validation; malformed values normally produce no matching products. |
category | Exact, case-sensitive match against the category's source name, localized name, or current display name. | No explicit validation. |
meal_type | Same category-name matching behavior as category. | No explicit validation. |
search | Case-insensitive substring match in the product's source and localized names. | No explicit validation; an empty value is ignored. |
min_price, max_price | Numeric lower/upper price comparisons; both bounds are inclusive. | No explicit numeric validation or min/max ordering check; values are cast for comparison. |
sort | latest (default), price_asc, price_desc, or title. | Unknown values fall back to latest ordering; there is no 422 for an unknown sort key. |
Results are not paginated. The handler fetches active Foodics products and excludes products without IDs, products outside the Be Healthy brand, add-ons, inactive/not-ready products, stock products, and non-revenue products. It then mirrors the eligible products locally for stable application IDs. It does not explicitly check local menu_channels; use the daily-order home feed or product detail endpoint when the daily-menu-specific list is required. latest sorts by the mirrored local dish creation time, not a Foodics timestamp.
GET /api/products?search=chicken&min_price=20&max_price=60&sort=price_asc&lang=en Accept: application/json
Success response fields: data.locale, data.total_products, data.currency, data.products[], and data.filters. Each product includes local id, titles, category/name and ID, Foodics ID and product data (excluding price_tags), ingredients, meal type, wishlist/cart flags, price/formatted price, calories, and image. Filter metadata includes category choices, meal-type names, resulting price range, and supported sort choices. The array length is reflected in total_products; there are no pagination links.
{
"remark": "products",
"status": "success",
"message": {"success": ["Product list"]},
"data": {
"locale": "en",
"total_products": 1,
"currency": {"code": "AED", "symbol": "AED", "position": "before"},
"products": [
{
"id": 12,
"title": "Chicken Bowl",
"title_localized": null,
"category": "Meals",
"category_id": 3,
"foodics_product_id": "foodics-product-id",
"foodics_product": {},
"ingredients": [],
"meal_type": "Meals",
"is_wishlist": false,
"is_in_cart": false,
"price": 45,
"price_formatted": "AED 45.00",
"calories": 500,
"image": "https://example.com/product.png"
}
],
"filters": {
"categories": [],
"meal_types": ["Meals"],
"price_range": {"min": 45, "max": 45},
"sort_options": [
{"key": "latest", "label": "Latest"},
{"key": "price_asc", "label": "Price low to high"},
{"key": "price_desc", "label": "Price high to low"},
{"key": "title", "label": "Name"}
]
}
}
}
No matches is a successful empty result, not a 404. Count and price range are zero, and filters reflect the empty filtered set:
{
"remark": "products",
"status": "success",
"message": {"success": ["Product list"]},
"data": {
"locale": "en",
"total_products": 0,
"currency": {"code": "AED", "symbol": "AED", "position": "before"},
"products": [],
"filters": {
"categories": [],
"meal_types": [],
"price_range": {"min": 0, "max": 0},
"sort_options": [
{"key": "latest", "label": "Latest"},
{"key": "price_asc", "label": "Price low to high"},
{"key": "price_desc", "label": "Price high to low"},
{"key": "title", "label": "Name"}
]
}
}
}
This controller does not wrap Foodics/provider exceptions in a custom error schema.
GET /products/{id}{id} is the local Be Healthy dish ID, not the Foodics product ID. No body or query parameters are read. The product must be enabled locally and assigned to the daily menu, have a Foodics product mapping, and pass Foodics brand/add-on/active/ready/stock/non-revenue checks. Otherwise the route returns 404 (product_not_found for local/mapping misses; a provider-backed ineligible product is also hidden as 404).
GET /api/products/12?lang=en Accept: application/json
Success returns data.locale, data.currency, and data.product. The product includes identifiers, localized title/category, Foodics product details with price_tags omitted, ingredients, wishlist/cart state, price/weight/calories/macros, image and descriptions, active status, rating summary and inline reviews, customization groups/options with required/min/max rules, allergens, and dislikes. Customization option IDs are local IDs used by the cart API. Product data/image and modifier groups may be synchronized from Foodics during this read. Foodics integration failures may yield framework/provider errors.
{
"remark": "product_details",
"status": "success",
"message": {"success": ["Product details"]},
"data": {
"locale": "en",
"currency": {"code": "AED", "symbol": "AED", "position": "before"},
"product": {
"id": 12,
"title": "Chicken Bowl",
"title_localized": null,
"category": "Meals",
"category_id": "foodics-category-id",
"foodics_product_id": "foodics-product-id",
"foodics_product": {},
"ingredients": [],
"meal_type": "Meals",
"category_details": {"id": "foodics-category-id", "name": "Meals", "name_localized": null, "icon": null},
"is_wishlist": false,
"is_in_cart": false,
"price": 45,
"price_formatted": "AED 45.00",
"weight": null,
"calories": 500,
"marcros": null,
"protein": null,
"carbs": null,
"fat": null,
"image": "https://example.com/product.png",
"overview": "Product description",
"overview_localized": null,
"description": "Product description",
"description_localized": null,
"status": true,
"avg_rating": 0,
"total_rating": 0,
"review_summary": {"average_rating": 0, "total_reviews": 0, "rating_distribution": {"5": 0, "4": 0, "3": 0, "2": 0, "1": 0}},
"customization_groups": [],
"foodics_customization": {"product_mapped": true, "requires_selection": false, "selection_rules": []},
"allergens": [],
"dislikes": [],
"reviews": []
}
}
}
Product missing, disabled, outside the daily menu, or unavailable from Foodics · HTTP 404:
{
"remark": "product_not_found",
"status": "error",
"message": { "error": ["Product not found"] }
}For local dish/mapping misses, the handler's explicit 404 envelope is shown above. A product rejected by Foodics eligibility checks is also hidden as 404, but that branch uses Laravel's generic not-found response rather than the controller's custom product_not_found JSON. Provider/network errors use the framework/provider error response.
GET /products/{id}/reviewsRequires a Sanctum bearer token. This route's middleware allowlists it from verified-account and completed-profile checks. The product ID is a local daily-menu dish ID. Optional query per_page is integer-cast by the handler and clamped to 1–50 (default 10); page uses Laravel pagination. There is no explicit query validation. A missing, disabled, or non-daily product returns 404 with remark: "product_not_found".
GET /api/products/12/reviews?per_page=10&page=1 Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4 Accept: application/json
Success response contains data.product_id, data.summary.average_rating, data.summary.total_reviews, data.summary.rating_distribution (keys 5 through 1), and paginated data.reviews with reviewer, rating, message, and ISO timestamp. An empty review list is successful with average zero and zero counts.
{
"remark": "product_reviews",
"status": "success",
"message": {"success": ["Product reviews"]},
"data": {
"product_id": 12,
"summary": {
"average_rating": 4.5,
"total_reviews": 1,
"rating_distribution": {"5": 1, "4": 0, "3": 0, "2": 0, "1": 0}
},
"reviews": {
"current_page": 1,
"data": [{"id": 8, "reviewer": "Customer", "rating": 5, "message": "Excellent", "created_at": "2026-11-01T10:00:00.000000Z"}],
"per_page": 10,
"total": 1,
"last_page": 1
}
}
}
Missing or unavailable product · HTTP 404. Authentication and profile middleware errors are described in Base URL & conventions; their HTTP status can vary by middleware branch.
{
"remark": "product_not_found",
"status": "error",
"message": { "error": ["Product not found"] }
}Empty review history is successful: its rating average and counts are zero and the paginator's data array is empty. A missing/disabled/non-daily product returns the same 404 envelope shown above for product details.
{
"remark": "product_reviews",
"status": "success",
"message": {"success": ["Product reviews"]},
"data": {
"product_id": 12,
"summary": {
"average_rating": 0,
"total_reviews": 0,
"rating_distribution": {"5": 0, "4": 0, "3": 0, "2": 0, "1": 0}
},
"reviews": {
"current_page": 1,
"data": [],
"per_page": 10,
"total": 0,
"last_page": 1
}
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
POST /products/{id}/wishlist/toggleRequires a Sanctum bearer token. This route's middleware allowlists it from verified-account and completed-profile checks. The local dish ID must identify an enabled daily-menu product. No request body or query fields. This is a toggle, not an idempotent “set” operation: each call adds the item if absent or removes it if present, and sends a wishlist-update notification event.
POST /api/products/12/wishlist/toggle Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4 Accept: application/json
Success response fields are data.product_id, data.wishlist_status (added or removed), and data.is_wishlist. A product that is missing, disabled, or not on the daily menu returns HTTP 404 with remark: "product_not_found".
{
"remark": "wishlist_updated",
"status": "success",
"message": {"success": ["Added to wishlist"]},
"data": {"product_id": 12, "wishlist_status": "added", "is_wishlist": true}
}
Product missing or unavailable · HTTP 404:
{
"remark": "product_not_found",
"status": "error",
"message": { "error": ["Product not found"] }
}When the product is already in the wishlist, a second call removes it and returns wishlist_status: "removed" and is_wishlist: false (HTTP 200):
{
"remark": "wishlist_updated",
"status": "success",
"message": {"success": ["Removed from wishlist"]},
"data": {
"product_id": 12,
"wishlist_status": "removed",
"is_wishlist": false
}
}
Missing or invalid bearer token · HTTP 401:
{
"message": "Unauthenticated."
}
All cart endpoints require a Sanctum bearer token. Their route middleware allowlists them from verified-account and completed-profile checks.
| Method & path | Request | Result & conditions |
|---|---|---|
GET/cart | None | Returns cart items, currency, quantities, prices/subtotals, address, discount/tax/delivery totals. |
POST/cart/items | product_id required integer existing in dishes; optional quantity integer at least 1 (default 1), customization_options array of integer option IDs. | Adds quantity to existing same-product cart item or creates one. Product must be enabled/available in Foodics. Customization group requirements/limits are validated. Invalid fields/customizations: 422; disabled product: 404; unavailable product: 422. |
PUT/cart/items/{id} | {id} is cart-item ID; quantity required integer at least 1; optional customization_options array. | Updates only caller-owned cart item. If options are omitted, current selections are retained and revalidated. Product availability/customization rules are rechecked. Missing item: 404; product unavailable or invalid customizations: 422. |
DELETE/cart/items/{id} | {id} is looked up as the caller's product/dish ID, not a cart-item ID. No body. | Removes the matching product from cart and returns updated cart. Not found: 404. |
Example:
{
"product_id": 12,
"quantity": 2
}
Every successful cart read or mutation returns data.currency plus the refreshed cart: default_address, total_items (sum of quantities), total_products (cart-line count), items[], subtotal/discount/VAT/delivery/total and their formatted strings. Each item contains its cart row id, local dish_id, Foodics product ID, title, unit/base/customization prices, quantity, image, selected customizations, and line subtotal. Prices are recalculated using current Foodics product data and selected option prices; an empty cart is valid and returns zero totals.
POST /cart/items requires an existing integer dish ID; quantity is optional and defaults to 1, but must be an integer of at least 1 when supplied. Customization option IDs must be integers and belong to this product. Every required group must meet its minimum, no group may exceed its maximum, and selected groups/options must have Foodics mappings. Adding a product already in the cart increments its quantity and replaces its saved customization selection with the request selection (or no selections if omitted). PUT /cart/items/{id} uses the cart row ID and requires quantity; omitted customization options preserve the current selection, which is revalidated. DELETE /cart/items/{id} uses the local dish ID, not cart row ID.
Validation/customization errors return HTTP 422; unavailable products can return product_unavailable (422), and missing products/cart rows return 404. Each error uses status: "error" and message.error[]. These mutations affect only the authenticated user's cart and do not send product prices from the client.
{
"remark": "cart_item_added",
"status": "success",
"message": {"success": ["Product added to cart"]},
"data": {
"currency": {"code": "AED", "symbol": "AED", "position": "before"},
"default_address": null,
"total_items": 2,
"total_products": 1,
"items": [
{
"id": 31,
"dish_id": 12,
"foodics_product_id": "foodics-product-id",
"title": "Chicken Bowl",
"price": 45,
"price_formatted": "AED 45.00",
"base_price": 45,
"customization_price": 0,
"quantity": 2,
"image": "https://example.com/product.png",
"customizations": [],
"subtotal": 90,
"subtotal_formatted": "AED 90.00"
}
],
"subtotal": 90,
"discount": 0,
"vat": 0,
"delivery_charge": 0,
"total": 90,
"subtotal_formatted": "AED 90.00",
"discount_formatted": "AED 0.00",
"vat_formatted": "AED 0.00",
"delivery_charge_formatted": "AED 0.00",
"total_formatted": "AED 90.00"
}
}
These routes require Authorization: Bearer <ACCESS_TOKEN>, but their route middleware allowlists them from verification and profile-completion gates. Missing or invalid bearer credentials are rejected with HTTP 401 before the operation runs:
{
"message": "Unauthenticated."
}
Every cart operation requires Authorization: Bearer <ACCESS_TOKEN> and JSON responses. The mutation examples below show each route's request and operation-specific result. Cart responses use live prices and may include additional selected customization details.
GET /cartNo body, query parameters, or endpoint-specific validation. An empty cart is a successful response with zero totals.
GET /api/cart Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4 Accept: application/json
{
"remark": "cart",
"status": "success",
"message": { "success": ["Cart data"] },
"data": {
"currency": { "code": "AED", "symbol": "AED", "position": "before" },
"default_address": null,
"total_items": 0,
"total_products": 0,
"items": [],
"subtotal": 0,
"discount": 0,
"vat": 0,
"delivery_charge": 0,
"total": 0,
"subtotal_formatted": "AED 0.00",
"discount_formatted": "AED 0.00",
"vat_formatted": "AED 0.00",
"delivery_charge_formatted": "AED 0.00",
"total_formatted": "AED 0.00"
}
}{
"remark": "order_not_found",
"status": "error",
"message": {"error": ["Order not found"]}
}POST /cart/itemsRequires product_id (integer existing local dish ID). Optional quantity is an integer ≥1 and defaults to 1; optional customization_options is an array of local option IDs. Prices are calculated server-side. Success · HTTP 200 with remark: "cart_item_added"; the full refreshed cart response is shown above under Example cart response.
POST /api/cart/items Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4 Accept: application/json Content-Type: application/json
{
"product_id": 12,
"quantity": 2
}Invalid body or option/group rules · HTTP 422. A missing/non-integer dish ID fails the exists:dishes,id validator and returns 422; an existing but disabled dish returns 404. An unavailable mapped Foodics product returns 422.
The example response below assumes the cart already contained one unit of this product; adding the requested quantity of two therefore yields a line quantity of three. No customization options are sent, so the example has no customization surcharge.
{
"remark": "cart_item_added",
"status": "success",
"message": { "success": ["Product added to cart"] },
"data": {
"currency": { "code": "AED", "symbol": "AED", "position": "before" },
"default_address": null,
"total_items": 3,
"total_products": 1,
"items": [
{
"id": 31,
"dish_id": 12,
"foodics_product_id": "foodics-product-id",
"title": "Chicken Bowl",
"price": 45,
"price_formatted": "AED 45.00",
"base_price": 45,
"customization_price": 0,
"quantity": 3,
"image": "https://example.com/product.png",
"customizations": [],
"subtotal": 135,
"subtotal_formatted": "AED 135.00"
}
],
"subtotal": 135,
"discount": 0,
"vat": 0,
"delivery_charge": 0,
"total": 135,
"subtotal_formatted": "AED 135.00",
"discount_formatted": "AED 0.00",
"vat_formatted": "AED 0.00",
"delivery_charge_formatted": "AED 0.00",
"total_formatted": "AED 135.00"
}
}{
"remark": "validation_error",
"status": "error",
"message": { "error": ["The product id field is required."] }
}{
"remark": "product_unavailable",
"status": "error",
"message": { "error": ["Product is currently unavailable"] }
}{
"remark": "customization_validation_error",
"status": "error",
"message": {
"error": [
"Please select at least 1 option(s) for Size. Available options: 4: Regular, 7: Large."
]
}
}{
"remark": "product_not_found",
"status": "error",
"message": { "error": ["Product not found"] }
}PUT /cart/items/{id}{id} is the caller's cart-row ID. quantity is required and must be an integer ≥1. If customization_options is omitted, existing selections are preserved; if present, the supplied selection is revalidated. Success · HTTP 200 with remark: "cart_updated" and the complete refreshed cart.
PUT /api/cart/items/31 Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4 Accept: application/json Content-Type: application/json
{
"quantity": 3
}Success · HTTP 200. The response has remark: "cart_updated", a success message, and the same complete cart data shape as the add-item example, with current totals. Invalid quantity/customizations · HTTP 422; cart row not owned by caller or missing · HTTP 404; unavailable product · HTTP 422. If customization_options is omitted, the row's stored options are revalidated against current group rules.
{
"remark": "cart_updated",
"status": "success",
"message": {"success": ["Cart updated successfully"]},
"data": {
"currency": {"code": "AED", "symbol": "AED", "position": "before"},
"default_address": null,
"total_items": 3,
"total_products": 1,
"items": [
{
"id": 31,
"dish_id": 12,
"foodics_product_id": "foodics-product-id",
"title": "Chicken Bowl",
"price": 45,
"price_formatted": "AED 45.00",
"base_price": 45,
"customization_price": 0,
"quantity": 3,
"image": "https://example.com/product.png",
"customizations": [],
"subtotal": 135,
"subtotal_formatted": "AED 135.00"
}
],
"subtotal": 135,
"discount": 0,
"vat": 0,
"delivery_charge": 0,
"total": 135,
"subtotal_formatted": "AED 135.00",
"discount_formatted": "AED 0.00",
"vat_formatted": "AED 0.00",
"delivery_charge_formatted": "AED 0.00",
"total_formatted": "AED 135.00"
}
}
{
"remark": "validation_error",
"status": "error",
"message": { "error": ["The quantity field is required."] }
}{
"remark": "product_unavailable",
"status": "error",
"message": { "error": ["Product is currently unavailable"] }
}{
"remark": "customization_validation_error",
"status": "error",
"message": {
"error": [
"One or more customization options are invalid for this product."
]
}
}{
"remark": "cart_item_not_found",
"status": "error",
"message": { "error": ["Cart item not found"] }
}DELETE /cart/items/{id}{id} is the local dish/product ID (not the cart-row ID). No request body. Success · HTTP 200 with remark: "cart_item_removed" and the refreshed cart. Missing caller-owned product in cart · HTTP 404.
DELETE /api/cart/items/12 Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4 Accept: application/json
{
"remark": "cart_item_removed",
"status": "success",
"message": { "success": ["Product removed from cart"] },
"data": {
"currency": { "code": "AED", "symbol": "AED", "position": "before" },
"default_address": null,
"total_items": 0,
"total_products": 0,
"items": [],
"subtotal": 0,
"discount": 0,
"vat": 0,
"delivery_charge": 0,
"total": 0,
"subtotal_formatted": "AED 0.00",
"discount_formatted": "AED 0.00",
"vat_formatted": "AED 0.00",
"delivery_charge_formatted": "AED 0.00",
"total_formatted": "AED 0.00"
}
}{
"remark": "cart_item_not_found",
"status": "error",
"message": { "error": ["Cart item not found"] }
}These endpoints require Sanctum. The account route group also declares check.status and registration.complete; their route-name allowlists let most address/profile operations proceed before verification or profile completion. GET /user/addresses/delivery-areas is the exception and remains subject to both gates. See the route-specific notes below.
| Method & path | Request | Result & conditions |
|---|---|---|
GET/user/addresses | None | Lists only the caller's addresses. Each includes separate emirate/area, selected preference, active available_delivery_time_slots, and ready-to-submit daily-order slot IDs where available. |
POST/user/addresses | Required: name (≤100), contact_number (≤40), delivery_area_id, delivery_time_preference. Optional: building, street, city, state, country, postal_code, area, full_address, lat/long within geographic bounds, boolean is_default. | Area must be active and preference must match an active slot. First address becomes default; making an address default clears previous default. Validation: 422. |
GET/user/addresses/{id} | Path address ID | Caller-owned address details with area slots. Missing/foreign address: 404. |
PUT/user/addresses/{id} or POST/user/addresses/{id} | Same fields/rules as create. | Updates caller-owned address. Missing/foreign: 404; validation: 422. |
DELETE/user/addresses/{id} | Path address ID | Deletes caller-owned address. If it was default, latest remaining address is promoted. Missing/foreign: 404. |
POST/user/addresses/{id}/set-default | Path address ID; no body | Sets caller-owned address as default and clears other defaults. Missing/foreign: 404. |
GET/user/addresses/delivery-areas | None | Lists active delivery areas, separated by emirate/area, with active slots. |
GET/user/addresses/delivery-time-preferences?delivery_area_id={id} | Active integer delivery_area_id | Returns available time preferences for the active area. Missing/invalid/inactive area: 422. |
These address endpoints are under /user/addresses and require Sanctum. Most operation names are allowlisted from the account verification and profile-completion gates, so a valid token is sufficient; GET /user/addresses/delivery-areas is not allowlisted and requires both gates. Address IDs are caller-scoped: a missing address and an address owned by another user both return HTTP 404. All successful address reads and writes serialize the address using the same structure.
GET /user/addressesNo body or query parameters. Returns caller-owned addresses newest first, with data.total_addresses and data.addresses[]. The array may be empty.
POST /user/addressesSend a JSON body. Required fields:
| Field | Rule | Behavior |
|---|---|---|
name | Required string, max 100 characters. | Customer's label/name for the address. |
contact_number | Required string, max 40 characters. | Contact number for delivery. |
delivery_area_id | Required integer referencing an active delivery area. | The server sets address area and state/emirate from this record and country to United Arab Emirates. |
delivery_time_preference | Required string, max 100 characters; must match an active slot key for the selected active area. | Use a key returned in the area's active time_slots[]. |
Optional JSON fields: building (string ≤255), street (string ≤255), city/state/country (strings ≤100), postal_code (string ≤30), area (string ≤150), full_address (string, no explicit max), latitude (numeric -90 to 90), longitude (numeric -180 to 180), and is_default (boolean). The authoritative area/emirate/country values are populated from the selected delivery area. The controller builds full_address from the address components; do not rely on the submitted full_address overriding that generated value.
The first saved address is automatically default even if is_default is false/omitted. If is_default is true, the user's other addresses are cleared as default. A successful response returns remark: "address_saved" and data.address. Validation errors return HTTP 422 with remark: "validation_error" and a message.error[] list; this includes unknown/inactive area IDs and slot keys not active for that area.
{
"name": "Home",
"contact_number": "+971501234567",
"delivery_area_id": 3,
"delivery_time_preference": "morning",
"building": "Building 4",
"street": "Example Street",
"city": "Dubai",
"postal_code": "12345",
"latitude": 25.2048,
"longitude": 55.2708,
"is_default": true
}
GET /user/addresses/{id}No body or query parameters. Returns remark: "address_details" and the caller-owned address in data.address. The address includes ID, label/contact details, building/street/city, full address, postal code and coordinates; delivery_area_id, separate emirate, nested delivery_area with active slots; available_delivery_time_slots[]; delivery_location_ready; saved delivery_time_preference, label, slot object and formatted range; default flag and timestamps. If the area's saved slot has since become inactive, the available slots omit it and delivery_location_ready is false.
PUT /user/addresses/{id} or POST /user/addresses/{id}Uses the same full set of required and optional fields and validation rules as create; this is not a partial PATCH. Required fields, including name, contact_number, delivery_area_id, and delivery_time_preference, must be sent again. Omitted optional fields are stored as null, and omitted is_default is treated as false. To make the updated address default, send "is_default": true; other defaults are cleared. Success returns remark: "address_updated" and the refreshed data.address. Validation errors are 422; missing/foreign IDs are 404.
POST /user/addresses/{id}/set-defaultNo body or query parameters. Sets the caller-owned address as default and clears the default flag on all the caller's other addresses. Success returns remark: "default_address_updated" and the serialized data.address. Missing/foreign address: 404.
DELETE /user/addresses/{id}No body or query parameters. Deletes only the caller's address. If it was the default, the most recently created remaining address is promoted; if no addresses remain, none is default. Success returns remark: "address_deleted" and a success message (no address object in data). Missing/foreign address: 404.
{
"remark": "address_details",
"status": "success",
"message": {"success": ["Address details"]},
"data": {
"address": {
"id": 56,
"name": "Home",
"contact_number": "+971501234567",
"building": "Building 4",
"area": "Downtown Dubai",
"delivery_area_id": 3,
"emirate": "Dubai",
"delivery_area": {
"id": 3,
"emirate": "Dubai",
"area": "Downtown Dubai",
"time_slots": [
{
"key": "morning",
"label": "Morning",
"start_time": "09:00",
"end_time": "12:00",
"is_active": true,
"order_time_slot_id": "area:3:morning",
"delivery_time_preference": "morning",
"time_range": "9:00 AM–12:00 PM"
}
]
},
"available_delivery_time_slots": [
{
"key": "morning",
"label": "Morning",
"start_time": "09:00",
"end_time": "12:00",
"is_active": true,
"order_time_slot_id": "area:3:morning",
"delivery_time_preference": "morning",
"time_range": "9:00 AM–12:00 PM"
}
],
"delivery_location_ready": true,
"street": "Example Street",
"full_address": "Building 4, Downtown Dubai, Example Street, Dubai, United Arab Emirates",
"city": "Dubai",
"state": "Dubai",
"country": "United Arab Emirates",
"postal_code": "12345",
"latitude": 25.2048,
"longitude": 55.2708,
"delivery_time_preference": "morning",
"delivery_time_label": "Morning",
"delivery_time_slot": {
"key": "morning",
"label": "Morning",
"start_time": "09:00",
"end_time": "12:00",
"is_active": true,
"order_time_slot_id": "area:3:morning",
"delivery_time_preference": "morning",
"time_range": "9:00 AM–12:00 PM"
},
"delivery_time_range": "9:00 AM–12:00 PM",
"is_default": true,
"created_at": "2026-11-01T10:00:00.000000Z",
"updated_at": "2026-11-01T10:00:00.000000Z"
}
}
}
GET /user/addresses/delivery-areasNo body or query parameters. Returns only active delivery areas, sorted by emirate then area, and excludes areas with no active time slots. Response: remark: "delivery_areas", data.areas[]. Each area has id, emirate, area, and time_slots[]. An active slot includes its configured key/label/start/end, generated display time_range, delivery_time_preference (same value as the key), and ready-to-submit order_time_slot_id formatted area:<area_id>:<slot_key>. An is_active field is preserved if it exists in the configured slot.
{
"remark": "delivery_areas",
"status": "success",
"message": {"success": ["Available delivery areas and time slots"]},
"data": {
"areas": [
{
"id": 3,
"emirate": "Dubai",
"area": "Downtown Dubai",
"time_slots": [
{
"key": "morning",
"label": "Morning",
"start_time": "09:00",
"end_time": "12:00",
"is_active": true,
"order_time_slot_id": "area:3:morning",
"delivery_time_preference": "morning",
"time_range": "9:00 AM–12:00 PM"
}
]
}
]
}
}
GET /user/addresses/delivery-time-preferences?delivery_area_id={id}Query field delivery_area_id is required, integer, and must reference an active delivery area. Missing input returns HTTP 422 with remark: "delivery_area_required"; malformed or inactive IDs fail validation with HTTP 422. Success returns remark: "delivery_time_preferences" and data.preferences[] using the same active-slot shape described above. Example: GET /user/addresses/delivery-time-preferences?delivery_area_id=3. Subscription checkout also exposes GET /delivery-areas and GET /delivery-time-preferences?delivery_area_id=3; both aliases call these same handlers and return the same data.areas/data.preferences shapes. The subscription /delivery-areas route requires the verified-account and completed-profile gates; the /delivery-time-preferences route is allowlisted from both gates.
These authenticated endpoints expose active branches and recurring daily operating hours for delivery and pickup. Each branch has daily_order_hours grouped by method and daily_order_availability with current status and the next opening when both methods are closed; the next opening uses delivery_method: "both" when both methods share that opening. Hours use the timezone reported in that status (default Asia/Dubai; configurable with DAILY_ORDER_TIMEZONE). /branches, /delivery-methods, and /user/default-branch are route-name allowlisted by both account middleware gates, so a valid token is sufficient even when verification/profile completion is pending. The legacy daily_order_time_slots field remains without display labels for compatibility; do not use it as a customer time selection.
GET /branchesRequires Sanctum; the route is allowlisted from verification and profile-completion gates. No body or query parameters. Returns remark: "branches", data.total_branches, and data.branches[] sorted by branch name. Each branch includes ID, name, is_default, code, address/contact/location fields, active status, daily_order_hours, and daily_order_availability. Only enabled branches are returned.
GET /delivery-methodsRequires Sanctum; the route is allowlisted from verification and profile-completion gates. No body or query parameters. Returns data.methods[] with standard_delivery and branch_pickup plus data.branches[] containing enabled branch details and daily-order hours/status. This endpoint's branch objects do not include the caller-specific is_default field.
PUT /user/default-branchRequires Sanctum; the route is allowlisted from verification and profile-completion gates. JSON body requires branch_id as an integer referencing an existing enabled branch. Success returns remark: "default_branch_updated" and data.default_branch with ID, localized name, code, address, city, and phone. Missing/non-integer ID returns HTTP 422 with validation errors; an existing disabled branch returns HTTP 422 with remark: "branch_unavailable".
{
"remark": "branches",
"status": "success",
"message": {"success": ["Branch data"]},
"data": {
"total_branches": 1,
"branches": [
{
"id": 3,
"name": "Dubai Branch",
"is_default": true,
"code": "DXB",
"address": "Example address",
"phone": "+971500000000",
"email": "branch@example.com",
"city": "Dubai",
"state": "Dubai",
"country": "United Arab Emirates",
"postal_code": "12345",
"status": 1,
"daily_order_hours": {
"standard_delivery": [{"start_time": "10:00", "end_time": "20:00"}],
"branch_pickup": [{"start_time": "10:00", "end_time": "20:00"}]
},
"daily_order_availability": {
"timezone": "Asia/Dubai",
"is_open": false,
"methods": {
"standard_delivery": {"is_open": false, "hours": [{"start_time": "10:00", "end_time": "20:00"}]},
"branch_pickup": {"is_open": false, "hours": [{"start_time": "10:00", "end_time": "20:00"}]}
},
"next_opening": {
"delivery_method": "standard_delivery",
"day": "tomorrow",
"date": "2026-11-25",
"opens_at": "2026-11-25T10:00:00+04:00",
"start_time": "10:00",
"end_time": "20:00"
}
},
"daily_order_time_slots": []
}
]
}
}
{"branch_id": 3}
| Method & path | Auth | Result |
|---|---|---|
GET/branches | Sanctum; allowlisted from verification/profile gates | Active branches, default-branch marker, daily-order hours and current availability. |
GET/delivery-areas | Sanctum + verified + complete profile | Active delivery areas and slot configuration. |
GET/delivery-time-preferences?delivery_area_id={id} | Sanctum; allowlisted from verification/profile gates | Slot choices for specified active area; invalid/missing ID returns validation error. |
GET/delivery-methods | Sanctum; allowlisted from verification/profile gates | Supported methods standard_delivery and branch_pickup, plus active branches and their daily-order hours/status. |
PUT/user/default-branch | Sanctum; allowlisted from verification/profile gates | Body branch_id integer; branch must exist and be active. Success returns selected branch; invalid branch: 422. |
daily_order_availability.is_open and each method's is_open value to determine availability. Delivery-area preferences, when configured, remain customer-selectable and use keys like area:<delivery_area_id>:<slot_key> for order_time_slot_id.
All routes require Sanctum and are declared within the account status group. Route-name allowlists permit several onboarding, profile, address, branch, and browsing operations before verification or profile completion; other routes require the relevant gates. Each operation's access behavior is noted below.
| Method & path | Request | Result & conditions |
|---|---|---|
POST/user-data-submit | Requires firstname, lastname; accepts profile/address fields. | Used to complete profile when registration step permits. Sets user details and completes registration. |
GET/dashboard | None | Returns authenticated user object directly. |
GET/user-info | None | Returns user inside standard data.user envelope. |
GET/profile | None | Returns profile, image URL, and verification flags. |
POST/profile or POST/profile-setting | Requires first/last name; optional gender, date_of_birth (YYYY-MM-DD), image upload (JPG/JPEG/PNG); upload aliases include profile_image/avatar. | Updates profile. Validation errors may use HTTP 200. Foodics profile-sync failure is non-fatal. |
POST/change-password | current_password, password, password_confirmation; min six characters plus configured complexity. | Wrong current password/validation returns error JSON (may be HTTP 200); success changes password. |
ANY/deposit/history | Optional search transaction reference. | Paginated caller deposit history. The route accepts any verb, but clients should use GET. |
GET/transactions | Optional search, type (plus or other), remark. | Paginated transaction history and remark choices. |
| Method & path | Request | Result & conditions |
|---|---|---|
GET/kyc-form | None | Returns currently configured dynamic KYC fields. A pending review or verified account cannot submit again; controller returns error JSON. |
POST/kyc-submit | Multipart/form fields generated by GET /kyc-form. | Validates against configured field definitions; success stores KYC data and marks review pending. Manual validation errors may be HTTP 200. |
| Method & path | Request | Result |
|---|---|---|
POST/push-notification/register | device_token max 4096 characters, device_type one of android/ios/web, device_id max 255 characters, app_version max 50 characters. | Registers/updates the caller's device. Validation: 422. |
POST/push-notification/remove | device_token | Removes caller-owned device token and returns whether removed. |
GET/push-notification/devices | None | Lists caller's registered devices. |
POST/push-notification/send | Required title (max 200 characters) and body (max 1000 characters); optional data array. | Sends to caller's registered devices; response describes result/no-token condition. Validation: 422. |
GET /withdraw-method, POST /withdraw-request, and POST /withdraw-request/confirm use kyc middleware in addition to account middleware. GET /withdraw/history is authenticated and profile-gated but does not apply the kyc middleware.
| Method & path | Request | Result & conditions |
|---|---|---|
GET/withdraw-method | None | Lists active withdrawal methods and configured dynamic form. |
POST/withdraw-request | method_code, numeric amount. | Validates active method, limits, and balance; creates pending request and returns transaction/form data. Manual business errors may be HTTP 200. |
POST/withdraw-request/confirm | trx plus all dynamic method-form fields; authenticator_code also required if 2FA is enabled. | Validates request/method/form/code and balance; on success debits balance and submits withdrawal. Manual errors may be HTTP 200. |
GET/withdraw/history | Optional search transaction reference. | Paginated caller withdrawals; pending status 0 excluded. |
| Method & path | Request | Result |
|---|---|---|
GET/account/delete-info | None | Explains deletion and permanence; does not delete account. |
POST/account/confirm-delete | Required password; optional reason (max 500 characters). | Creates pending admin-review request; deletion is not immediate. Validation: 422; wrong password: 401; existing pending/approved request: 409. |
GET /profile{
"remark": "user_profile",
"status": "success",
"message": {
"success": ["User profile data"]
},
"data": {
"user": {
"id": 123,
"is_vip": false,
"username": "<CALLER_USERNAME>",
"firstname": "<CALLER_FIRST_NAME>",
"lastname": "<CALLER_LAST_NAME>",
"email": "<CALLER_EMAIL>",
"mobile": "<CALLER_MOBILE>",
"image": null,
"gender": null,
"date_of_birth": null,
"country_code": "AE",
"status": 1,
"ev": 1,
"sv": 1,
"kv": 0,
"created_at": "<CREATED_AT>"
}
}
}
POST /account/confirm-deleteSuccess creates a pending review request; it does not immediately delete the account. Missing/invalid password, incorrect password, or an existing request are handled as documented in the table above.
{
"remark": "deletion_request_created",
"status": "success",
"message": {
"success": ["Your account deletion request has been submitted and is pending admin review"]
},
"data": {
"request_id": 123,
"status": "pending",
"submitted_at": "<SUBMITTED_AT>"
}
}
These routes use the authenticated caller's account. Unless an endpoint says otherwise, responses use HTTP 200; older account handlers can return status: "error" in the JSON body while retaining HTTP 200. Automatic Laravel validation, including device-token and deletion-request validation, returns HTTP 422.
GET /dashboardRequires Sanctum, an active account and completed registration. Returns the authenticated user model directly as the JSON response body rather than wrapping it in data.user.
{
"id": 123,
"username": "sam_customer",
"firstname": "Sam",
"lastname": "Customer",
"email": "customer@example.com",
"mobile": "501234567",
"status": 1,
"ev": 1,
"sv": 1,
"kv": 0
}GET /user-infoUses the same access middleware as the dashboard, but returns the current user under data.user with the standard user_info success envelope.
{
"remark": "user_info",
"status": "success",
"message": {
"success": ["User information"]
},
"data": {
"user": {
"id": 123,
"username": "sam_customer",
"firstname": "Sam",
"lastname": "Customer",
"email": "customer@example.com",
"mobile": "501234567",
"status": 1,
"ev": 1,
"sv": 1,
"kv": 0
}
}
}GET /profileReturns a curated profile under data.user, including VIP state, names, email/mobile, image URL, optional gender/date of birth, country code, account status and email/mobile/KYC verification flags. No body or query parameters are read.
POST /user-data-submitThis is registration completion, not the later profile-edit endpoint. It requires first and last names, optionally stores address fields, and sets reg_step to complete. It is available for authenticated users whose registration is incomplete; calling it after completion returns already_completed with HTTP 200.
{
"firstname": "Sam",
"lastname": "Customer",
"address": "Apartment 12",
"state": "Dubai",
"zip": "00000",
"city": "Dubai"
}Successful completion returns remark: "profile_completed". Missing names produce a manual validation error (currently HTTP 200); submitting after completion produces already_completed (HTTP 200).
{
"remark": "profile_completed",
"status": "success",
"message": {"success": ["Profile completed successfully"]}
}{
"remark": "already_completed",
"status": "error",
"message": {
"error": ["You've already completed your profile"]
}
}{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The firstname field is required.",
"The lastname field is required."
]
}
}{
"remark": "user_info",
"status": "success",
"message": {"success": ["User information"]},
"data": {
"user": {
"id": 123,
"firstname": "Sam",
"lastname": "Customer",
"email": "customer@example.com"
}
}
}POST /profile and POST /profile-settingThese are aliases. Send first and last names; optionally send gender and date_of_birth in YYYY-MM-DD format and a JPG/JPEG/PNG profile image as multipart form data. Validation errors use validation_error (HTTP 200 in this legacy handler). A successful local profile update remains successful if the non-blocking Foodics profile synchronization fails.
{
"firstname": "Sam",
"lastname": "Customer",
"gender": "female",
"date_of_birth": "1995-04-12"
}{
"remark": "profile_updated",
"status": "success",
"message": {"success": ["Profile has been updated successfully"]},
"data": {
"user": {
"id": 123,
"firstname": "Sam",
"lastname": "Customer",
"email": "customer@example.com",
"gender": "female",
"date_of_birth": "1995-04-12",
"country_code": "AE",
"ev": 1,
"sv": 1,
"kv": 0
}
}
}{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["The firstname field is required."]
}
}POST /change-passwordRequires current_password, a new password and matching password_confirmation. The new password is at least six characters; configured secure-password settings may also require mixed case, digits, symbols and a password breach check. Success updates the password and sends a notification. Validation or incorrect-current-password errors use the legacy HTTP 200 error envelope.
{
"current_password": "<CURRENT_PASSWORD>",
"password": "<NEW_PASSWORD>",
"password_confirmation": "<NEW_PASSWORD>"
}{
"remark": "validation_error",
"status": "error",
"message": {"error": ["The password doesn't match!"]}
}{
"remark": "password_changed",
"status": "success",
"message": {
"success": ["Password changed successfully"]
}
}GET /kyc-formReturns the currently configured dynamic KYC field definitions. No fixed form fields are built into the API contract. An account with KYC under review receives under_review; an already verified account receives already_verified (these legacy errors use HTTP 200).
{
"remark": "kyc_form",
"status": "success",
"message": {"success": ["KYC field is below"]},
"data": {"form": []}
}The array above is an empty-form example only; a configured deployment returns its actual dynamic form definitions.
{
"remark": "under_review",
"status": "error",
"message": {
"error": ["Your KYC is under review"]
}
}{
"remark": "already_verified",
"status": "error",
"message": {
"error": ["You are already KYC verified"]
}
}POST /kyc-submitSubmit each currently required dynamic field using the form encoding/type described by the form definition, normally multipart form data for file fields. The handler validates and processes those configured fields, stores the result, and sets kv to 2 (pending review). Validation failures are returned as a legacy HTTP 200 error envelope; no fixed error field names can be documented because they depend on configuration. On success:
{
"remark": "kyc_submitted",
"status": "success",
"message": {"success": ["KYC data submitted successfully"]}
}{
"remark": "validation_error",
"status": "error",
"message": {"error": ["<VALIDATION_MESSAGE_FOR_A_CONFIGURED_FIELD>"]}
}GET /deposit/historyAlthough declared as ANY, clients should use GET. Optional search matches the caller's transaction reference exactly. Returns the caller's deposits with gateway data in a Laravel paginator (default page size 10); no matches produce an empty page, not a 404.
{
"remark": "deposits",
"status": "success",
"message": {"success": ["Deposit data"]},
"data": {
"deposits": {
"current_page": 1,
"data": [],
"per_page": 10,
"total": 0
}
}
}GET /transactionsOptional search matches the caller's transaction reference exactly; type=plus selects incoming transactions and any other nonempty type selects outgoing; remark filters an exact remark. Response includes a paginator plus the distinct available remark values. Empty results are a successful empty page, not a 404.
{
"remark": "transactions",
"status": "success",
"message": {"success": ["Transactions data"]},
"data": {
"transactions": {
"current_page": 1,
"data": [],
"per_page": 10,
"total": 0
},
"remarks": []
}
}POST /push-notification/registerRequires device_token (string, max 4096), device_type (android, ios, or web), device_id (max 255) and app_version (max 50). Upserts by token and marks it active; invalid fields use automatic HTTP 422 validation. The success payload includes the device record ID, caller user ID, type and status.
{
"device_token": "<FCM_DEVICE_TOKEN>",
"device_type": "android",
"device_id": "device-001",
"app_version": "1.0.0"
}POST /push-notification/removeRequires a device_token string and deletes only a token belonging to the caller. A token not found for this account is not an error: success returns data.removed: false.
GET /push-notification/devicesReturns only the caller's device metadata (not the token itself), newest updated first. No devices is a successful empty data.devices array.
{
"remark": "push_notification_devices",
"status": "success",
"message": {"success": ["Device list fetched successfully"]},
"data": {"devices": []}
}{
"remark": "push_notification_registered",
"status": "success",
"message": {
"success": ["Device token registered successfully"]
},
"data": {
"id": 321,
"user_id": 123,
"device_type": "android",
"status": "active"
}
}Remove request body:
{
"device_token": "<FCM_DEVICE_TOKEN>"
}POST /push-notification/sendRequires title (max 200) and body (max 1000), plus optional array-valued data. Sends only to this user's active tokens. If there are no active tokens, the API still responds successfully but data.success is false.
{
"remark": "push_notification_send",
"status": "success",
"message": {"success": ["Sending push notification"]},
"data": {"success": false, "message": "No device tokens found"}
}Register success returns the caller-owned token record's ID, user ID, device type and active status. An empty device list is a normal successful response. Removing a token that was not registered for this account is also a success envelope, but reports removed: false.
{
"remark": "push_notification_removed",
"status": "success",
"message": {"success": ["Device token was not found"]},
"data": {"removed": false}
}GET /withdraw-methodRequires KYC middleware. Returns enabled withdrawal methods and their configured metadata; an empty configured list returns an empty data.withdrawMethod array.
{
"remark": "withdraw_methods",
"status": "success",
"message": {
"success": ["Withdrawals methods"]
},
"data": {
"withdrawMethod": []
}
}POST /withdraw-requestRequires KYC middleware and method_code (the method ID returned above) plus numeric amount. The amount must fit method limits and current balance. Success creates a pending request and returns its transaction reference, withdrawal calculation, and the method's dynamic form; do not assume one fixed set of destination fields.
{
"method_code": 4,
"amount": 250
}Retain data.trx and render data.form to collect the method-specific fields before confirmation. Current legacy validation/business failures are typically HTTP 200 with status: "error".
{
"remark": "withdraw_request_created",
"status": "success",
"message": {"success": ["Withdraw request created"]},
"data": {
"trx": "<TRANSACTION_REFERENCE>",
"withdraw_data": {
"id": 123,
"amount": 250,
"charge": "<CONFIGURED_CHARGE>",
"currency": "<METHOD_CURRENCY>",
"status": 0
},
"form": []
}
}POST /withdraw-request/confirmRequires KYC middleware and the pending request's trx, plus every field required by the dynamic method form. If 2FA is enabled, authenticator_code is required and must verify. On success the handler debits the requested amount and returns withdraw_confirmed; missing request, inactive method, invalid form, incorrect 2FA or insufficient balance return a legacy error response. Submit only the transaction reference returned by the immediately preceding withdrawal request.
{
"trx": "<TRANSACTION_REFERENCE_FROM_REQUEST>",
"authenticator_code": "<ONLY_IF_2FA_ENABLED>",
"<CONFIGURED_METHOD_FIELD>": "<CUSTOMER_VALUE>"
}{
"remark": "withdraw_confirmed",
"status": "success",
"message": {"success": ["Withdraw request sent successfully"]}
}Validation/method/balance errors in these legacy handlers commonly return HTTP 200 with an error envelope. Wrong or missing dynamic form values do not debit the balance. A missing or already-processed request returns a validation error. Do not treat HTTP 200 alone as success; inspect status.
GET /withdraw/historyRequires Sanctum, active account and completed profile, but not KYC middleware. Optional search matches the caller's transaction reference exactly. Pending status-0 drafts are excluded; submitted withdrawals are paginated (default 10). No matches return an empty page.
{
"remark": "withdrawals",
"status": "success",
"message": {"success": ["Withdrawals"]},
"data": {
"withdrawals": {
"current_page": 1,
"data": [],
"per_page": 10,
"total": 0
}
}
}GET /account/delete-infoReturns the deletion warning and categories of data/access affected. It does not create a request or delete any user data.
{
"remark": "delete_account_info",
"status": "success",
"message": {
"success": ["Account deletion information loaded"]
},
"data": {
"will_be_removed": [
"Profile Information",
"Saved Addresses",
"Order History",
"Subscription Access"
],
"warning": "Your account deletion is permanent. Once deleted, your account data, subscriptions, and order history cannot be recovered."
}
}POST /account/confirm-deleteRequires a current password and accepts an optional reason of up to 500 characters. A valid password creates a pending admin-review request, not an immediate deletion. Wrong password returns HTTP 401, invalid fields HTTP 422, and an existing pending/approved request HTTP 409.
{
"password": "<CURRENT_PASSWORD>",
"reason": "I no longer need this account"
}{
"remark": "invalid_password",
"status": "error",
"message": {"error": ["Password is incorrect"]}
}{
"remark": "deletion_request_exists",
"status": "error",
"message": {
"error": ["You already have a deletion request pending"]
}
}For purchase pricing, Stripe/Paymennt flows, and purchase-specific validation, see 8 · Subscription purchase.
| Method & path | Request | Result & conditions |
|---|---|---|
GET/subscription-plans/{type} | Public. type: all, delivery, delivery_subscription, pickup, or pickup_subscription. | Returns enabled plans and program data ordered by price. Invalid type: 422. |
GET/subscription-plans/{plan}/details | Public; path plan ID. | Returns plan/program, days/meals, available bundle options/categories and flags menu_available/available_for_purchase. Missing/disabled plan: 404. Incomplete menu causes availability false. |
GET /subscription-plans/{type}This endpoint is public and has no request body, query parameters, authentication, or pagination. Replace {type} with one of the exact path values below:
| Path value | Programs selected | Returned data.type |
|---|---|---|
all | All programs related to enabled plans | all |
delivery or delivery_subscription | subscription_plan = delivery_subscription | delivery_subscription |
pickup or pickup_subscription | subscription_plan = pickup_subscription | pickup_subscription |
Only enabled plan records with a related program are listed, ordered by plan price ascending. The listing does not paginate. The handler does not additionally filter the related program by its enabled status; check the program status and purchase availability before checkout.
Each item in data.plans[] contains id, program_id, title, title_localized, price, duration_days, calorie_range, image, content, content_localized, meal_types, status, and nested program. The nested program contains id, name, name_localized, short_description, short_description_localized, duration_days, subscription_plan, status, image, and preview_image. Content is returned decoded when it is valid JSON, otherwise as stored. Image values are generated URLs.
{
"remark": "subscription_plans",
"status": "success",
"message": {
"success": ["Subscription plan data"]
},
"data": {
"type": "delivery_subscription",
"plans": [
{
"id": 34,
"program_id": 12,
"title": "Balanced",
"title_localized": "Balanced",
"price": "900.00",
"duration_days": 30,
"calorie_range": "1800-2000",
"image": "https://example.com/plan-image.png",
"content": [],
"content_localized": [],
"meal_types": [1, 2],
"status": 1,
"program": {
"id": 12,
"name": "Delivery",
"name_localized": "Delivery",
"short_description": "Meal subscription",
"short_description_localized": "Meal subscription",
"duration_days": 30,
"subscription_plan": "delivery_subscription",
"status": 1,
"image": "https://example.com/program-image.png",
"preview_image": "https://example.com/program-preview.png"
}
}
]
}
}
For an unsupported path value, the endpoint responds with HTTP 422, remark: "invalid_subscription_plan_type", status: "error", and message.error containing "Invalid subscription plan type". An empty match is a successful response with data.plans: [].
GET /subscription-plans/{plan}/detailsThis public endpoint accepts a plan ID in the path only. It has no body or query parameters. It returns HTTP 404 with remark: "subscription_plan_not_found" when the plan is missing, disabled, or has no related program.
The response includes:
data.plan: selected plan fields as listed above, excluding nested program.data.program: program ID, names/localized names, subscription type/status, duration, descriptions/localized descriptions, image, and preview image.data.menu_available and data.available_for_purchase: menu availability requires the selected plan to have the requested number of program days and at least one plan-eligible meal on each selected day. Purchase availability additionally requires an enabled program.data.bundle_options[]: every enabled plan under the program, each serialized like data.plan.data.bundles[]: plans grouped by case-insensitive trimmed title; each group has title/image/content/meal types and duration/price variants.data.meal_categories[]: unique category IDs referenced by program bundle meal types, with localized names where configured.data.menu_selection, data.plan_day_options[], and data.meal_type_counts: selection metadata, durations available for the selected bundle title, and one required meal per included category for the first selected day.data.days[]: the selected plan's first duration_days program days, each with id, day_number, label, eligible meals[], and eligible meals grouped in meals_by_type. Meal records include IDs, type/slot, dish/category labels, localized text, delivery time, dish status, and image URL.data.allergens[] and data.dislikes[]: active options with ID, name/localized name, and icon.data.branches[]: enabled branch contact/address details.data.payment_methods[]: enabled non-COD gateway currencies and method display data, including method code, currency, limits, rate, charges, and gateway alias.data.settings: currency, VAT and subscription discount percentages, delivery charge, allowed weekdays, cool-bag price/image, and snack price per day.{
"remark": "subscription_plan_details",
"status": "success",
"message": {
"success": ["Subscription plan details"]
},
"data": {
"plan": {
"id": 34,
"program_id": 12,
"title": "Balanced",
"title_localized": "Balanced",
"price": "900.00",
"duration_days": 30,
"calorie_range": "1800-2000",
"image": "https://example.com/plan-image.png",
"content": [],
"content_localized": [],
"meal_types": [1, 2],
"status": 1
},
"program": {
"id": 12,
"name": "Delivery",
"name_localized": "Delivery",
"subscription_plan": "delivery_subscription",
"status": 1,
"duration_days": 30,
"short_description": "Meal subscription",
"short_description_localized": "Meal subscription",
"description": "Program description",
"description_localized": "Program description",
"image": "https://example.com/program-image.png",
"preview_image": "https://example.com/program-preview.png"
},
"menu_available": true,
"available_for_purchase": true,
"bundle_options": [],
"bundles": [],
"meal_categories": [],
"menu_selection": {
"mode": "one_meal_per_category_per_day",
"request_key": "meal_selections",
"day_key": "day_id"
},
"plan_day_options": [30],
"meal_type_counts": {
"1": 1,
"2": 1
},
"days": [
{
"id": 501,
"day_number": 1,
"label": "Day 1",
"meals": [],
"meals_by_type": {}
}
],
"allergens": [],
"dislikes": [],
"branches": [],
"payment_methods": [],
"settings": {
"currency_symbol": "AED",
"currency_text": "AED",
"vat_percent": 5,
"subscription_discount_percent": 5,
"delivery_charge": 0,
"delivery_weekdays": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Sunday"],
"cool_bag_charge": 100,
"snack_charge_per_day": 6,
"cool_bag_image": "https://example.com/cool-bag.png"
}
}
}
The example uses representative values and abbreviated menu/reference arrays; actual IDs, prices, image URLs, and configured choices are supplied by the server. An enabled plan can still return available_for_purchase: false when its program is disabled or its menu is incomplete. Use the purchase endpoint's validation response as authoritative if menu data changes between this lookup and checkout.
All routes require Sanctum and are declared within the verification/profile middleware groups. The route-name allowlist bypasses one or both account gates for the operations called out below; the remaining subscription lifecycle operations require both gates.
| Method & path | Request | Result & conditions |
|---|---|---|
GET/payment-methods | Sanctum; allowlisted from the verification gate; does not require profile completion. | Returns enabled gateway methods including method code, alias, currency, limits, charges, and display details. Use returned IDs/codes/currencies; don't hard-code. |
GET/deposit/methods | Sanctum + complete profile; allowlisted from the verification gate. | Alias of payment-method listing. |
GET/checkout | Sanctum; allowlisted from verification/profile gates. | Returns current cart summary, default address, delivery methods, branches, and payment methods. |
GET/delivery-methods | Sanctum; allowlisted from verification/profile gates. | Returns standard delivery/branch pickup choices and branches with daily-order hours/status. |
GET/coupons | Sanctum; allowlisted from verification/profile gates. | Lists currently eligible/available coupons. |
POST/coupon/apply | Required code; optional plan_id, cool_bag, snacks. | Validates coupon. When plan ID supplied, calculates subscription quote and rejects ineligible plan/option. Invalid/expired/ineligible coupon or invalid plan: 422. |
GET/subscription/{id}/status | Path subscription ID. | Caller-owned subscription status, payment status, dates, plan/program, pricing/payment totals. Missing/foreign: 404. |
POST/subscription/{id}/retry-payment | Required method_code, currency. | Only pending caller-owned subscription can retry. Invalid gateway/amount or Pay on Delivery: 422; unsupported state: 409; provider init failure may be 502. |
GET/subscription-dashboard | Sanctum; allowlisted from verification/profile gates. | Returns subscription dashboard data for caller. |
GET/user/active-subscription | None | Returns current active subscription and delivery/pickup detail; no active subscription yields subscription: null. |
PATCH/user/subscriptions/{subscription} | Path subscription ID; optional meal_selections, allergen_id, dislike_id arrays. | Updates caller-owned subscription preferences; validated against plan. |
POST/user/subscriptions/{subscription}/pause | Path ID; no body specified. | Pauses eligible caller subscription; response includes status/pause data. |
POST/user/subscriptions/{subscription}/resume | Path ID; no body specified. | Resumes eligible paused caller subscription; response includes status/dates. |
Authenticated REST API for purchasing delivery and pickup subscriptions using Stripe or Paymennt. Cash on Delivery and account balance are not covered here.
POST /subscription/purchasePOST /api/subscription/purchase Authorization: Bearer <ACCESS_TOKEN> Accept: application/json Content-Type: application/json
The authenticated account must be eligible to purchase a subscription. A user with an active or pending subscription cannot start another purchase.
First request the enabled methods:
GET /api/payment-methods Authorization: Bearer <ACCESS_TOKEN> Accept: application/json
Choose the Stripe or Paymennt entry from data.methods and use its exact method_code and currency in the purchase request. Do not hard-code method codes or assume the currency: they depend on the enabled gateway configuration.
For subscription purchases, the controller uses method_code and currency to select the gateway. The gateway request field is required and must be a non-balance string for these examples; "stripe" and "paymennt" are suitable labels. Paymennt is identified by the configured gateway method alias, not by the label alone.
| Field | Required | Description |
|---|---|---|
program_id | Yes | Existing program ID. The program must be active and have a subscription type. |
plan_id | Yes | Active plan ID belonging to program_id. |
start_date | Yes | Date in YYYY-MM-DD format; today or later. |
gateway | Yes | Use "stripe" or "paymennt" for the flows documented here. |
method_code | Yes | Integer method_code from the selected entry in GET /api/payment-methods. |
currency | Yes | Currency from the selected payment-method entry. |
terms_accepted | Yes | true or 1. |
meal_selections | No | Optional map keyed by plan day ID. When provided, every plan day must have exactly one eligible meal in each included meal category. |
allergen_id | No | Array of active allergen IDs. |
dislike_id | No | Array of active dislike IDs. |
snacks | No | Boolean. Snack price is AED 6 per subscription day when selected. |
coupon_code | No | Optional valid coupon code. |
Use the plan details and saved-address API responses to obtain IDs and available delivery slots before submitting the purchase.
The plan's program must have subscription_plan: "delivery_subscription".
| Field | Required | Description |
|---|---|---|
address_id | Yes | ID of an address belonging to the authenticated user. |
delivery_time_preference | Yes in practice | Active time-slot key for the selected address's active delivery area. The API also accepts omission if the saved address already has a valid preference. |
delivery_weekdays | Yes | Non-empty array. Allowed values: Monday, Tuesday, Wednesday, Thursday, Friday, Sunday. |
| Field | Description |
|---|---|
branch_id | Optional active branch ID. |
cool_bag | Boolean. true is allowed only for delivery subscriptions. |
available_delivery_time_slots. Each slot includes key, label, start_time, end_time, and a time range. Send its key as delivery_time_preference.
{
"program_id": 12,
"plan_id": 34,
"start_date": "2026-11-10",
"gateway": "stripe",
"method_code": 100,
"currency": "AED",
"terms_accepted": true,
"address_id": 56,
"delivery_time_preference": "morning",
"delivery_weekdays": ["Monday", "Wednesday", "Friday"],
"cool_bag": true,
"snacks": false
}
{
"program_id": 12,
"plan_id": 34,
"start_date": "2026-11-10",
"gateway": "paymennt",
"method_code": 200,
"currency": "AED",
"terms_accepted": true,
"address_id": 56,
"delivery_time_preference": "morning",
"delivery_weekdays": ["Monday", "Wednesday", "Friday"],
"cool_bag": true,
"snacks": false
}
The plan's program must have subscription_plan: "pickup_subscription".
| Field | Required | Description |
|---|---|---|
branch_id | Yes | ID of an active pickup branch. |
address_id, delivery_time_preference, or delivery_weekdays for pickup. cool_bag: true is rejected for pickup.
{
"program_id": 20,
"plan_id": 45,
"start_date": "2026-11-10",
"gateway": "stripe",
"method_code": 100,
"currency": "AED",
"terms_accepted": true,
"branch_id": 3,
"car_detail": "White SUV",
"cool_bag": false,
"snacks": false
}
{
"program_id": 20,
"plan_id": 45,
"start_date": "2026-11-10",
"gateway": "paymennt",
"method_code": 200,
"currency": "AED",
"terms_accepted": true,
"branch_id": 3,
"car_detail": "White SUV",
"cool_bag": false,
"snacks": false
}
Both gateway flows initially return HTTP 200 and remark: "subscription_payment_initiated". The subscription is pending until payment is confirmed.
The numeric pricing example below assumes a representative AED 900 plan, AED 20 delivery fee, AED 100 cool-bag fee, 5% subscription discount, 5% VAT, and a gateway with no additional charge or currency conversion. The calculation is: (900 + 20 + 100) - 45 discount + 48.75 VAT = AED 1,023.75. With snacks selected for 30 days, add AED 180 before discount; the discount still applies only to the plan price, producing a subtotal of AED 1,200, VAT of AED 57.75, and total of AED 1,212.75. Actual plan prices, fees, discount settings, and gateway charges must be taken from the current API/configuration.
{
"remark": "subscription_payment_initiated",
"status": "success",
"message": {
"success": ["Subscription payment initiated"]
},
"data": {
"subscription": {
"id": 123,
"user_id": 7,
"plan_id": 34,
"program_id": 12,
"delivery_method": "Standard Delivery",
"address_id": 56,
"delivery_time_preference": "morning",
"delivery_weekdays": ["Monday", "Wednesday", "Friday"],
"branch_id": null,
"cool_bag": true,
"status": "pending",
"start_date": "2026-11-10",
"end_date": "<END_DATE_FROM_PLAN_DURATION>"
},
"payment": {
"deposit_id": 789,
"transaction": "<TRANSACTION_REFERENCE_FROM_RESPONSE>",
"amount": 1023.75,
"pricing": {
"plan_price": 900,
"delivery_charge": 20,
"cool_bag": 100,
"snacks": false,
"snack_days": 0,
"snack_price_per_day": 6,
"snack_charge": 0,
"subtotal": 1020,
"subscription_discount_percent": 5,
"subscription_discount": 45,
"coupon_code": null,
"coupon_discount_percent": 0,
"coupon_discount": 0,
"discount": 45,
"vat_percent": 5,
"vat": 48.75,
"total": 1023.75,
"currency": "AED"
},
"charge": 0,
"payable": 1023.75,
"currency": "AED"
},
"payment_status": "pending",
"final_amount": 1023.75,
"status_check": {
"url": "https://behealthy.dataduck.in/api/payment/789/status",
"interval_ms": 3000,
"max_attempts": 60,
"quick_status_url": "https://behealthy.dataduck.in/api/payment/789/quick-status"
}
}
}
For Stripe, the response also includes:
data.payment_page_urldata.redirect_urlredirect_url in the app's browser or WebView to start the selected hosted gateway flow. The browser flow returns through the server's payment callbacks. Do not mark the subscription paid based only on the browser redirect; verify it with the authenticated status endpoint.
For a Paymennt API purchase, the response's data.payment also includes:
{
"provider": "paymennt",
"integration": "paymennt_mobile_sdk",
"checkout_id": "<CHECKOUT_ID_FROM_PAYMENNT>",
"checkout_key": "<CHECKOUT_KEY_FROM_PAYMENNT>",
"environment": "<ENVIRONMENT_FROM_RESPONSE>"
}
The response also includes:
{
"payment_flow": "native_sdk",
"checkout_id": "<CHECKOUT_ID_FROM_PAYMENNT>",
"checkout_key": "<CHECKOUT_KEY_FROM_PAYMENNT>",
"redirect_url": null
}
redirect_url for this native flow; it is null. After checkout, poll the server status endpoint to confirm the final result.
The API calculates the amount; clients must not submit or override prices. The response's pricing object is the subscription quote, while payment.charge, payment.payable, and final_amount reflect the selected gateway's additional charge and currency conversion. Delivery charges and cool-bag fees are delivery-only. Pickup excludes those fees. VAT and discounts are calculated server-side; snack prices are not discounted.
All routes in this section require Sanctum. GET /orders and GET /orders/{orderId}/details are allowlisted from verification/profile gates; order actions, subscription-delivery actions, and payment operations require the verified-account and completed-profile gates.
The routes in routes/api/orders.php and routes/api/payments.php work together for daily orders. Create the order with POST /orders, finish any external payment, verify payment and order state on the server, then follow fulfillment through the read-only status/details endpoints. No customer-facing API route marks an order delivered or completed; fulfillment status is advanced by the operations/integration workflow.
POST /orders. The API validates the cart against Foodics product/customization requirements, calculates coupon discount, VAT, delivery charge, and gateway charge, then creates the order.GET /payment/{depositId}/status (or the returned status URL) and GET /payment/{depositId}/completed to verify. A browser return/callback is not itself proof of payment; rely on is_paid and persisted status.GET /orders/{orderId}/status, GET /orders, and GET /orders/{orderId}/details to refresh order progress. Paid orders are set to pending and sent to Foodics by the payment-success workflow; balance and pay-on-delivery orders attempt Foodics sync during placement.GET /orders/{orderId}/invoice for the final invoice. Customers can then submit POST /orders/{orderId}/rate for an eligible delivered item. Cancellation and pickup arrival are conditional actions described below.GET /payment/callback only reports the persisted deposit state and a verification URL; its status query value does not change the payment. Provider-side payment processing records success or failure. Likewise, the Orders API has no customer route to set fulfillment to delivered. Do not treat an order as complete just because payment succeeded or a return URL was opened.
| Lifecycle point | Order state | Payment state / next action |
|---|---|---|
| External gateway started | Raw status 0 (initiated) | Deposit status 0 (initiated); continue provider checkout and poll status. |
| Payment confirmed | Raw status 1 (pending) | Deposit status 1 (paid); the payment-success workflow attempts Foodics sync and clears the cart. |
| Balance / pay on delivery placement | Raw status 1 (pending) | Balance returns paid; pay-on-delivery returns cash_on_delivery. Both clear the cart and attempt Foodics sync. |
| In fulfillment | Raw status 2 (out_for_delivery) | Read order status/details; no customer API mutation is provided. |
| Fulfilled | Raw status 3 or 4 (delivered) | Invoice is available; rating is allowed for an item on this order. |
| Cancelled | Raw status 5 (cancelled) | May result from an eligible customer cancellation, rejected payment, or failed Paymennt checkout initialization. |
| Method & path | Request | Result & conditions |
|---|---|---|
POST/orders | Required delivery_method (standard_delivery or branch_pickup) and gateway. For standard delivery, provide an owned address_id or nonempty free-text address; pickup requires an existing active branch_id but no address. method_code required unless gateway=balance. Optional order_time_slot_id is for delivery-area preferences only; branch hours are not customer-selected. Also accepts car_detail (max 255), note, delivery_instructions, coupon_code, and currency. | Requires nonempty cart and passes cart product/customization validation. Supplied saved address must belong to caller; selected branch must be active and open for the requested method. Outside hours returns HTTP 422 with remark: daily_order_closed. Coupon must be enabled, unexpired, applicable to daily orders, and meet any minimum. Total is cart subtotal minus coupon discount, plus configured VAT and delivery charge (zero for pickup); gateway fee is separate. Balance deducts and clears cart immediately. Pay-on-delivery also places the order and clears cart. Other methods create an initiated payment and return handoff/status URLs. |
GET/orders | Optional status (all default, upcoming, ongoing, delivered, cancelled) and search. | Returns caller's daily orders and subscription deliveries in combined list with filter/count metadata. |
GET/orders/{orderId}/details | Path ID; SUB-{mealId} explicitly selects subscription delivery. Numeric IDs first try owned daily order then owned delivery. | Returns order or subscription delivery details. Not found: 404. |
POST/orders/{orderId}/cancel | Required reason string (max 1000 characters). | Caller-owned order can be cancelled only in eligible statuses 0/1. Returns cancellation/Foodics notification details. Validation 422; missing order 404; ineligible state 422. |
POST/orders/{orderId}/rate | Required dish_id integer and rating integer 1–5; optional message (max 1000 characters). | Order must be delivered and dish must be in that order. Duplicate review: 409; invalid state/dish: 422. |
POST/orders/{orderId}/arrived | No body. | Branch-pickup order with branch/car details and eligible order status required. Returns arrival timestamp and Foodics notification result. Missing: 404; ineligible: 422. |
GET/orders/{orderId}/invoice | No body. | Returns invoice summary for caller-owned order; missing/foreign: 404. |
POST/orders/{orderId}/foodics-sync | No body. | Manually syncs eligible paid/COD order. Missing: 404; unpaid/ineligible: 409; Foodics sync failure: 422. |
Example saved-address delivery request:
{
"delivery_method": "standard_delivery",
"address_id": 56,
"order_time_slot_id": "area:3:morning",
"gateway": "stripe",
"method_code": 123,
"currency": "AED"
}
Example branch pickup (the branch must be open for pickup at submission time):
{
"delivery_method": "branch_pickup",
"branch_id": 3,
"gateway": "stripe",
"method_code": 123,
"currency": "AED"
}
| Method & path | Request | Result & conditions |
|---|---|---|
POST/subscription-deliveries/{mealId}/reschedule | Required scheduled_at, valid date/time after now. | Updates caller-owned pending delivery. Validation: 422; missing/foreign: 404; non-pending: 422. |
GET/subscription-deliveries/{mealId}/addons | No body. | Returns available add-ons and existing requests for caller's delivery. Missing/foreign: 404. |
POST/subscription-deliveries/{mealId}/addons | Required addons array with at least one entry. Each item requires addon_id integer existing in add-ons; optional quantity integer 1–20. Optional top-level note string (max 1000 characters). | Delivery must be caller-owned and pending; add-on must be active. Returns created requests. Validation: 422; missing: 404; ineligible state/inactive addon: 422. |
POST /ordersIf the caller has no cart items, the order is not created. For other placement failures, see the field and business validation rules in the table above.
{
"remark": "cart_empty",
"status": "error",
"message": {
"error": ["Cart is empty"]
}
}
Order placement and mutation routes require Sanctum, an active account, and a completed profile; the list/details reads noted above are allowlisted. Use values from the user's saved addresses, active branches, cart, and enabled payment methods. Daily order placement enforces the selected branch's current hours for the requested method. Delivery-area time preferences remain optional customer choices when configured; branch operating hours are not selected at checkout.
POST /ordersSubmit the delivery method and payment choice with the current cart. For standard delivery, provide an owned address_id or a nonempty free-text address; a saved address supplies its delivery area. For pickup, provide an active branch_id; no address is required. The branch must be open for the submitted method, otherwise the endpoint returns HTTP 422 with remark: "daily_order_closed". Do not send branch operating hours as order_time_slot_id; that optional field is only for a configured delivery-area preference, which must match the selected saved address. An active default branch is used for standard delivery if no branch is supplied. Optional values include car_detail (up to 255 characters), note, delivery_instructions, and an enabled, unexpired coupon that applies to daily orders. method_code is required except for gateway: "balance". Currency is taken from the request, an enabled gateway currency, or the configured default. Do not send or trust a client-calculated amount.
Calculation is server-side: subtotal from cart item prices × quantities, less any coupon discount, plus configured VAT and delivery fee; pickup has no delivery fee. A payment gateway's charge is returned separately. Balance payments deduct the total and clear the cart immediately. Method code 1001 or the supported request gateway value pay_on_delivery follows the cash-on-delivery branch, places the order and clears the cart. Other valid methods create the order/deposit in initiated state and return a redirect URL; the cart is not cleared in that branch.
Use the detailed payment-method JSON examples below for balance, COD, standard hosted gateways, and Paymennt. Each request must use the exact slot and enabled payment method returned by the related checkout endpoints.
GET /ordersOptional status accepts all (default), upcoming, ongoing, delivered, or cancelled; optional search filters daily orders by order ID/delivery method and subscription deliveries by meal title. Results combine daily orders with subscription meal deliveries, sort newest/scheduled first, and are not paginated. An unrecognized status is echoed as data.filter but applies no status filter. Empty results return HTTP 200 with orders: [].
Empty-list examples (no body is sent for these GET requests):
GET /api/orders
{
"remark": "orders",
"status": "success",
"message": {
"success": ["User orders"]
},
"data": {
"filter": "all",
"total_orders": 0,
"orders": []
}
}GET /api/orders?status=upcoming
{
"remark": "orders",
"status": "success",
"message": {
"success": ["User orders"]
},
"data": {
"filter": "upcoming",
"total_orders": 0,
"orders": []
}
}GET /api/orders?search=not-found
{
"remark": "orders",
"status": "success",
"message": {
"success": ["User orders"]
},
"data": {
"filter": "all",
"total_orders": 0,
"orders": []
}
}upcoming, 2 → ongoing, 3/4 → delivered, 5 → cancelled.upcoming; out_for_delivery/delivered → ongoing; received → delivered; cancelled → cancelled.type: "order" or type: "subscription". Use the matching details contract below for its full representation.{
"remark": "orders",
"status": "success",
"message": {"success": ["User orders"]},
"data": {
"filter": "all",
"total_orders": 1,
"orders": [
{
"id": 123,
"type": "order",
"order_number": "#123",
"status": "upcoming",
"raw_status": 1,
"delivery_method": "standard_delivery",
"amount": "52.50",
"items_count": 1,
"items": [{"dish_id": 12, "title": "Chicken Bowl", "quantity": 1, "price": 50}]
}
]
}
}GET /orders/{orderId}/detailsThe lookup is caller-scoped. A numeric path ID first looks for a daily order and then falls back to a subscription meal with that ID; if both IDs collide, the daily order wins. Subscription responses already expose order_number: "SUB-{mealId}"; prefer that unambiguous reference to fetch a subscription delivery. The response is data.order; daily order details include delivery/payment summaries and item customizations, while subscription details include its plan, scheduled meal, address, and add-ons. Missing or foreign records return 404.
{
"remark": "order_details",
"status": "success",
"message": {"success": ["Order details"]},
"data": {
"order": {
"type": "subscription",
"id": 501,
"order_number": "SUB-501",
"scheduled_at": "<SCHEDULED_AT>",
"status": "pending",
"delivery_method": "Standard Delivery",
"subscription": {"id": 34, "plan_id": 12, "plan_title": "Balanced"},
"meal": {"id": 88, "title": "Chicken Bowl"},
"addons": []
}
}
}POST /orders/{orderId}/cancelSend a nonempty string reason (maximum 1000 characters). Only caller-owned orders in raw status 0 or 1 can be cancelled. The API sets status 5, appends the reason to the stored note, and attempts a Foodics cancellation notification. Success returns cancellation time and notification result; missing/foreign order is 404, invalid reason or ineligible status is 422.
{"reason": "I need to change my order"}POST /orders/{orderId}/rateRequires an integer dish_id belonging to the caller's order and an integer rating from 1 to 5; optional message is limited to 1000 characters. The order must be in delivered status 3 or 4. A duplicate review for the same dish is HTTP 409; an undelivered order or dish not in the order is HTTP 422.
{"dish_id": 12, "rating": 5, "message": "Excellent"}{
"remark": "already_rated",
"status": "error",
"message": {"error": ["You have already rated this product"]}
}POST /orders/{orderId}/arrivedNo body is read. The order must belong to the caller, use branch_pickup, have a branch and car detail, and be in raw status 1 or 2. The first call records the arrival timestamp and notifies the kitchen; subsequent calls return the original timestamp and skip duplicate notifications. Missing order is 404; ineligible orders return 422.
GET /orders/{orderId}/invoiceReturns the same detailed order data shape under data.invoice, including item pricing/customizations, delivery/address or branch data, payment status, Foodics state and action availability. The payment summary contains subtotal, delivery fee, VAT, discount and total with formatted values. The response is caller-scoped; missing/foreign order returns 404.
POST /orders/{orderId}/foodics-syncNo body is required. Only a paid/COD order can be synced; the endpoint calls the Foodics service and returns both the sync result and stored Foodics status/reference/timestamp/error. A missing order returns 404, unpaid order returns 409, and provider sync failure returns 422. It does not force a duplicate create when an order is already synced.
POST /subscription-deliveries/{mealId}/reschedule requires a future scheduled_at date/time and an owned pending delivery. It returns the updated subscription delivery details; malformed/past time or non-pending state returns 422, missing/foreign delivery returns 404. GET /subscription-deliveries/{mealId}/addons returns active add-ons and prior requests, including empty arrays when none exist. POST /subscription-deliveries/{mealId}/addons requires a nonempty addons[], each with an existing integer addon_id; optional quantity is 1–20 and optional note is max 1000 characters. The meal must be pending and every add-on active. Validation or inactive add-on errors return 422; missing delivery returns 404. Created requests remain pending and are returned in data.requests.
{
"addons": [{"addon_id": 2, "quantity": 1}],
"note": "Please include with delivery"
}{
"scheduled_at": "2026-11-12 10:30:00"
}{
"remark": "delivery_rescheduled",
"status": "success",
"message": {"success": ["Subscription delivery rescheduled successfully"]},
"data": {
"delivery": {
"type": "subscription",
"id": 501,
"order_number": "SUB-501",
"scheduled_at": "2026-11-12 10:30:00",
"status": "pending"
}
}
}{
"remark": "order_cancelled",
"status": "success",
"message": {"success": ["Order cancelled successfully"]},
"data": {
"order_id": 123,
"status": "cancelled",
"cancelled_at": "<UPDATED_AT>",
"foodics_notification": {"sent": false, "skipped": true}
}
}{
"remark": "customer_arrived",
"status": "success",
"message": {"success": ["The kitchen has been notified that you have arrived"]},
"data": {
"order_id": 123,
"customer_arrived_at": "<ARRIVAL_TIMESTAMP>",
"car_detail": "White SUV",
"foodics_notification": {"sent": false, "skipped": true}
}
}{
"remark": "order_not_paid",
"status": "error",
"message": {
"error": ["The order must be paid or placed with cash on delivery before it can be sent to Foodics."]
},
"data": {
"foodics_sync": {
"synced": false,
"skipped": true,
"message": "Order payment is not complete."
}
}
}These examples complete the endpoint cases above. Values such as order, meal, dish, branch, add-on, and payment-method IDs must come from the authenticated user's API data and the active environment. Response objects marked abbreviated omit fields but retain the documented nesting and field names.
GET /ordersSend filters as query parameters, not a JSON body. Unknown status values are echoed and do not filter the result; a search with no matches is still HTTP 200 with an empty list.
GET /api/orders?status=upcoming&search=chicken
{
"remark": "orders",
"status": "success",
"message": {"success": ["User orders"]},
"data": {
"filter": "upcoming",
"total_orders": 2,
"orders": [
{
"id": 123,
"type": "order",
"order_number": "#123",
"booked_at": "2026-11-04T10:00:00.000000Z",
"delivered_at": null,
"items_count": 1,
"delivery_method": "standard_delivery",
"status": "upcoming",
"raw_status": 1,
"amount": "52.50",
"customer_arrived_at": null,
"subscription": null,
"items": [{"dish_id": 12, "foodics_product_id": "foodics-product-12", "title": "Chicken Bowl", "quantity": 1, "price": 50, "image": null}]
},
{
"id": 501,
"type": "subscription",
"order_number": null,
"booked_at": "2026-11-01T08:00:00.000000Z",
"scheduled_at": "2026-11-05 10:30:00",
"delivered_at": null,
"items_count": 1,
"delivery_method": "standard_delivery",
"status": "upcoming",
"raw_status": "pending",
"amount": null,
"subscription": {"id": 34, "plan_id": 12, "plan_title": "Balanced", "status": "active"},
"items": [{"meal_id": 88, "title": "Chicken Bowl", "meal_type": "Lunch", "image": null}]
}
]
}
}POST /ordersThese are distinct request/response branches for the same endpoint. method_code and currency must match an enabled row from GET /payment-methods; the sample codes, charges, IDs, and transaction strings are illustrative only. Send no method_code for balance. A COD method is available only if enabled in the current environment. All examples below use the same cart/address/area shown above; the server calculates totals and never trusts a client amount.
{
"delivery_method": "standard_delivery",
"address_id": 56,
"order_time_slot_id": "area:3:morning",
"gateway": "balance"
}Balance succeeds only when the wallet covers the order total. It deducts that total, creates no deposit, clears the cart, and attempts Foodics sync.
{
"remark": "order_placed",
"status": "success",
"message": {
"success": ["Order placed successfully"]
},
"data": {
"order": {
"id": 123,
"amount": 52.5,
"vat": 2.5,
"discount": 0,
"name": "Alex Customer",
"email": "alex@example.com",
"mobile": "+971501234567",
"address": "Building 4, Downtown Dubai, Example Street, Dubai, United Arab Emirates",
"delivery_method": "standard_delivery",
"branch_id": null,
"order_time_slot": {
"id": "area:3:morning",
"key": "morning",
"label": "Morning",
"delivery_method": "standard_delivery",
"delivery_area_id": 3,
"delivery_area": "Downtown Dubai",
"emirate": "Dubai",
"start_time": "09:00",
"end_time": "12:00"
},
"car_detail": null,
"note": null,
"delivery_instructions": null,
"status": 1,
"foodics": {
"status": null,
"order_id": null,
"reference": null,
"synced_at": null,
"error": null
},
"items": [
{
"dish_id": 12,
"title": "Chicken Bowl",
"base_price": 50,
"customization_price": 0,
"price": 50,
"quantity": 1,
"image": "https://api.example.test/assets/chicken-bowl.png",
"customizations": []
}
],
"created_at": "2026-11-04T10:00:00.000000Z"
},
"payment_status": "paid",
"foodics_sync": {
"synced": false,
"skipped": true,
"message": "Automatic Foodics order sync is disabled."
}
}
}Use a payment method enabled as COD (commonly method code 1001) and pass the gateway value accepted by the environment. This example uses the implemented pay_on_delivery alias.
{
"delivery_method": "standard_delivery",
"address_id": 56,
"order_time_slot_id": "area:3:morning",
"gateway": "pay_on_delivery",
"method_code": 1001,
"currency": "AED"
}COD creates a deposit record, places the order immediately, clears the cart, and attempts Foodics sync. The response has a deposit ID and transaction, but payment_status is cash_on_delivery (not paid).
{
"remark": "order_placed",
"status": "success",
"message": {
"success": ["Order placed with cash on delivery"]
},
"data": {
"order": {
"id": 123,
"amount": 52.5,
"vat": 2.5,
"discount": 0,
"name": "Alex Customer",
"email": "alex@example.com",
"mobile": "+971501234567",
"address": "Building 4, Downtown Dubai, Example Street, Dubai, United Arab Emirates",
"delivery_method": "standard_delivery",
"branch_id": null,
"order_time_slot": {
"id": "area:3:morning",
"key": "morning",
"label": "Morning",
"delivery_method": "standard_delivery",
"delivery_area_id": 3,
"delivery_area": "Downtown Dubai",
"emirate": "Dubai",
"start_time": "09:00",
"end_time": "12:00"
},
"car_detail": null,
"note": null,
"delivery_instructions": null,
"status": 1,
"foodics": {
"status": null,
"order_id": null,
"reference": null,
"synced_at": null,
"error": null
},
"items": [
{
"dish_id": 12,
"title": "Chicken Bowl",
"base_price": 50,
"customization_price": 0,
"price": 50,
"quantity": 1,
"image": "https://api.example.test/assets/chicken-bowl.png",
"customizations": []
}
],
"created_at": "2026-11-04T10:00:00.000000Z"
},
"deposit_id": 789,
"transaction": "TXN123456",
"payment_status": "cash_on_delivery",
"amount": 52.5,
"charge": 0,
"payable": 52.5,
"foodics_sync": {
"synced": false,
"skipped": true,
"message": "Automatic Foodics order sync is disabled."
}
}
}For a non-COD gateway such as the configured card gateway, copy its actual method_code and currency from GET /payment-methods. The order and deposit start as initiated; the cart is not cleared yet.
{
"delivery_method": "standard_delivery",
"address_id": 56,
"order_time_slot_id": "area:3:morning",
"gateway": "stripe",
"method_code": 123,
"currency": "AED"
}The response nests deposit values under data.payment; the top-level redirect_url remains for backward compatibility. Continue payment at payment_page_url (or the provider navigation URL where supplied), then poll status_check.url and verify the persisted result with verify_url. Callback URLs only return the caller to the app; they do not themselves mark the deposit paid.
{
"remark": "order_payment_initiated",
"status": "success",
"message": {
"success": ["Order payment initiated"]
},
"data": {
"order": {
"id": 123,
"amount": 52.5,
"vat": 2.5,
"discount": 0,
"name": "Alex Customer",
"email": "alex@example.com",
"mobile": "+971501234567",
"address": "Building 4, Downtown Dubai, Example Street, Dubai, United Arab Emirates",
"delivery_method": "standard_delivery",
"branch_id": null,
"order_time_slot": {
"id": "area:3:morning",
"key": "morning",
"label": "Morning",
"delivery_method": "standard_delivery",
"delivery_area_id": 3,
"delivery_area": "Downtown Dubai",
"emirate": "Dubai",
"start_time": "09:00",
"end_time": "12:00"
},
"car_detail": null,
"note": null,
"delivery_instructions": null,
"status": 0,
"foodics": {
"status": null,
"order_id": null,
"reference": null,
"synced_at": null,
"error": null
},
"items": [
{
"dish_id": 12,
"title": "Chicken Bowl",
"base_price": 50,
"customization_price": 0,
"price": 50,
"quantity": 1,
"image": null,
"customizations": []
}
],
"created_at": "2026-11-04T10:00:00.000000Z"
},
"payment": {
"deposit_id": 789,
"transaction": "TXN123456",
"amount": 52.5,
"charge": 1.75,
"payable": 54.25,
"currency": "AED"
},
"payment_page_url": "https://api.example.test/api/payment/confirm/ENCRYPTED_DEPOSIT_ID",
"status_check": {
"url": "https://api.example.test/api/payment/789/status",
"interval_ms": 3000,
"max_attempts": 60,
"quick_status_url": "https://api.example.test/api/payment/789/quick-status"
},
"callbacks": {
"success": "https://api.example.test/api/payment/callback?deposit_id=789&status=success&app_redirect=behealthy%3A%2F%2Fpayment%3Fdeposit_id%3D789%26order_id%3D123",
"pending": "https://api.example.test/api/payment/callback?deposit_id=789&status=pending&app_redirect=behealthy%3A%2F%2Fpayment%3Fdeposit_id%3D789%26order_id%3D123",
"cancelled": "https://api.example.test/api/payment/callback?deposit_id=789&status=cancelled&app_redirect=behealthy%3A%2F%2Fpayment%3Fdeposit_id%3D789%26order_id%3D123",
"error": "https://api.example.test/api/payment/callback?deposit_id=789&status=error&app_redirect=behealthy%3A%2F%2Fpayment%3Fdeposit_id%3D789%26order_id%3D123"
},
"verify_url": "https://api.example.test/api/payment/789/completed",
"history_url": "https://api.example.test/api/payment/789/history",
"payment_status": "initiated",
"redirect_url": "<APP_CONFIRM_URL_FROM_SERVER>"
}
}Use the enabled Paymennt method code/currency from GET /payment-methods. The API creates a provider checkout link and places its ID and URL in the payment response. A Paymennt link initialization failure returns HTTP 502 and changes the deposit to rejected and order to cancelled.
{
"delivery_method": "standard_delivery",
"address_id": 56,
"order_time_slot_id": "area:3:morning",
"gateway": "paymennt",
"method_code": 456,
"currency": "AED"
}On successful Paymennt initialization, the response includes payment.payment_url, top-level payment_url, redirect_url, and app_redirect_url; unlike the standard gateway branch, it omits payment_page_url. The provider return URL should be followed by authenticated status verification, not trusted as proof of payment.
{
"remark": "order_payment_initiated",
"status": "success",
"message": {
"success": ["Order payment initiated"]
},
"data": {
"order": {
"id": 123,
"amount": 52.5,
"vat": 2.5,
"discount": 0,
"name": "Alex Customer",
"email": "alex@example.com",
"mobile": "+971501234567",
"address": "Building 4, Downtown Dubai, Example Street, Dubai, United Arab Emirates",
"delivery_method": "standard_delivery",
"branch_id": null,
"order_time_slot": {
"id": "area:3:morning",
"key": "morning",
"label": "Morning",
"delivery_method": "standard_delivery",
"delivery_area_id": 3,
"delivery_area": "Downtown Dubai",
"emirate": "Dubai",
"start_time": "09:00",
"end_time": "12:00"
},
"car_detail": null,
"note": null,
"delivery_instructions": null,
"status": 0,
"foodics": {
"status": null,
"order_id": null,
"reference": null,
"synced_at": null,
"error": null
},
"items": [
{
"dish_id": 12,
"title": "Chicken Bowl",
"base_price": 50,
"customization_price": 0,
"price": 50,
"quantity": 1,
"image": null,
"customizations": []
}
],
"created_at": "2026-11-04T10:00:00.000000Z"
},
"payment": {
"deposit_id": 789,
"transaction": "TXN123456",
"amount": 52.5,
"charge": 1.75,
"payable": 54.25,
"currency": "AED",
"provider": "paymennt",
"integration": "paymennt_checkout_link",
"checkout_id": "PAYMENNT-CHECKOUT-789",
"payment_url": "https://checkout.paymennt.example/PAYMENNT-CHECKOUT-789"
},
"status_check": {
"url": "https://api.example.test/api/payment/789/status",
"interval_ms": 3000,
"max_attempts": 60,
"quick_status_url": "https://api.example.test/api/payment/789/quick-status"
},
"callbacks": {
"success": "https://api.example.test/api/payment/callback?deposit_id=789&status=success&app_redirect=behealthy%3A%2F%2Fpayment%3Fdeposit_id%3D789%26order_id%3D123",
"pending": "https://api.example.test/api/payment/callback?deposit_id=789&status=pending&app_redirect=behealthy%3A%2F%2Fpayment%3Fdeposit_id%3D789%26order_id%3D123",
"cancelled": "https://api.example.test/api/payment/callback?deposit_id=789&status=cancelled&app_redirect=behealthy%3A%2F%2Fpayment%3Fdeposit_id%3D789%26order_id%3D123",
"error": "https://api.example.test/api/payment/callback?deposit_id=789&status=error&app_redirect=behealthy%3A%2F%2Fpayment%3Fdeposit_id%3D789%26order_id%3D123"
},
"verify_url": "https://api.example.test/api/payment/789/completed",
"history_url": "https://api.example.test/api/payment/789/history",
"payment_status": "initiated",
"redirect_url": "https://checkout.paymennt.example/PAYMENNT-CHECKOUT-789",
"payment_url": "https://checkout.paymennt.example/PAYMENNT-CHECKOUT-789",
"payment_flow": "hosted_link",
"app_redirect_url": "behealthy://payment?deposit_id=789&order_id=123"
}
}Paymennt checkout-link initialization failure · HTTP 502 (the provider message is environment-specific):
{
"remark": "payment_initialization_failed",
"status": "error",
"message": {
"error": ["Paymennt could not create a checkout link."]
}
}{
"remark": "address_not_found",
"status": "error",
"message": {"error": ["Address not found"]}
}{
"remark": "invalid_coupon",
"status": "error",
"message": {"error": ["Invalid or expired coupon code"]}
}{
"remark": "invalid_payment_method",
"status": "error",
"message": {"error": ["Invalid payment method or amount"]}
}{
"remark": "insufficient_balance",
"status": "error",
"message": {"error": ["Insufficient balance"]}
}{
"remark": "address_required",
"status": "error",
"message": {"error": ["Address is required for standard delivery"]}
}GET /orders/{orderId}/detailsUse a numeric owned order ID for a daily order or the SUB-{mealId} form for an unambiguous subscription delivery. Both are bodyless GET requests. The existing subscription example above illustrates the second response variant.
{
"remark": "order_details",
"status": "success",
"message": {"success": ["Order details"]},
"data": {
"order": {
"type": "order",
"id": 123,
"order_number": "#123",
"display_order_number": "#BH123",
"status": "pending",
"raw_status": 1,
"delivery_method": "standard_delivery",
"address": {"id": 56, "value": "Apartment 12, Example Street", "details": {"id": 56}},
"payment_status": "paid",
"items_count": 1,
"items": [{"id": 901, "dish_id": 12, "title": "Chicken Bowl", "quantity": 1, "base_price": 50, "customization_price": 0, "price": 50, "subtotal": 50, "customizations": []}],
"payment_summary": {"subtotal": 50, "delivery_fee": 0, "vat": 2.5, "discount": 0, "total": 52.5},
"actions": [{"key": "cancel_order", "label": "Cancel Order"}]
}
}
}{
"remark": "order_not_found",
"status": "error",
"message": {"error": ["Order not found"]}
}{
"remark": "delivery_not_found",
"status": "error",
"message": {"error": ["Subscription delivery not found"]}
}POST /orders/{orderId}/cancelSend the required request body shown above. A cancelled/delivered or otherwise ineligible order is rejected; invalid or missing reason fails validation.
{
"remark": "order_not_cancellable",
"status": "error",
"message": {"error": ["This order cannot be cancelled"]}
}{
"remark": "order_not_found",
"status": "error",
"message": {"error": ["Order not found"]}
}{
"remark": "validation_error",
"status": "error",
"message": {"error": ["The reason field is required."]}
}POST /orders/{orderId}/rateSend dish_id and rating (and optional message) in the JSON body as shown above. A first valid review succeeds; the same user cannot review the same dish again.
{
"remark": "order_rated",
"status": "success",
"message": {"success": ["Thank you for your feedback"]},
"data": {"review": {"id": 456, "user_id": 7, "dish_id": 12, "rating": 5, "message": "Excellent"}}
}{
"remark": "rating_not_allowed",
"status": "error",
"message": {"error": ["You can rate only delivered items you ordered"]}
}{
"remark": "rating_not_allowed",
"status": "error",
"message": {"error": ["You can rate only delivered items you ordered"]}
}POST /orders/{orderId}/arrivedSend no request body. Arrival is allowed only for a caller-owned branch-pickup order with both branch and car details and raw status 1 or 2. Repeated valid calls return the original arrival time and do not send a duplicate notification.
{
"remark": "arrival_not_allowed",
"status": "error",
"message": {"error": ["Arrival is available only for branch pickup orders with car details"]}
}{
"remark": "order_not_found",
"status": "error",
"message": {"error": ["Order not found"]}
}{
"remark": "arrival_not_allowed",
"status": "error",
"message": {"error": ["This order is not ready for branch pickup arrival"]}
}GET /orders/{orderId}/invoiceThis bodyless request looks up a caller-owned daily Order; unlike the details endpoint, it does not resolve SUB-{mealId} subscription references. Missing or foreign order returns HTTP 404.
{
"remark": "order_invoice",
"status": "success",
"message": {"success": ["Order invoice"]},
"data": {
"invoice": {
"type": "order",
"id": 123,
"order_number": "#123",
"status": "delivered",
"payment_status": "paid",
"payment_summary": {
"subtotal": 50,
"subtotal_formatted": "AED 50.00",
"delivery_fee": 0,
"delivery_fee_formatted": "AED 0.00",
"vat": 2.5,
"vat_formatted": "AED 2.50",
"discount": 0,
"discount_formatted": "AED 0.00",
"total": 52.5,
"total_formatted": "AED 52.50"
},
"items": [{"dish_id": 12, "title": "Chicken Bowl", "quantity": 1, "subtotal": 50, "customizations": []}]
}
}
}{
"remark": "order_not_found",
"status": "error",
"message": {"error": ["Order not found"]}
}POST /orders/{orderId}/foodics-syncSend no request body. A paid order can sync; an already-synced order returns success with skipped: true. Unpaid orders return the HTTP 409 example above. A Foodics validation/provider failure returns HTTP 422 and includes its result and stored Foodics state.
{
"remark": "foodics_order_synced",
"status": "success",
"message": {"success": ["Order already synced to Foodics."]},
"data": {
"foodics_sync": {"synced": true, "skipped": true, "message": "Order already synced to Foodics."},
"foodics": {"status": "synced", "order_id": "00000000-0000-4000-8000-000000000123", "reference": "BH-123", "synced_at": "2026-11-04T10:00:00.000000Z", "error": null}
}
}{
"remark": "foodics_order_sync_failed",
"status": "error",
"message": {"error": ["Foodics product ID is missing for order item 901."]},
"data": {
"foodics_sync": {"synced": false, "message": "Foodics product ID is missing for order item 901.", "payload": null},
"foodics": {"status": "failed", "order_id": null, "reference": null, "synced_at": null, "error": "Foodics product ID is missing for order item 901."}
}
}POST /subscription-deliveries/{mealId}/rescheduleSend a future date/time in scheduled_at in the JSON body as shown above. Only an owned pending delivery may be moved; a past/invalid date or a delivery in another state returns HTTP 422.
{
"remark": "delivery_not_reschedulable",
"status": "error",
"message": {"error": ["Only pending subscription deliveries can be rescheduled"]}
}{
"remark": "validation_error",
"status": "error",
"message": {"error": ["The scheduled at field must be a date after now."]}
}{
"remark": "delivery_not_found",
"status": "error",
"message": {"error": ["Subscription delivery not found"]}
}GET /subscription-deliveries/{mealId}/addonsSend no body. A successful response returns active add-ons and previous requests; either array may be empty. An unknown or foreign meal returns HTTP 404.
{
"remark": "subscription_addons",
"status": "success",
"message": {"success": ["Subscription add-ons"]},
"data": {"available_addons": [], "requests": []}
}{
"remark": "delivery_not_found",
"status": "error",
"message": {"error": ["Subscription delivery not found"]}
}POST /subscription-deliveries/{mealId}/addonsSend the required addons array and optional top-level note in a JSON body as shown above. Each ID must exist and be active; the delivery must still be pending. Invalid shape, inactive add-on, or non-pending delivery returns HTTP 422.
{
"remark": "addons_requested",
"status": "success",
"message": {"success": ["Add-ons requested successfully"]},
"data": {
"requests": [
{
"id": 77,
"user_meal_id": 501,
"addon_id": 2,
"quantity": 1,
"note": "Please include with delivery",
"status": "pending",
"addon": {"id": 2, "name": "Fresh Juice", "price": "8.00", "status": "active"}
}
]
}
}{
"remark": "invalid_addon",
"status": "error",
"message": {"error": ["One or more add-ons are unavailable"]}
}{
"remark": "addons_not_allowed",
"status": "error",
"message": {"error": ["Add-ons can only be requested for pending subscription meals"]}
}{
"remark": "delivery_not_found",
"status": "error",
"message": {"error": ["Subscription delivery not found"]}
}{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The addons field is required."
]
}
}GET /payment-methodsThis authenticated endpoint is the source of the payment methods available in the current environment. It returns enabled gateway-currency entries in method-code/currency order; each entry includes its own id, the method_code and currency needed by payment requests, gateway alias/name, amount bounds, fixed/percentage charges, rate, symbol, and nested method display metadata. It has no body or query parameters; a valid Sanctum token is sufficient because the route is allowlisted from the verification gate and it does not require profile completion. GET /deposit/methods is an alias requiring completed registration, but is also allowlisted from the verification gate. Use each returned entry's exact method_code and currency; do not treat the entry id or nested method.code as the request's method code. An empty configuration returns methods: [] successfully.
GET /api/payment-methods Authorization: ******;ACCESS_TOKEN> Accept: application/json
{
"remark": "payment_methods",
"status": "success",
"message": {
"success": ["Payment Methods"]
},
"data": {
"methods": [
{
"id": 21,
"method_code": 123,
"gateway_alias": "stripe",
"name": "Stripe USD",
"currency": "USD",
"symbol": "$",
"rate": "1.000000",
"min_amount": "1.00000000",
"max_amount": "10000.00000000",
"fixed_charge": "0.50000000",
"percent_charge": "2.00000000",
"method": {
"code": 100,
"name": "Stripe",
"alias": "stripe",
"crypto": false,
"image": "https://api.example.test/assets/payment-gateways/stripe.png"
}
},
{
"id": 22,
"method_code": 456,
"gateway_alias": "paymennt",
"name": "Paymennt AED",
"currency": "AED",
"symbol": "AED",
"rate": "1.000000",
"min_amount": "1.00000000",
"max_amount": "10000.00000000",
"fixed_charge": "1.00000000",
"percent_charge": "2.50000000",
"method": {
"code": 200,
"name": "Paymennt",
"alias": "paymennt",
"crypto": false,
"image": null
}
}
]
}
}{
"remark": "payment_methods",
"status": "success",
"message": {
"success": ["Payment Methods"]
},
"data": {
"methods": []
}
}Request behavior: GET /payment-methods is Authorization: ******;ACCESS_TOKEN> plus Accept: application/json; no JSON body. Then use the returned method_code and currency when creating an order/deposit or purchasing a subscription. For ordinary hosted payment/deposit creation, fixed_charge and percent_charge contribute to the separate gateway charge; method min/max bounds apply to the server-calculated amount. Balance and COD are separate order branches, not gateway rows to assume are always configured.
| Method & path | Request | Result & conditions |
|---|---|---|
GET/payments/{depositId}/status | Sanctum; path deposit ID. | Returns owned deposit status/amount/currency and associated order/subscription. Missing/foreign: 404. |
GET/payment/{depositId} | Sanctum; path deposit ID. | Alias to the payment status handler. |
GET/payment/{depositId}/status | Sanctum; path deposit ID. | Alias to the payment status handler. |
GET/payment/{depositId}/quick-status | Sanctum; path deposit ID. | Currently routes to the same status handler, not a separately minimal quick-status implementation. |
POST/payment/status | Sanctum; optional deposit_id, subscription_id, order_id, session_id. At least one lookup key should be sent. | Caller-scoped lookup using deposit ID, subscription ID, order ID, then session ID precedence. No match: 404; invalid fields: 422. Stripe session status or refreshed Paymennt status may be included. |
GET/payments/check-status | Sanctum; same lookup fields as query parameters. | Legacy alias to status-by-session lookup. |
GET/orders/{orderId}/status | Sanctum; path order ID. | Returns order/payment status; missing/foreign: 404. Rejected payment may move order to cancelled. |
POST/deposit/insert | Sanctum; required amount numeric >0, method_code, currency. | Creates a deposit for the authenticated user and returns payment/status/callback navigation. Invalid gateway/limits return validation error; some branches use HTTP 200. |
GET /deposit/confirm, GET /deposit/manual, and POST /deposit/manual are declared in routes/api/orders.php, but the route points to App\Http\Controllers\Api\PaymentController methods not present in the inspected controller. Treat these endpoints as unresolved/unavailable until a matching handler is implemented and verified.
| Method & path | Auth | Result |
|---|---|---|
GET/payment/confirm/{encryptedDepositId} | Sanctum | Decrypts deposit ID, verifies ownership, returns provider payment URL (when supported), app callbacks, and status polling details. Invalid encrypted ID: 404; foreign deposit: 403; Paymennt provider start error: 502. |
GET/payment/callback | Sanctum | Accepts deposit_id, provider-return status, optional app_redirect; verifies deposit ownership and reports persisted payment state rather than trusting supplied status. Missing ID: 400; deposit missing: 404; foreign: 403. |
GET/payment/{depositId}/completed | Sanctum | Returns payment completion check and, when paid, order/subscription details. Caller ownership required. |
GET/payment/{depositId}/history | Sanctum | Returns status/history information for caller-owned payment. |
POST/payment/webhook | Public; extra throttle 60/min | Route points to PaymentController::paymentWebhook, but that method could not be found in the API payment controller. Verify/fix before relying on this route. |
method_code and currency from GET /payment-methods; the server validates enabled gateway and amount bounds.POST /payment/status can optionally verify a Stripe session_id, returning stripe_payment_status. Do not treat the browser success redirect alone as proof of payment.provider: "paymennt", integration: "paymennt_mobile_sdk", checkout_id, checkout_key, and environment; the response sets redirect_url to null for this flow.charge/payable are separate from the server-calculated subscription pricing quote. The API calculates final prices; clients must not submit trusted totals.Always use the authenticated server status endpoint to decide final UI outcome.
GET /api/payment/{deposit_id}/status Authorization: Bearer <ACCESS_TOKEN> Accept: application/json
The response includes data.payment_status, data.is_paid, data.subscription_id, payment totals, pricing, and subscription details when available. Paymennt status checks refresh the provider checkout state on the server. Poll at the returned interval and stop after the returned maximum attempts or once the result is final.
The API also accepts a POST status lookup:
POST /api/payment/status Authorization: Bearer <ACCESS_TOKEN> Accept: application/json Content-Type: application/json
{
"deposit_id": 789
}
deposit_id is the preferred lookup key. The endpoint also accepts subscription_id or session_id.
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Select an available delivery time for the selected address."]
}
}
| HTTP | remark | Cause |
|---|---|---|
| 422 | validation_error | Missing/invalid program, plan, start date, payment method, currency, terms, or other fields. |
| 422 | validation_error | Delivery address missing/invalid, requested slot inactive, or weekday selection invalid. For a stale slot, data.delivery_time_preference contains currently active slots when available. |
| 422 | validation_error | Pickup branch missing/inactive, or delivery-only cool bag selected for pickup. |
| 422 | validation_error | Method code/currency do not identify an enabled payment method, or the amount is outside that method's limits. |
| 409 | subscription_already_exists | The user already has an active or pending subscription. |
| 422 | subscription_payment_method_not_supported | The chosen method is Pay on Delivery. |
| 502 | payment_initialization_failed | Paymennt native checkout could not be initialized. |
GET /payments/{depositId}/statusExample pending state for a payment owned by the authenticated caller. A pending result is not proof of failure; continue checking using the server-provided polling instructions.
{
"remark": "payment_status",
"status": "success",
"message": {
"success": ["Payment status"]
},
"data": {
"deposit_id": "<DEPOSIT_ID>",
"transaction": "<TRANSACTION_REFERENCE>",
"payment_status": "pending",
"deposit_status": 0,
"subscription_id": null,
"order_id": null,
"amount": "<AMOUNT>",
"charge": "<CHARGE>",
"payable": "<PAYABLE>",
"currency": "<CURRENCY>",
"is_paid": false,
"updated_at": "<UPDATED_AT>"
}
}
POST /payment/statusWhen no caller-owned payment matches the supplied lookup key, the endpoint returns a not-found error rather than a successful empty result.
{
"remark": "payment_not_found",
"status": "error",
"message": {
"error": ["Payment not found for the provided reference."]
}
}
These payment routes require Sanctum except the explicitly public webhook. A deposit status is authoritative only when read from the API; browser redirects and callback query parameters do not themselves prove that payment succeeded. The subscription purchase flow and its gateway-specific native/hosted checkout examples are documented in 8 · Subscription purchase.
POST /deposit/insertRequires a positive numeric amount, an enabled method_code, and its exact configured currency. The gateway's minimum/maximum limits apply. The server creates a deposit, calculates fixed and percentage gateway charges, and returns both the amount to fund and payment navigation/polling URLs. Invalid input, disabled/mismatched method or limit errors currently use an error envelope; validation/business failures in this older controller may still use HTTP 200. This generic wallet deposit route is not the same as the daily-order or subscription purchase endpoints.
{
"amount": 100,
"method_code": 123,
"currency": "AED"
}{
"remark": "deposit_inserted",
"status": "success",
"message": {"success": ["Deposit inserted"]},
"data": {
"payment": {
"deposit_id": 789,
"transaction": "<TRANSACTION_REFERENCE>",
"amount": 100,
"charge": "<GATEWAY_CHARGE>",
"payable": "<AMOUNT_PLUS_CHARGE>",
"currency": "AED"
},
"payment_page_url": "<PAYMENT_CONFIRM_URL>",
"status_check": {
"url": "<PAYMENT_STATUS_URL>",
"interval_ms": 3000,
"max_attempts": 60
},
"callbacks": {
"success": "<SUCCESS_CALLBACK_URL>",
"cancelled": "<CANCEL_CALLBACK_URL>"
},
"verify_url": "<PAYMENT_COMPLETED_URL>",
"redirect_url": "<APP_REDIRECT_URL>"
}
}GET /payments/{depositId}/status and aliasesThe routes GET /payment/{depositId}, /payment/{depositId}/status, and /payment/{depositId}/quick-status invoke the same full payment-status handler as /payments/{depositId}/status; quick-status is not a minimal response. The deposit must belong to the authenticated user. Paymennt mobile checkouts may be refreshed server-side before the response; a rejected payment can also move its associated order to cancelled. Status mapping is initiated, pending, paid, or failed. Foreign or missing deposit returns 404.
When the deposit belongs to an order, data.order is included; for a subscription deposit, data.subscription is included. pricing is populated only when subscription pricing is recorded on the deposit.
The primary and alias status paths share one response contract:
{
"remark": "payment_status",
"status": "success",
"message": {"success": ["Payment status"]},
"data": {
"deposit_id": 789,
"transaction": "<TRANSACTION_REFERENCE>",
"payment_status": "paid",
"deposit_status": 1,
"subscription_id": null,
"order_id": 456,
"amount": 100,
"charge": 0,
"payable": 100,
"currency": "AED",
"is_paid": true,
"order": {"id": 456, "status": 1, "items": []}
}
}Missing or caller-foreign deposit · HTTP 404:
{
"remark": "payment_not_found",
"status": "error",
"message": {"error": ["Payment not found"]}
}POST /payment/status or GET /payments/check-statusSupply one or more optional lookup keys: integer deposit_id, subscription_id, order_id, or string session_id. The handler uses precedence in that order (the first supplied matching key is used), searches only the caller's deposits, and returns the same status payload. Invalid field formats return HTTP 422; no matching deposit returns HTTP 404. If a Stripe session ID is supplied and the gateway has credentials, the server retrieves the session status; provider verification errors are reported as verification_failed rather than trusted from client input. Paymennt refresh may add paymennt_checkout_status.
{
"deposit_id": 789
}{
"remark": "validation_error",
"status": "error",
"message": {"error": ["The deposit id must be an integer."]}
}GET /payment/{depositId}/completedUse this after callback/navigation as a final server-side check. A successful response may still say payment_status: "pending" or "failed"; only is_paid: true confirms payment. A paid order/subscription is attached when available. Missing deposit is 404; another user's deposit is 403.
{
"remark": "payment_completed_check",
"status": "success",
"data": {
"deposit_id": 789,
"transaction": "<TRANSACTION_REFERENCE>",
"is_paid": false,
"payment_status": "pending",
"order_id": 456,
"amount": 100,
"charge": 0,
"payable": 100,
"currency": "AED",
"updated_at": "<UPDATED_AT>"
}
}GET /payment/confirm/{encryptedDepositId}Requires the deposit owner's bearer token. This returns JSON with amount, charge, payable, currency, callback URLs, status polling details and provider URL where applicable. Invalid encrypted IDs return an HTML 404 page; a deposit owned by another user returns an HTML 403 page. A Paymennt checkout initialization failure returns HTTP 502 JSON. For other gateways the app uses the configured hosted payment flow.
{
"remark": "payment_confirmation",
"status": "success",
"data": {
"deposit_id": 789,
"transaction": "<TRANSACTION_REFERENCE>",
"amount": 100,
"charge": "<GATEWAY_CHARGE>",
"payable": "<AMOUNT_PLUS_CHARGE>",
"currency": "AED",
"callbacks": {
"success": "<SUCCESS_CALLBACK_URL>",
"cancel": "<CANCEL_CALLBACK_URL>",
"error": "<ERROR_CALLBACK_URL>"
},
"status_check": {
"url": "<PAYMENT_STATUS_URL>",
"interval_ms": 3000,
"max_attempts": 60
},
"payment_gateway": 123,
"payment_url": "<PROVIDER_URL_OR_NULL>",
"redirect_url": "<PROVIDER_URL_OR_NULL>",
"order_id": 456,
"subscription_id": null
}
}GET /payment/callback, GET /payment/{depositId}/completedThe callback requires deposit_id; status and app_redirect are optional reporting/navigation inputs. It checks the persisted deposit state and does not mark a deposit paid based on the reported status. The route is Sanctum-protected. Missing ID returns 400, missing deposit 404, and a deposit owned by another user 403. Use the returned verify_url or the completed endpoint to make the final decision. Completed status returns is_paid and the payment state; order or subscription data is included only when payment is paid.
{
"remark": "payment_callback",
"status": "success",
"data": {
"deposit_id": 789,
"transaction": "<TRANSACTION_REFERENCE>",
"reported_status": "success",
"actual_status": "pending",
"payment_status": "pending",
"order_id": 456,
"is_paid": false,
"app_redirect": "myapp://orders/456",
"verify_url": "<PAYMENT_COMPLETED_URL>",
"order": {"id": 456, "amount": 100, "status": 0}
}
}{
"remark": "invalid_callback",
"status": "error",
"message": {"error": ["Invalid callback parameters"]}
}GET /payment/{depositId}/historyReturns the current persisted status code/label, transaction reference, timestamps, elapsed seconds, and retry count. It is not a sequence of provider events. A foreign deposit returns 403; a missing deposit uses Laravel's 404 response.
{
"remark": "payment_history",
"status": "success",
"data": {
"deposit_id": 789,
"transaction": "<TRANSACTION_REFERENCE>",
"created_at": "<CREATED_AT>",
"updated_at": "<UPDATED_AT>",
"time_elapsed_seconds": 30,
"current_status_code": 0,
"current_status_label": "Initiated",
"retry_count": 0
}
}GET /orders/{orderId}/status and GET /order/{orderId}/statusBoth paths call the same handler. The lookup is caller-scoped and returns the order data and associated payment state. A missing/foreign order returns 404; if its deposit is rejected, the handler changes the order to cancelled before responding.
{
"remark": "order_status",
"status": "success",
"message": {"success": ["Order status"]},
"data": {
"order": {"id": 456, "status": 0, "items": []},
"payment_status": "pending"
}
}A status lookup is for one owned daily order and does not return an empty collection. Missing or another customer's order returns HTTP 404:
{
"remark": "order_not_found",
"status": "error",
"message": {
"error": ["Order not found"]
}
}GET /deposit/confirm, GET /deposit/manual, and POST /deposit/manual are declared but reference methods absent from the API payment controller. POST /payment/webhook also points to a missing API controller method. These are not documented with guessed success payloads; do not rely on them until the handlers are implemented and verified.
POST /foodics/webhook is public and additionally throttled to 60 requests/minute. The API middleware throttle also applies.
X-Foodics-Webhook-Secret; a mismatch returns 401.{ "status": "ok", "duplicate": true }.| Method & path | Request | Result & conditions |
|---|---|---|
POST/foodics/subscriptions/link | application_subscription_id and foodics_customer_id strings (max 255 characters); integer total_meals (minimum 1); optional starts_at/ends_at dates. | Upserts by application subscription ID, marks active and initializes used/remaining meal counts. Validation: 422. |
GET/foodics/subscriptions/{subscription} | Path subscription ID. | Returns linked subscription with total, used, and remaining meal counts. Route-model missing: 404. Controller does not enforce active status for reads. |
POST/foodics/pickup | Required string foodics_customer_id and Foodics branch_id; meal_count integer ≥1; nonempty products[] with string product_id, integer quantity ≥1 and optional numeric unit_price. Optional external_number (max 255 characters) and customer_notes (max 1000 characters). | Branch must exist in the app's Foodics branch mapping. The latest active subscription for the customer must have sufficient meal balance. Success: HTTP 201 with order and remaining meal balance. Foodics create failure: 502. Request validation: 422; missing branch: 404; missing subscription or balance failure is raised as a runtime error. |
These routes expose Foodics-backed test/diagnostic data and are protected only by Sanctum at route level. Do not expose them to untrusted clients.
| Method & path | Result |
|---|---|
GET/foodics/test | whoami and Foodics settings/connection information. |
GET/foodics/test/branches | Foodics branches. |
GET/foodics/test/customers | Foodics customers. |
GET/foodics/test/products | Foodics products. |
GET/foodics/test/orders | Foodics orders. |
The test endpoints do not define additional query/body validation and mostly return proxied Foodics client responses.
POST /foodics/pickupThe successful response includes the created Foodics order ID and the updated remaining meal balance. Provider-specific fields are returned by Foodics and are not fabricated here.
{
"status": "success",
"message": "Pickup created successfully.",
"data": {
"foodics_order_id": "<FOODICS_ORDER_UUID>",
"external_number": "<EXTERNAL_ORDER_NUMBER>",
"meal_count": 1,
"remaining_meals": 19,
"foodics_order": {}
}
}
POST /foodics/webhookA configured webhook-secret mismatch is rejected. Accepted, duplicate, or ignored webhook responses are described above; processing is asynchronous.
{
"message": "Unauthorized"
}
This Documentation section is the detailed contract reference. The tables here expand each operation with body/query fields, validation and business preconditions, successful response payload, and expected failures. Paths are relative to /api. Examples use representative IDs and values; gateway codes, prices, IDs, pagination totals, and provider values must come from the API response or current configuration. Use the focused examples in sections 6, 9, 10, and 11 for account, orders, payments, and Foodics respectively.
errors object. Several older controllers instead return HTTP 200 with status: "error" and a message.error array. Business error envelopes and HTTP status codes below reflect current branches where verified; framework exceptions may use Laravel's standard JSON error shape.
These routes have no JSON body. A path/query parameter is only listed where the handler reads it; otherwise no additional request validation is defined. Response fields below identify each route's own result shape rather than implying identical payloads.
| Operation | Inputs and validation | Successful response fields | Expected errors / notes |
|---|---|---|---|
GET /general-setting | No body/query. | data.general_setting.site_name. | Database/configuration errors use framework response. |
GET /onboarding | No body/query. | data.screens[] and data.get_started (nullable); screen text, localized copy, image, background and sort order. | Only active intro/get-started screens are returned. |
GET /faqs | No body/query. | data.categories[]; data.faqs grouped by category, each FAQ includes id/category/question/answer. | Only active FAQ rows. |
GET /faqs/{id} | Path ID; no explicit validation rule. | data.faq with id/category/question/answer. | Missing ID is framework 404; detail handler does not filter inactive records. |
GET /faqs/category/{category} | Category path string; no explicit validation. | data.category, data.faqs[] with question/answer. | Empty list when no active rows match. |
GET /faqs/search/query | Optional query string q; no explicit validation. | data.query, data.results_count, data.faqs[]. | Only active records; an empty query is not rejected explicitly. |
GET /support/help | No body/query. | data.support_methods[] (id/name/description/icon/color). | Static support choices. |
GET /contact | No body/query. | data contact options returned by contact controller. | Only active configured contact options. |
GET /get-countries | No body/query. | data.countries[] (country/dial_code/country_code). | Reads bundled country resource. |
GET /authorization | Sanctum; no body. | Authorization/verification state and delivery action for the next required verification step. | Already verified or delivery issue returns error envelope (may be HTTP 200). |
GET /resend-verify/{type} | Sanctum; path type. email selects email; other values use mobile flow. | Verification send/wait response. | Two-minute resend cooldown; current branch can return HTTP 200 with error. |
GET /daily-order-home | Public; optional language. No query validation. | data.locale, user/auth flag if token present, banner, announcements, branches with daily-order hours/status, categories/products, trending/most-loved, cart summary, daily order, recent orders and currency. | Foodics/database provider exceptions may propagate as API error. |
GET /categories | Public; no body/query. | data.locale, data.categories[]. | Active Be Healthy categories only; add-on categories excluded. |
GET /products | Optional category_id (Foodics category ID), category/meal_type, search, min_price, max_price, sort. No explicit validation. | data.locale, data.total_products, data.currency, data.products[], and filter metadata. No pagination. | Eligible Be Healthy Foodics products; endpoint does not explicitly filter daily-menu channel. Supported sort keys are latest, price_asc, price_desc, title. |
GET /products/{id} | Path product ID; no explicit integer validator. | data.product, currency; product details, ratings, ingredients, customization groups/options. | 404 missing/disabled, missing Foodics mapping, or Foodics availability/brand checks fail. |
GET /products/{id}/reviews | Sanctum; optional per_page clamped 1–50, page paginator query. | data.product_id, summary (average/count/distribution), paginated reviews. | 404 product not found. |
GET /cart | Sanctum; route is allowlisted from verification/profile gates; no query/body. | data.currency, data.default_address, data.total_items, data.total_products, data.items[], data.subtotal, data.discount, data.vat, data.delivery_charge, data.total, and formatted totals. | Empty cart returns empty cart representation, not an error. |
GET /user/addresses | Sanctum; route is allowlisted from verification/profile gates; no body/query. | data.total_addresses, data.addresses[]; active area slots and ready-to-submit daily-order slot IDs included when configured. | Only caller-owned addresses. |
GET /user/addresses/{id} | Sanctum; route is allowlisted from verification/profile gates; owned address ID required. | data.address with emirate/area, selected preference and available slots. | 404 missing/foreign address. |
GET /user/addresses/delivery-areas | Sanctum + verified account + completed profile; this address route is not middleware-allowlisted. | data.areas[] with ID, emirate, area and active time slots. | Inactive areas and areas without active slots are omitted. |
GET /user/addresses/delivery-time-preferences | Sanctum; route is allowlisted from verification/profile gates; required active delivery_area_id query integer. | data.preferences[] with key, label, start/end and formatted time range. | 422 absent, malformed, or inactive area ID. |
GET /branches | Sanctum; route is allowlisted from verification/profile gates. | data.total_branches, data.branches[], default marker and daily order slots. | Active branches only. |
GET /delivery-areas | Sanctum + verified + profile complete; no body/query. | data.areas[]; each area has ID, emirate, area and active time slots. | Inactive areas and areas without active slots are omitted. |
GET /delivery-time-preferences | Sanctum; route is allowlisted from verification/profile gates; required active delivery_area_id query integer. | data.preferences[] with key, label, start/end and formatted time range. | 422 if area is missing, invalid or inactive. |
GET /delivery-methods | Sanctum; route is allowlisted from verification/profile gates; no body. | data.methods[] (`standard_delivery`, `branch_pickup`) and active branches/slots. | Static method choices, active branch records. |
GET /payment-methods | Sanctum; allowlisted from verification gate; does not require profile completion. | data.methods[] with method code, gateway alias, currency, rate, min/max, charges, and method display metadata. | Only enabled configured methods; clients must select exact returned method code/currency. |
GET /deposit/methods | Sanctum + completed profile; allowlisted from verification gate. | data.methods[] with method code, gateway alias, currency, rate, min/max, charges, and method display metadata. | Only enabled configured methods; clients must select exact returned method code/currency. |
GET /dashboard | Sanctum + verified account + completed profile; this unnamed route is not middleware-allowlisted. | Authenticated user serialized directly (not the usual data.user envelope). | 401 unauthenticated; verification/profile gate errors follow middleware response format. |
GET /user-info | Sanctum; route is allowlisted from verification/profile gates; bodyless. | Standard envelope with data.user. | 401 without a valid token. |
GET /profile | Sanctum; route is allowlisted from verification/profile gates; bodyless. | Profile fields, verification flags and image URL. | 401 without a valid token. |
GET /kyc-form | Sanctum + verified account + completed profile; KYC submission state is checked by the handler (no route-level kyc middleware). | data.form contains the configured KYC form fields. | Already pending review or verified returns error envelope. |
ANY /deposit/history | Sanctum; optional transaction search; pagination query supported. The route accepts any verb, though clients should use GET. | Paginated caller deposits including gateway data. | Only caller-owned records. |
GET /transactions | Sanctum; optional search, type, remark; pagination. | Paginated transactions and available remark choices. | Filters apply to caller's transactions. |
GET /push-notification/devices | Sanctum; no input. | Current caller's registered device list. | Empty list is valid. |
GET /withdraw-method | Sanctum + verified account + completed profile, plus the declared but unregistered kyc middleware alias (see Known gaps). | Active withdrawal methods and configured input forms. | Do not rely on this route until the middleware alias is registered; KYC eligibility is an additional intended condition. |
GET /withdraw/history | Sanctum + verified account + completed profile; optional transaction search and pagination. No KYC middleware is applied to this read route. | Paginated caller withdrawals; pending status 0 excluded. | Only caller-owned records. |
GET /account/delete-info | Sanctum; no body. | Describes deletion request and permanence; does not delete user. | Account ownership is implicit. |
GET /subscription-plans/{type} | Public; allowed type all|delivery|delivery_subscription|pickup|pickup_subscription. | data.type, data.plans[] with plan/program data. | 422 invalid type. |
GET /subscription-plans/{plan}/details | Public; path plan ID. | Plan/program, menu days/meals, bundle options, meal categories, menu_available, available_for_purchase. | 404 disabled/missing plan. Menu incompleteness sets availability false. |
GET /checkout | Sanctum; route is allowlisted from verification/profile gates. | Cart summary, default address, delivery methods, branches and payment methods. | Empty cart is represented in cart summary. |
GET /coupons | Sanctum; route is allowlisted from verification/profile gates; no query/body. | Currently available coupon choices. | Expired/ineligible coupons excluded by availability query. |
GET /subscription-dashboard | Sanctum; route is allowlisted from verification/profile gates. | data.user, data.subscription, data.day_number, data.today_meals[], and data.delivery.last_delivered/upcoming. | No active subscription is represented in dashboard data. |
GET /user/active-subscription | Sanctum + verified + profile complete. | data.subscription with plan, dates, delivery/pickup detail; null if no active record. | Caller-scoped. |
GET /subscription/{id}/status | Sanctum + verified + profile complete; caller-owned ID. | Subscription/payment states, deposit, pricing, amounts, plan/program and dates. | 404 missing/foreign subscription. |
GET /orders | Sanctum; route is allowlisted from verification/profile gates. Optional status and search query parameters; no pagination. | data.filter, data.total_orders, and combined caller order/subscription-delivery data.orders[]. | Unknown status values are returned in data.filter and do not filter results; no body accepted. |
GET /orders/{orderId}/details | Sanctum; route is allowlisted from verification/profile gates; owned numeric order ID or SUB-{mealId}. | data.order or delivery details depending on identifier. | 404 missing/foreign order or delivery. |
GET /subscription-deliveries/{mealId}/addons | Caller-owned meal delivery ID; no body. | Available add-ons and previous add-on requests. | 404 delivery not found. |
GET /orders/{orderId}/invoice | Caller-owned order ID; no body. | data.invoice with order/items/totals. | 404 missing/foreign order. |
GET /payments/{depositId}/status, GET /payment/{depositId}, GET /payment/{depositId}/status, GET /payment/{depositId}/quick-status | Sanctum; caller-owned deposit ID. | Normalized payment state, totals, currency and linked order/subscription. Quick-status currently returns same shape/handler. | 404 missing/foreign deposit. |
GET /payments/check-status | Sanctum; optional session/deposit/subscription/order lookup query; provide at least one. | Payment status payload with optional Stripe/Paymennt provider status. | 422 malformed IDs; 404 no matching caller-owned deposit. |
GET /payment/{depositId}/completed | Sanctum; path deposit ID, which must belong to caller. | Payment ID/reference, paid flag/status, amount/charge/payable/currency and timestamps. Related order is included only when payment succeeded; related subscription is included only when succeeded. | 404 missing deposit; 403 if deposit belongs to another user. |
GET /payment/{depositId}/history | Sanctum; path deposit ID, which must belong to caller. | Deposit ID/reference, created/updated timestamps, elapsed seconds, numeric status code, human-readable status label, and retry count. | 404 missing deposit; 403 if deposit belongs to another user. |
GET /order/{orderId}/status | Sanctum; caller-owned order ID; no body. | data.order from the order serializer and normalized data.payment_status. A rejected deposit also moves a non-cancelled order to cancelled status. | 404 missing/foreign order. |
GET /orders/{orderId}/status | Sanctum; caller-owned order ID; no body. | Alias to the same payment controller action and response as GET /order/{orderId}/status. | 404 missing/foreign order. |
GET /payment/callback | Sanctum; required query deposit_id; optional status and app_redirect. | data includes deposit ID, transaction, reported and persisted payment status, order ID, is_paid, app redirect, verification URL, and nullable order summary. | 400 missing deposit ID; 404 missing deposit; 403 deposit belongs to another user. The reported status is logged but not trusted. |
GET /foodics/subscriptions/{id} | Sanctum; linked Foodics subscription ID. | Subscription record and total/used/remaining meal counts. | 404 route-model not found. |
GET /foodics/test | Sanctum; no body/query validation. | JSON object containing status: "success", the direct Foodics whoami result, and the direct settings result. | Foodics credentials/permissions/network errors depend on provider integration. |
GET /foodics/test/branches | Sanctum; no body/query validation. | Foodics branches response serialized directly, without a Be Healthy envelope. | Response shape and provider errors depend on the Foodics API and connected account. |
GET /foodics/test/customers | Sanctum; no body/query validation. | Foodics customers response serialized directly, without a Be Healthy envelope. | Response shape and provider errors depend on the Foodics API and connected account. |
GET /foodics/test/products | Sanctum; no body/query validation. | Foodics products response serialized directly, without a Be Healthy envelope. | Response shape and provider errors depend on the Foodics API and connected account. |
GET /foodics/test/orders | Sanctum; no body/query validation. | Foodics orders response serialized directly, without a Be Healthy envelope. | Response shape and provider errors depend on the Foodics API and connected account. |
| Operation | Request fields and validation | Success response contract | Expected errors / conditions |
|---|---|---|---|
POST /auth/login | JSON: username or email and password; both must be strings. Email-shaped username is treated as email. | Success envelope; data.user, data.access_token, data.token_type = Bearer. | Invalid credentials/input and admin login are rejected. Current manual branches may return HTTP 200 with status: error. |
POST /auth/register | JSON: email, integer mobile, password, password_confirmation, mobile_code, country_code, country. Optional names, username, captcha, configured agreement, referral. Email/mobile/username uniqueness; username character and length policy; password security policy. | data.user and bearer token. Foodics sync failure is logged and does not undo registration. | Validation/duplicate/account-policy errors; many manual branches are HTTP 200 with error body. |
POST /auth/otp/request | mobile_code, mobile (5–15 digits), country_code (2 chars); dial/country pair must match. | data.mobile, data.expires_in (300 seconds), data.resend_after (60 seconds); OTP itself is delivered out-of-band. | 422 malformed/mismatched; 429 cooldown/rate limit; 502 delivery failure; 503 provider unavailable. |
POST /auth/otp/resend | mobile_code, mobile; an existing active challenge is required. | Challenge expiry and resend interval; OTP delivered out-of-band. | 422 missing/expired challenge; 429 cooldown/rate limit; provider/delivery failures as above. |
POST /auth/otp/verify | mobile_code, mobile, exactly four-digit otp. | Existing account: user/token login response. New phone: remark: profile_required, data.profile_token (15-minute validity). | 422 invalid/expired code; 429 maximum failed attempts; 403 unavailable account. |
POST /auth/otp/complete-profile | profile_token (64 chars), full_name (?255); optional unique email, gender male|female, date of birth YYYY-MM-DD. | Created user and bearer token. | 422 expired/invalid token or validation; 409 existing phone account. Foodics customer-sync failure does not block account creation. |
POST /auth/password/email | value string: email or username. | Confirms email target and reset-code expiry (600 seconds); code is emailed, not returned. | 422 invalid input; 404 account not found; 429 throttled; 503 email delivery failure. |
POST /auth/password/verify-code | email, six-character code. | data.reset_token and expiry (600 seconds). | 422 invalid/expired code; 404 account missing; 429 throttle/attempt limit. |
POST /auth/password/reset | email, token (min 32), password, password_confirmation; password min 6 plus configured complexity. | Password updated; reset token invalidated; notifications sent. | 422 invalid/expired token or password mismatch/policy; 404 account missing. |
POST /verify-email | Sanctum; required verification code for the pending email challenge. | Email verification success envelope and updated verification state. | Missing, incorrect, or expired code returns an error envelope; legacy branches may use HTTP 200. |
POST /verify-mobile | Sanctum; required verification code for the pending mobile challenge. | Mobile verification success envelope and updated verification state. | Missing, incorrect, or expired code returns an error envelope; legacy branches may use HTTP 200. |
POST /verify-g2fa | Sanctum; required authenticator code when two-factor verification is pending. | Two-factor verification success envelope and updated verification state. | Missing, incorrect, or expired code returns an error envelope; legacy branches may use HTTP 200. |
GET /auth/logout, GET /logout | Sanctum; no body. | remark: logout, status: ok. | 401 unauthenticated. All current user's personal access tokens are revoked. |
Example login response:
{
"remark": "login",
"status": "success",
"data": {
"user": { "id": 7, "email": "customer@example.com" },
"access_token": "<ACCESS_TOKEN_FROM_RESPONSE>",
"token_type": "Bearer"
}
}| Operation | Request fields and validation | Success response contract | Expected errors / conditions |
|---|---|---|---|
POST /products/{id}/wishlist/toggle | Sanctum; path ID must be an enabled daily-menu product; no body. | data.product_id, data.wishlist_status (added|removed), data.is_wishlist. | 404 product_not_found if not an enabled daily product. Sends a push event after the state changes. |
POST /cart/items | product_id required integer existing dish; quantity optional integer with minimum 1 (default 1); customization_options optional integer-ID array. Product and selected options must be active/available; required groups and selection limits are enforced. | data.currency, data.default_address, data.total_items, data.total_products, data.items[], data.subtotal, discount, VAT, delivery charge, total and formatted totals. | 422 validation/customization/unavailable; product-not-found may return 404. Existing same-dish item has quantity incremented. |
PUT /cart/items/{id} | Path ID is cart-item ID. Required quantity integer with minimum 1; optional integer array customization_options. Omitted options preserve saved selections. | Updated data has currency, default address, item/product counts, item customizations and subtotal/discount/VAT/delivery/total. | 404 caller-owned cart item missing; 422 product unavailable or invalid group/option selection. |
DELETE /cart/items/{id} | Path ID is interpreted as caller's dish/product ID (not the cart row ID); no body. | remark: cart_item_removed and refreshed cart. | 404 cart_item_not_found. |
Cart add example: {"product_id":12,"quantity":2,"customization_options":[4,7]}. Prices in request bodies are ignored/not accepted; prices and customizations are recalculated server-side from current product data.
| Operation | Request fields and validation | Success response contract | Expected errors / conditions |
|---|---|---|---|
POST /user/addresses | Required name (max 100 characters), contact_number (max 40 characters), active delivery_area_id, active delivery_time_preference. Optional building/street/city/state/country/postal code, latitude/longitude, boolean is_default. | remark: address_saved, data.address with ID, separate emirate/area, selected slot, available_delivery_time_slots, delivery_location_ready, default flag. | 422 missing/invalid field, inactive area or slot. First address becomes default; making another default clears prior. |
PUT /user/addresses/{id}, POST /user/addresses/{id} | Same fields/rules as create. Path address must belong to caller. | remark: address_updated, data.address refreshed after persistence. | 404 missing/foreign address; 422 invalid location/slot/fields. |
POST /user/addresses/{id}/set-default | Sanctum; no body; address must belong to caller. | Updated data.address with is_default: true. | 404 missing/foreign address. |
DELETE /user/addresses/{id} | Sanctum; no body; address must belong to caller. | Success message; deletion is limited to user's own address. | 404 missing/foreign address. If deleted address was default, latest remaining address is promoted. |
PUT /user/default-branch | branch_id required integer; selected branch must be active. | Updated default branch summary. | 422 missing/inactive/nonexistent branch. |
POST /user-data-submit | Requires firstname, lastname; optional profile/address fields accepted by controller. Used only in eligible registration step. | User/profile success envelope; registration step marked complete. | Incomplete/invalid registration state may return error envelope; field validation is limited in the current controller. |
POST /profile, POST /profile-setting | Requires first/last name; optional gender, date of birth YYYY-MM-DD, JPG/JPEG/PNG profile image (including upload aliases). | Updated data.user/data.profile profile representation. | Validation errors may be HTTP 200 with error envelope. Nonfatal Foodics sync failures are logged. |
POST /change-password | current_password, password, password_confirmation; new password min 6 and configured complexity. | Success message; password changed. | Current password mismatch or validation may be HTTP 200 with status: error. |
POST /kyc-submit | Multipart/configured fields from GET /kyc-form; dynamic required/type/size rules are set by admin KYC form. | Saved KYC values and account KYC state changes to pending review. | Validation errors may be HTTP 200; cannot resubmit while pending or after approval. |
POST /withdraw-request | KYC required; method_code, numeric amount. Amount must satisfy method min/max and user balance. | Pending withdrawal/trx, withdrawal summary and dynamic method form. | Invalid/inactive method, limits, or insufficient balance return error envelope; older branches may be HTTP 200. |
POST /withdraw-request/confirm | KYC required; trx and dynamic form fields; valid authenticator_code when 2FA enabled. | Withdrawal request submitted; account balance debited. | Missing/inactive request, invalid form/code or insufficient balance returns error; older branches may use HTTP 200. |
POST /push-notification/register | device_token max 4096 characters, device_type in android|ios|web, device_id max 255 characters, app_version max 50 characters. | Registered device metadata and success envelope. | 422 field validation. |
POST /auth/register-fcm-token, POST /auth/update-fcm-token | Sanctum; Firebase token update payload handled by FirebaseTokenController. | Token/device registration result. | Authentication or Firebase validation/controller errors; refer to Firebase token handler for deployment-specific fields. |
POST /push-notification/remove | Required device_token; deletion is scoped to caller. | Success plus whether the token was removed. | 422 missing token; other users' device tokens are not deleted. |
POST /push-notification/send | title max 200 characters, body max 1000 characters, optional array data. | Send result for current user's registered devices. | 422 validation; response reports no registered tokens/send failure. |
POST /account/confirm-delete | password required; optional reason max 500 characters. | Pending account-deletion request ID/status/time; account is not immediately deleted. | 422 validation; 401 incorrect password; 409 existing pending/approved request. |
POST /support/ticket | full_name, valid email, subject max 255 characters, message required; optional phone max 20 characters and attachment max 5 MB (PDF/DOC/DOCX/JPG/JPEG/PNG). | data.ticket_id, formatted data.reference_number. | 422 field/file validation; 400 file upload error. |
| Operation | Request fields and validation | Success response contract | Expected errors / conditions |
|---|---|---|---|
POST /coupon/apply | code required string; optional plan_id, boolean cool_bag, boolean snacks. | Coupon information, eligibility and calculated pricing/cart totals depending on supplied plan/order context. | 422 invalid/expired/ineligible coupon, invalid plan, or cool-bag option on pickup plan. |
POST /subscription/purchase | Required program_id, plan_id, start_date today or later, gateway, accepted terms_accepted; gateway method code/currency unless balance. Delivery requires owned address_id, valid slot preference and at least one allowed weekday; pickup requires active branch_id. Optional meal/allergen/dislike/cool-bag/snack/coupon selections. | Balance: active subscription + amount, pricing, payment_status: paid. Gateway: pending subscription, payment/deposit details, pricing, status-check URL, and Stripe redirect or Paymennt native checkout credentials. | 422 validation/invalid menu/address/slot/branch/gateway/amount, duplicate policy options; 409 existing active/pending subscription; 502 Paymennt checkout initialization failure. See the dedicated subscription purchase section for request/response examples. |
POST /subscription/{id}/retry-payment | method_code and currency required; subscription ID must be caller-owned and pending. | New deposit/payment data, amount/charge/payable/currency, status-check and gateway navigation/SDK fields. | 404 missing/foreign subscription; 409 non-pending state; 422 invalid method/limits or COD; 502 provider initialization failure. |
PATCH /user/subscriptions/{id} | Optional meal selections and active allergen/dislike ID arrays; values must be valid for caller-owned subscription/plan. | Updated subscription preferences and subscription data. | 404 missing/foreign subscription; 422 malformed or ineligible meal/options. |
POST /user/subscriptions/{id}/pause | No body specified; caller-owned subscription must satisfy pause eligibility. | Subscription ID/status and pause timestamp/details. | 404 missing/foreign subscription; 422/409 when subscription cannot be paused in its current state. |
POST /user/subscriptions/{id}/resume | No body specified; caller-owned subscription must be paused and resumable. | Subscription ID/status and updated schedule/end-date details. | 404 missing/foreign subscription; 422/409 when subscription is not resumable. |
GET /subscription/{id}/status | Path subscription ID, Sanctum; no body. | data.subscription_id, subscription_status, payment_status, is_active, deposit/pricing, dates, plan/program, currency and totals. | 404 if subscription does not belong to caller. Payment states include initiated/pending/paid/rejected. |
| Operation | Request fields and validation | Success response contract | Expected errors / conditions |
|---|---|---|---|
POST /orders | delivery_method required (standard_delivery|branch_pickup); gateway required; method_code required unless gateway is balance. Standard delivery needs an owned address_id or nonempty free-text address; pickup needs an active branch_id, not an address. Optional order_time_slot_id applies only to delivery-area preferences; branch hours are not selected. Optional car_detail (max 255), note, delivery_instructions, coupon_code, and currency. | Balance and pay-on-delivery: placed order, payment result, and order details. Other enabled gateways: order/deposit IDs, amount/charge/payable, payment handoff, callback, and status URLs. Gateway charge is separate from the order total; the initial external-gateway order/deposit remain initiated until provider payment processing records a result. | 422 for an order placed outside its branch/method hours (remark: daily_order_closed), empty/invalid cart or customizations, foreign address, invalid area preference, ineligible/expired coupon, insufficient balance, or invalid method/amount; inactive/missing branch and other validation failures also return endpoint-specific errors. Do not treat the browser redirect/callback as payment confirmation; verify persisted deposit status through the payment status/completed endpoints. Order fulfillment state is tracked separately and is not changed through a customer completion endpoint. |
POST /orders/{id}/cancel | reason required string =1000; caller-owned order must be in cancellable status 0 or 1. | Order ID, cancelled state/time, Foodics notification result. | 422 validation/ineligible state; 404 missing/foreign order. |
POST /orders/{id}/rate | dish_id integer, rating integer 1–5, optional message =1000. Order must be delivered and dish in order. | Created review fields (review ID, dish, rating/message/time). | 422 not delivered/dish not in order/validation; 409 duplicate user review for dish. |
POST /orders/{id}/arrived | No body; order must be eligible branch pickup with configured branch/car details. | Order ID, arrival timestamp, car detail and Foodics notification result. | 404 missing/foreign order; 422 wrong method/status/missing pickup details. |
POST /orders/{id}/foodics-sync | No body; order must be paid or valid COD placed order. | Foodics sync state, remote reference/status/time or error details. | 404 missing/foreign order; 409 unpaid/ineligible; 422 sync error. |
POST /subscription-deliveries/{mealId}/reschedule | scheduled_at required date/time after now; caller-owned meal delivery must be pending. | Updated data.delivery schedule and delivery metadata. | 422 invalid time or non-pending; 404 missing/foreign delivery. |
POST /subscription-deliveries/{mealId}/addons | addons required array with at least one entry; each entry has existing integer addon_id, optional quantity 1–20 and note max 1000 characters. Delivery pending and add-on active. | Created add-on request records in data. | 422 invalid array, quantity, inactive addon or non-pending delivery; 404 missing/foreign delivery. |
Order rate example: {"dish_id":12,"rating":5,"message":"Excellent"}. Reschedule example: {"scheduled_at":"2026-11-12 10:30:00"}. Add-on example: {"addons":[{"addon_id":2,"quantity":1}],"note":"Please include with delivery"}.
| Operation | Request fields and validation | Success response contract | Expected errors / conditions |
|---|---|---|---|
POST /deposit/insert | Sanctum; amount numeric >0, method_code, currency; gateway must be enabled and amount within min/max. | Deposit/transaction IDs, amount/charge/payable/currency, payment confirmation/redirect URL, status-check and callback URLs. | Invalid input/gateway/limits returns validation error; some controller branches use HTTP 200. |
POST /payment/status | Optional deposit_id, subscription_id, order_id, session_id; send at least one. Lookup is caller-scoped. | Deposit/subscription/order IDs, normalized payment status, amount/charge/payable/final amount/currency, is_paid; related order/subscription when available; provider status fields where queried. | 422 invalid identifiers; 404 no matching caller-owned deposit. Stripe lookup may report verification failure; provider return is not client-authoritative. |
GET /payment/{depositId}/status and aliases | Path deposit ID; Sanctum; deposit must belong to caller. | Same status payload fields as above. Paymennt checkout refresh may update local status before response. | 404 missing/foreign deposit; provider status may remain initiated/pending until callback/poll. |
GET /payment/confirm/{encryptedDepositId} | Encrypted deposit ID path and Sanctum owner token. | Deposit and transaction details, callback URLs, status polling parameters, provider payment URL when supported, order/subscription ID. | 404 invalid/missing encrypted deposit; 403 wrong owner; 502 provider checkout initialization failure. |
GET /payment/{depositId}/completed, /history | Path deposit ID; Sanctum; caller ownership. | Completion endpoint returns final status and related paid order/subscription; history endpoint returns payment history/status metadata. | 404 missing/foreign deposit. |
POST /foodics/subscriptions/link | application_subscription_id and foodics_customer_id strings (max 255 characters); total_meals integer (minimum 1); optional start/end dates. | Linked subscription record with active state, total/used/remaining meal counts. | 422 validation; integration/configuration errors use framework/API error response. |
POST /foodics/pickup | Required string foodics_customer_id, Foodics branch_id, meal_count integer ≥1; nonempty products[], each with string product_id, integer quantity ≥1 and optional numeric unit_price. Optional external_number (max 255) and customer_notes (max 1000). | HTTP 201 with Foodics order ID, external number, meal count, remaining balance, and raw provider order result. | 422 request validation; 404 unmapped branch; missing active subscription or insufficient balance raises a runtime exception; Foodics create failure returns 502 without deducting meals. |
POST /foodics/webhook | Public; provider payload and configured X-Foodics-Webhook-Secret if secret checking is enabled. No general request schema validator. | 202 accepted with webhook ID; duplicate returns duplicate: true; irrelevant event may be accepted/ignored. | 401 configured secret mismatch; disabled/ineligible events ignored. Processing is asynchronous. |
Explicit application validation errors commonly have this shape; the status varies by endpoint:
{
"remark": "validation_error",
"status": "error",
"message": {
"error": ["Select an available delivery time for the selected address."]
},
"data": {
"delivery_time_preference": [
{ "key": "morning", "label": "Morning", "start_time": "09:00", "end_time": "12:00" }
]
}
}Laravel automatic request validation may instead return {"message":"The given data was invalid.","errors":{"field":["..."]}}. Authentication, ownership, not-found, conflict, throttle, and provider errors use the status codes in the endpoint rows above. Always inspect both HTTP status and JSON fields.
These request examples show the JSON shape for write operations. Replace record IDs, account-specific data, credentials, OTPs, tokens, and configuration-dependent values with values obtained from the API or the user's verification flow. Routes with no body, including all GET routes, are marked as bodyless in the operation contracts above. Multipart uploads such as KYC documents and support attachments must use multipart/form-data instead of JSON.
| Operation | Example request JSON |
|---|---|
POST /auth/login | {"username":"customer@example.com","password":"example-password"} |
POST /auth/register | {"email":"customer@example.com","mobile":501234567,"password":"ExamplePass123!","password_confirmation":"ExamplePass123!","mobile_code":"+971","country_code":"AE","country":"United Arab Emirates","firstname":"Sam","lastname":"Customer"} |
POST /auth/otp/request and /auth/otp/resend | {"mobile_code":"+971","mobile":"501234567","country_code":"AE"} |
POST /auth/otp/verify | {"mobile_code":"+971","mobile":"501234567","otp":"<OTP_FROM_SMS>"} |
POST /auth/otp/complete-profile | {"profile_token":"<PROFILE_TOKEN_FROM_RESPONSE>","full_name":"Sam Customer","email":"customer@example.com","gender":"female","date_of_birth":"1995-04-12"} |
POST /auth/password/email | {"value":"customer@example.com"} |
POST /auth/password/verify-code | {"email":"customer@example.com","code":"<CODE_FROM_EMAIL>"} |
POST /auth/password/reset | {"email":"customer@example.com","token":"<RESET_TOKEN_FROM_RESPONSE>","password":"NewExamplePass123!","password_confirmation":"NewExamplePass123!"} |
POST /verify-email, /verify-mobile, /verify-g2fa | {"code":"<CODE_FROM_VERIFICATION_STEP>"} |
POST /cart/items | {"product_id":12,"quantity":2,"customization_options":[4,7]} |
PUT /cart/items/{id} | {"quantity":3,"customization_options":[4,7]} |
POST /user/addresses, PUT /user/addresses/{id} | {"name":"Home","contact_number":"+971501234567","delivery_area_id":3,"delivery_time_preference":"morning","building":"Building 4","street":"Example Street","city":"Dubai","country":"United Arab Emirates","latitude":25.2048,"longitude":55.2708,"is_default":true} |
POST /user/default-branch | {"branch_id":2} |
POST /user-data-submit | {"firstname":"Sam","lastname":"Customer","address":"Example Street","city":"Dubai","country":"United Arab Emirates"} |
POST /kyc-submit | {"<configured_field_name>":"Example answer"}Template only: actual keys and file fields come from GET /kyc-form; send multipart form data when the configured form requests a file. |
POST /profile, /profile-setting | {"firstname":"Sam","lastname":"Customer","gender":"female","date_of_birth":"1995-04-12"} |
POST /change-password | {"current_password":"OldExamplePass123!","password":"NewExamplePass123!","password_confirmation":"NewExamplePass123!"} |
POST /support/ticket | {"full_name":"Sam Customer","email":"customer@example.com","subject":"Delivery question","message":"Please contact me about my delivery.","phone":"+971501234567"} |
POST /push-notification/register | {"device_token":"<FCM_DEVICE_TOKEN>","device_type":"android","device_id":"device-001","app_version":"1.0.0"} |
POST /push-notification/remove | {"device_token":"<FCM_DEVICE_TOKEN>"} |
POST /push-notification/send | {"title":"Order update","body":"Your order is on the way.","data":{"order_id":"123"}} |
POST /account/confirm-delete | {"password":"example-password","reason":"I no longer need this account."} |
POST /withdraw-request | {"method_code":2,"amount":250} |
POST /withdraw-request/confirm | {"trx":"<TRANSACTION_REFERENCE>","account_name":"Sam Customer","account_number":"1234567890"}Dynamic fields must match the form returned for the selected withdrawal method. |
POST /coupon/apply | {"code":"WELCOME10","plan_id":3,"cool_bag":false,"snacks":false} |
POST /subscription/{id}/retry-payment | {"method_code":"<METHOD_CODE_FROM_PAYMENT_METHODS>","currency":"AED"} |
PATCH /user/subscriptions/{id} | {"meal_selections":{"1":[12,13],"2":[18]},"allergen_id":[2],"dislike_id":[4]} |
POST /orders/{orderId}/cancel | {"reason":"Unable to receive the order"} |
POST /orders/{orderId}/rate | {"dish_id":12,"rating":5,"message":"Excellent"} |
POST /subscription-deliveries/{mealId}/reschedule | {"scheduled_at":"2026-11-12 10:30:00"} |
POST /subscription-deliveries/{mealId}/addons | {"addons":[{"addon_id":2,"quantity":1,"note":"No onions"}],"note":"Please include with delivery"} |
POST /deposit/insert | {"amount":100,"method_code":"<METHOD_CODE_FROM_PAYMENT_METHODS>","currency":"AED"} |
POST /payment/status | {"deposit_id":12345} |
POST /foodics/subscriptions/link | {"application_subscription_id":"sub-1001","foodics_customer_id":"customer-501","total_meals":20,"starts_at":"2026-11-10","ends_at":"2026-12-10"} |
POST /foodics/pickup | {"foodics_customer_id":"customer-501","branch_id":"branch-3","meal_count":1,"products":[{"product_id":"product-12","quantity":1,"unit_price":25}],"external_number":"APP-ORDER-1001","customer_notes":"Pickup order"} |
POST /auth/register-fcm-token, /auth/update-fcm-token | {"token":"<FCM_DEVICE_TOKEN>","device_type":"android","device_id":"device-001","app_version":"1.0.0"} |
POST /foodics/webhook | {"event":"order.updated","data":{"id":"<FOODICS_ORDER_ID>","status":"updated"}}Provider-defined payload; no general JSON schema validation is implemented. See Foodics webhook notes. |
POST /payment/webhook | Not documented as a working request: the route declaration points to a controller method that is not implemented. |
Response envelopes vary by controller. These samples show the JSON structure and field names; dynamic user, order, payment, configuration, and provider values are illustrative. Endpoint-specific response fields and conditions are listed in the contract tables above.
{
"remark": "general_setting",
"status": "success",
"message": { "success": ["General setting data"] },
"data": { "general_setting": { "site_name": "Be Healthy" } }
}{
"remark": "login_success",
"status": "success",
"message": { "success": ["Login successful"] },
"data": {
"user": { "id": 123, "email": "customer@example.com" },
"access_token": "<ACCESS_TOKEN_FROM_RESPONSE>",
"token_type": "Bearer"
}
}{
"remark": "cart",
"status": "success",
"message": { "success": ["Cart data"] },
"data": {
"currency": "AED",
"total_items": 1,
"total_products": 2,
"items": [{ "product_id": 12, "quantity": 2, "subtotal": 40.0 }],
"subtotal": 40.0,
"discount": 0.0,
"vat": 2.0,
"delivery_charge": 5.0,
"total": 47.0
}
}{
"remark": "payment_status",
"status": "success",
"message": { "success": ["Payment status retrieved"] },
"data": {
"deposit_id": 12345,
"transaction": "TRX-EXAMPLE-123",
"session_id": null,
"payment_status": "paid",
"stripe_payment_status": null,
"deposit_status": 1,
"is_paid": true,
"amount": 100.0,
"charge": 0.0,
"payable": 100.0,
"final_amount": 100.0,
"currency": "AED",
"order_id": 456,
"order_number": "ORD-456",
"subscription_id": null,
"pricing": null,
"updated_at": "2026-11-04T12:00:00Z"
}
}{
"remark": "fcm_token_updated",
"status": "success",
"message": { "success": ["FCM token registered or updated successfully"] },
"data": {
"id": 31,
"device_type": "android",
"device_id": "device-001",
"app_version": "1.0.0",
"status": "active",
"last_used_at": "2026-11-04 12:00:00"
}
}Validation keys and HTTP status depend on the endpoint. The examples below cover the two response formats used by the API; consult the operation contract for the fields and rules that trigger each error.
{
"message": "The given data was invalid.",
"errors": {
"email": ["The email field is required."],
"password": ["The password confirmation does not match."]
}
}{
"remark": "validation_error",
"status": "error",
"message": { "error": ["Select an available delivery time for the selected address."] },
"data": {
"delivery_time_preference": [
{ "key": "morning", "label": "Morning", "start_time": "09:00", "end_time": "12:00" }
]
}
}{
"remark": "validation_error",
"status": "error",
"message": {
"error": [
"The quantity must be at least 1.",
"The selected product is unavailable."
]
}
}The route declarations and controller implementation are not fully aligned in these places:
GET /deposit/confirm, GET /deposit/manual, and POST /deposit/manual reference API payment methods not found on the API PaymentController.POST /payment/webhook references paymentWebhook, which was not found on the API PaymentController.GET /payment/{depositId}/quick-status currently invokes the standard status action rather than a separate lightweight implementation.GET /withdraw-method, POST /withdraw-request, and POST /withdraw-request/confirm declare the kyc middleware alias, but that alias is not registered in bootstrap/app.php. Verify/fix the runtime middleware configuration before relying on these endpoints; their KYC form and request rules do not make an unregistered route middleware executable."status": "error"; clients should inspect the response body and this reference should be revised when those handlers are normalized.