Introduction

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.

General

Start with the API base URL, headers, authentication conventions, response formats, and public information endpoints.

Catalog

Browse products and cart behavior, then review addresses, delivery areas, branch operating hours, and delivery-area preferences.

Account

Find profile, verification, KYC, notifications, subscription-plan, and subscription-purchase workflows.

Orders & payments

Review daily orders, subscription deliveries, payment initiation, payment status, and transaction behavior.

Integrations

Understand Foodics integration endpoints, detailed endpoint contracts, and implementation notes or known gaps.

Endpoint examples

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.

1 · Base URL, headers, and conventions

All endpoints below are relative to:

Base URL
https://behealthy.dataduck.in/api

Send JSON requests with:

HTTP
Accept: application/json
Content-Type: application/json

Authenticated endpoints require a Sanctum bearer token:

HTTP
Authorization: Bearer <ACCESS_TOKEN>

Multipart requests (for example KYC fields or support attachments) should use multipart/form-data.

About example values Examples use synthetic, representative data to show the implemented API's field names, types, and response shapes; they are not claims about records currently stored in a particular environment. Before making a real request, obtain plan, program, address, area, slot, branch, product, payment-method, and other record IDs from that environment's API responses. Prices and gateway configuration are also runtime values. Access tokens, OTPs, reset/profile tokens, transaction references, and Paymennt checkout credentials are runtime-issued values and must not be copied from examples.

Language

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.

Common response patterns

Most successful API responses use:

JSON
{
  "remark": "operation_name",
  "status": "success",
  "message": {
    "success": ["Human-readable message"]
  },
  "data": {}
}

Most controller-generated errors use:

JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Reason"]
  }
}
HTTP status caveat The HTTP status is endpoint-specific. Some older/manual validation branches return HTTP 200 with "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 outcomes by route family

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:

Authorized request · protected endpoint
GET /api/orders
Accept: application/json
Authorization: ******;ACCESS_TOKEN>
Route familyAccess requirementMissing/invalid token or ineligible account
Public information and catalog reads; subscription-plan reads; login/register, OTP, and password recoveryNo 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 routesSanctum 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-methodsSanctum. 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 groupsSanctum 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/webhookPublic 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.
Protected endpoint · missing or invalid token (HTTP 401)
{
  "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.

Valid token · verification required (middleware error, usually HTTP 200)
{
  "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
  }
}
Valid token · profile completion required (middleware error, usually HTTP 200)
{
  "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.

Middleware terms

  • Public: No route-level authentication; API middleware/throttling still apply.
  • Sanctum: Requires a valid token in the Authorization header using Bearer <ACCESS_TOKEN>.
  • Verified account: check.status requires enabled account and verification flags (status, email, mobile, and 2FA where applicable); routes on its allowlist have relaxed checks.
  • Complete profile: registration.complete requires completed profile except for allowlisted browsing/profile/address routes.
  • The verification/profile middleware may return JSON errors with HTTP 200. A successful response body must still be checked for "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.

2 · Public information and support

All routes in this section are public GET endpoints unless specified.

Method & pathRequestResult & conditions
GET/general-settingNonedata.general_setting includes the public site_name field.
GET/onboardingNoneReturns 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/faqsNoneReturns active FAQs grouped by category, plus category names.
GET/faqs/{id}Path idReturns 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 categoryReturns active FAQs for the category, sorted by configured order.
GET/faqs/search/query?q={text}Optional query qSearches active FAQ question/answer text. Empty/missing q is not explicitly validated.
GET/support/helpNoneReturns the configured static support-method descriptors (WhatsApp, email, phone).
GET/contactNoneReturns active contact methods/configuration.
GET/get-countriesNoneReturns countries with country name, dialing code, and country code from the bundled country data.

Public endpoint contracts

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.

Framework and runtime failures Read-only handlers do not define custom database/server error envelopes. Each endpoint below shows its own representative production JSON response for an unexpected HTTP 500; exact framework messages may vary by environment. A missing FAQ detail record has its own HTTP 404 response.

General settings: GET /general-setting

Returns 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.

Example response
{
  "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.

Empty settings response · HTTP 200
{
  "remark": "general_setting",
  "status": "success",
  "message": {"success": ["General setting data"]},
  "data": {"general_setting": null}
}

Onboarding screens: GET /onboarding

Returns 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.

Example response
{
  "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.

No active onboarding screens · HTTP 200
{
  "remark": "onboarding_data",
  "status": "success",
  "message": {"success": ["Onboarding screens loaded"]},
  "data": {
    "screens": [],
    "get_started": null
  }
}

FAQ list grouped by category: GET /faqs

Returns 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.

Example response
{
  "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.

No active FAQs · HTTP 200
{
  "remark": "faq_list",
  "status": "success",
  "message": {"success": ["FAQs loaded"]},
  "data": {
    "categories": [],
    "faqs": []
  }
}

FAQ details: 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).

FAQ detail response
{
  "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.

FAQ not found · HTTP 404
{
  "message": "No query results for model [App\\Models\\Faq] 999"
}

FAQs by category: 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.

FAQs by category response
{
  "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.

No FAQs in category · HTTP 200
{
  "remark": "faq_by_category",
  "status": "success",
  "message": {"success": ["FAQs loaded"]},
  "data": {
    "category": "Unknown category",
    "faqs": []
  }
}

Search 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.

FAQ search response
{
  "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.

No FAQ matches · HTTP 200
{
  "remark": "faq_search",
  "status": "success",
  "message": {"success": ["Search results loaded"]},
  "data": {
    "query": "no-matching-question",
    "results_count": 0,
    "faqs": []
  }
}

Support help methods: GET /support/help

Returns 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.

Contact options: GET /contact

Returns 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.

Support and contact response examples
{
  "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"
      }
    ]
  }
}
Contact options example
{
  "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.

No active contact options · HTTP 200
{
  "remark": "contact_options",
  "status": "success",
  "message": {"success": ["Contact options loaded"]},
  "data": {"contact_options": []}
}

Country list: GET /get-countries

Returns 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.

Country list response — abbreviated
{
  "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.

Empty bundled country list · HTTP 200
{
  "remark": "country_data",
  "status": "success",
  "message": {"success": ["General setting data"]},
  "data": {"countries": []}
}

Authenticated support ticket submission: POST /support/ticket

POST /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.

Ticket request without attachment
{
  "full_name": "Customer Name",
  "email": "customer@example.com",
  "phone": "+971501234567",
  "subject": "Order question",
  "message": "Please help me with my order."
}
Ticket response
{
  "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.

Missing required ticket fields · HTTP 422
{
  "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:

Attachment upload failure · 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.

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}
Account verification required · HTTP 200
{
  "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
  }
}
Profile incomplete · HTTP 200
{
  "remark": "profile_incomplete",
  "status": "error",
  "message": {
    "error": ["Please complete your profile to go next"]
  }
}

3 · Authentication, verification, and password recovery

Login and registration

Method & pathRequestResult & errors
POST/auth/loginusername 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/registerRequired: 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/logoutSanctumRevokes all personal access tokens for the current user.
GET/logoutSanctumAlias for logout; revokes all current user's tokens.

Example login:

POST /auth/login · Request example
{
  "username": "customer@example.com",
  "password": "your-password"
}

SMS OTP registration

All OTP routes are public.

Method & pathRequired bodyConditions & response
POST/auth/otp/requestmobile_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/resendmobile_code, mobileResends an active challenge. Missing/expired challenge: 422; cooldown/rate limit: 429. Success includes expiry and resend interval.
POST/auth/otp/verifymobile_code, mobile, four-digit otpIncorrect/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-profileprofile_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.

Password reset and account verification

Method & pathRequestConditions & response
POST/auth/password/emailvalue string containing email or usernameSends 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-codeemail, six-character codeSuccess returns reset_token and expiry. Invalid/expired: 422; missing account: 404; throttled: 429.
POST/auth/password/resetemail, token (min 32), password, password_confirmationPassword 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/authorizationSanctumReturns/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 typetype=email sends email code; other values use SMS behavior. Two-minute resend window returns a wait/error message (currently commonly HTTP 200).
POST/verify-emailSanctum; codeVerifies email. Missing/incorrect code returns error JSON (manual branches may be HTTP 200).
POST/verify-mobileSanctum; codeVerifies mobile. Missing/incorrect code returns error JSON (manual branches may be HTTP 200).
POST/verify-g2faSanctum; codeConfirms 2FA. Missing/incorrect code returns error JSON (manual branches may be HTTP 200).

Endpoint reference

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.

Recommended customer authentication flow Use 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 groupAuthenticationTypical error statusesNotes
POST /auth/login, POST /auth/registerPublicManual input/credential errors use HTTP 200 with status: "error".Always inspect the JSON status. Admin accounts cannot use customer login.
POST /auth/otp/*Public422 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/*Public422 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-*Sanctum401 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.

POST /auth/login · Login

Public; 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.

Request body · JSON
{
  "email": "customer@example.com",
  "password": "your-password"
}

Success · HTTP 200

Response · JSON
{
  "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

Error response · JSON
{
  "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.

Missing login fields · HTTP 200
{
  "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:

Protected endpoint requires authentication · HTTP 401
{
  "message": "Unauthenticated."
}

POST /auth/register · Register

Public; 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.

Request body · JSON
{
  "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.

Response · JSON
{
  "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.

Error response · JSON
{
  "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.

Phone already registered · HTTP 200
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["The mobile number already exists"]
  }
}
Username contains unsupported characters · HTTP 200
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["No special character, space or capital letters in username."]
  }
}

POST /auth/otp/request · Request SMS code

Public; 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.

Request body · JSON
{
  "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.

Response · JSON
{
  "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.

Validation response · JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "The selected country and dial code do not match."
    ]
  },
  "data": {}
}
Resend cooldown · HTTP 429
{
  "remark": "resend_cooldown",
  "status": "error",
  "message": {
    "error": ["Please wait before requesting another code."]
  },
  "data": {
    "retry_after": 37
  }
}
Phone/IP hourly rate limit · HTTP 429
{
  "remark": "otp_rate_limited",
  "status": "error",
  "message": {
    "error": ["Too many OTP requests. Please try again later."]
  },
  "data": {}
}
SMS provider not configured · HTTP 503
{
  "remark": "sms_not_configured",
  "status": "error",
  "message": {
    "error": ["Twilio SMS is not configured. Contact support."]
  },
  "data": {}
}
SMS delivery failed · HTTP 502
{
  "remark": "otp_delivery_failed",
  "status": "error",
  "message": {
    "error": ["We could not send your verification code. Please try again later."]
  },
  "data": {}
}

POST /auth/otp/resend · Resend SMS code

Public; 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.

Request body · JSON
{
  "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.

Resend success · HTTP 200 · JSON
{
  "remark": "otp_resent",
  "status": "success",
  "message": {
    "success": ["Verification code sent."]
  },
  "data": {
    "mobile": "+971501234567",
    "expires_in": 300,
    "resend_after": 60
  }
}
Validation response · JSON
{
  "remark": "otp_expired",
  "status": "error",
  "message": {
    "error": [
      "Request a new verification code to continue."
    ]
  },
  "data": {}
}
Resend cooldown · HTTP 429
{
  "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):

OTP request rate limit · HTTP 429
{
  "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.

SMS provider not configured · HTTP 503
{
  "remark": "sms_not_configured",
  "status": "error",
  "message": {
    "error": ["Twilio SMS is not configured. Contact support."]
  },
  "data": {}
}
SMS delivery failed · HTTP 502
{
  "remark": "otp_delivery_failed",
  "status": "error",
  "message": {
    "error": ["We could not send your verification code. Please try again later."]
  },
  "data": {}
}

POST /auth/otp/verify · Verify SMS code

Public; 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.

Request body · JSON
{
  "mobile_code": "+971",
  "mobile": "501234567",
  "otp": "1234"
}

New phone success · HTTP 200; profile_token expires in 900 seconds.

Response · JSON
{
  "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.

Validation response · JSON
{
  "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):

Existing account verified and logged in · HTTP 200
{
  "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"
  }
}
Verification attempts exceeded · HTTP 429
{
  "remark": "otp_attempts_exceeded",
  "status": "error",
  "message": {
    "error": ["Too many incorrect codes. Request a new one."]
  },
  "data": {}
}
Existing account unavailable · HTTP 403
{
  "remark": "account_unavailable",
  "status": "error",
  "message": {
    "error": ["This account is unavailable. Contact support for help."]
  },
  "data": {}
}

POST /auth/otp/complete-profile · Complete SMS registration

Public; 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.

Request body · JSON
{
  "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.

Response · JSON
{
  "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.

Validation response · JSON
{
  "remark": "verification_expired",
  "status": "error",
  "message": {
    "error": [
      "Phone verification expired. Request and verify a new code."
    ]
  },
  "data": {}
}
Invalid profile fields · HTTP 422
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "The full name field is required.",
      "The email must be a valid email address."
    ]
  },
  "data": {}
}
Phone already has an account · HTTP 409
{
  "remark": "account_exists",
  "status": "error",
  "message": {
    "error": ["An account already exists for this phone number. Please log in."]
  },
  "data": {}
}

POST /auth/password/email · Request password reset code

Public; 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.

Request body · JSON
{
  "value": "customer@example.com"
}

Success · HTTP 200.

Response · JSON
{
  "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.

Validation response · JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "The value field is required."
    ]
  }
}
Account not found · HTTP 404
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Couldn't find any account with this information"]
  }
}
Email delivery unavailable · HTTP 503
{
  "remark": "email_delivery_failed",
  "status": "error",
  "message": {
    "error": ["Unable to send the reset code. Please check SMTP settings."]
  }
}
Request rate limit · HTTP 429
{
  "remark": "too_many_requests",
  "status": "error",
  "message": {
    "error": ["Too many OTP requests. Please try again later."]
  },
  "data": {
    "retry_after": 240
  }
}

POST /auth/password/verify-code · Verify reset code

Public; 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.

Request body · JSON
{
  "email": "customer@example.com",
  "code": "123456"
}

Success · HTTP 200.

Response · JSON
{
  "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.

Validation response · JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "Verification code doesn't match"
    ]
  }
}
Account not found · HTTP 404
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Couldn't find any account with this email."]
  }
}
Code expired · HTTP 422
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Verification code has expired. Please request a new code."]
  }
}
Verification rate limit · HTTP 429
{
  "remark": "too_many_requests",
  "status": "error",
  "message": {
    "error": ["Too many verification attempts. Please request a new code."]
  },
  "data": {
    "retry_after": 240
  }
}

POST /auth/password/reset · Set new password

Public; 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.

Request body · JSON
{
  "email": "customer@example.com",
  "token": "<RESET_TOKEN_FROM_RESPONSE>",
  "password": "NewExample!234",
  "password_confirmation": "NewExample!234"
}

Success · HTTP 200. The reset token is invalidated.

Response · JSON
{
  "remark": "password_changed",
  "status": "success",
  "message": {
    "success": [
      "Password changed successfully"
    ]
  }
}

Invalid/expired token or password rules · HTTP 422; missing account · HTTP 404.

Validation response · JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "Invalid or expired reset token."
    ]
  }
}
Account not found for reset token · HTTP 404
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Couldn't find the account."]
  }
}
Password validation failed · HTTP 422
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "The password confirmation does not match."
    ]
  }
}
Reset token expired · HTTP 422
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Reset token has expired. Please request a new password reset code."]
  }
}

GET /auth/logout · Logout

Requires Authorization: Bearer <ACCESS_TOKEN>. No request body. Revokes all personal access tokens for the current user.

Success · HTTP 200 · JSON
{
  "remark": "logout",
  "status": "ok",
  "message": {
    "success": [
      "Logout Successful"
    ]
  }
}

Missing or invalid bearer token · HTTP 401:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

GET /logout · Logout alias

Same Sanctum authentication and behavior as /auth/logout. No request body; all current-user tokens are revoked.

Success · HTTP 200 · JSON
{
  "remark": "logout",
  "status": "ok",
  "message": {
    "success": ["Logout Successful"]
  }
}

Missing or invalid bearer token · HTTP 401:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

GET /authorization · Start account verification

Requires 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.

Success · HTTP 200 · JSON
{
  "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.

Already verified · HTTP 200, error in JSON
{
  "remark": "already_verified",
  "status": "error",
  "message": {
    "error": ["You are already verified"]
  }
}

Missing or invalid bearer token · HTTP 401:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

GET /resend-verify/{type} · Resend verification code

Requires 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.

Success · HTTP 200 · JSON
{
  "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.

Resend cooldown · HTTP 200, error in JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Please try after 83 seconds"]
  }
}

Missing or invalid bearer token · HTTP 401:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

POST /verify-email · Verify email

Requires a bearer token and a code from the email verification message.

Request body · JSON
{
  "code": "123456"
}

Success · HTTP 200.

Response · JSON
{
  "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"]}}.

Missing code · HTTP 200, error in JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["The code field is required."]
  }
}
Incorrect email code · HTTP 200, error in JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Verification code doesn't match"]
  }
}

Missing or invalid bearer token · HTTP 401:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

POST /verify-mobile · Verify mobile

Requires a bearer token and an SMS code.

Request body · JSON
{
  "code": "123456"
}

Success · HTTP 200.

Response · JSON
{
  "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.

Missing mobile code · HTTP 200, error in JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["The code field is required."]
  }
}
Incorrect mobile code · HTTP 200, error in JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Verification code doesn't match"]
  }
}

Missing or invalid bearer token · HTTP 401:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

POST /verify-g2fa · Verify two-factor code

Requires a bearer token and the user's current 2FA code.

Request body · JSON
{
  "code": "123456"
}

Success · HTTP 200.

Response · JSON
{
  "remark": "twofa_verified",
  "status": "success",
  "message": {
    "success": [
      "Verification successful"
    ]
  }
}

Missing/incorrect code returns validation_error; current manual error branches use HTTP 200.

Missing 2FA code · HTTP 200, error in JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["The code field is required."]
  }
}
Incorrect 2FA code · HTTP 200, error in JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Wrong verification code"]
  }
}

Missing or invalid bearer token · HTTP 401:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

4 · Catalog, product details, and cart

Browse

Method & pathRequestResult & conditions
GET/daily-order-homePublic; optional langHome 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/categoriesPublic; optional langReturns active Be Healthy Foodics categories. Add-on/deleted/inactive categories are excluded.
GET/productsPublic. 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 IDReturns 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}/reviewsSanctum bearer token; optional per_page, pageper_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/toggleSanctum bearer token; no bodyAdds 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.

Catalog endpoint contracts

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.

Home feed: GET /daily-order-home

Optional 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.

Request · HTTP
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.

Example response — arrays abbreviated
{
  "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"}
  }
}

Categories: GET /categories

No 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.

Request · HTTP
GET /api/categories?lang=en
Accept: application/json
Example response
{
  "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:

No matching categories · HTTP 200
{
  "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.

Product listing and filters: GET /products

No body. Optional query fields:

Query fieldBehaviorValidation
category_idExact 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.
categoryExact, case-sensitive match against the category's source name, localized name, or current display name.No explicit validation.
meal_typeSame category-name matching behavior as category.No explicit validation.
searchCase-insensitive substring match in the product's source and localized names.No explicit validation; an empty value is ignored.
min_price, max_priceNumeric lower/upper price comparisons; both bounds are inclusive.No explicit numeric validation or min/max ordering check; values are cast for comparison.
sortlatest (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.

Request · HTTP
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.

Example response — abbreviated provider fields
{
  "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:

No matching products · HTTP 200
{
  "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.

Product details and customizations: 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).

Request · HTTP
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.

Example response — arrays abbreviated
{
  "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:

Not found · JSON
{
  "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.

Product reviews: GET /products/{id}/reviews

Requires 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".

Request · HTTP
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.

Example response — pagination abbreviated
{
  "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.

Product not found · JSON
{
  "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.

No reviews · HTTP 200
{
  "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:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

Wishlist toggle: POST /products/{id}/wishlist/toggle

Requires 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.

Request · HTTP
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".

Example response
{
  "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:

Not found · JSON
{
  "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):

Wishlist item removed · 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:

Unauthenticated · HTTP 401
{
  "message": "Unauthenticated."
}

Cart

All cart endpoints require a Sanctum bearer token. Their route middleware allowlists them from verified-account and completed-profile checks.

Method & pathRequestResult & conditions
GET/cartNoneReturns cart items, currency, quantities, prices/subtotals, address, discount/tax/delivery totals.
POST/cart/itemsproduct_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:

POST /cart/items · Request body 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.

POST /cart/items · Example cart response — abbreviated
{
  "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"
  }
}

Cart operation examples

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:

GET /cart · Unauthenticated · HTTP 401 · applies to cart endpoints
{
  "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.

Read cart: GET /cart

No body, query parameters, or endpoint-specific validation. An empty cart is a successful response with zero totals.

Request · HTTP
GET /api/cart
Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4
Accept: application/json
Empty cart response · HTTP 200 · 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"
  }
}
POST /orders/{orderId}/foodics-sync · order missing or not owned (HTTP 404)
{
  "remark": "order_not_found",
  "status": "error",
  "message": {"error": ["Order not found"]}
}

Add item: POST /cart/items

Requires 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.

Request · HTTP
POST /api/cart/items
Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4
Accept: application/json
Content-Type: application/json
Request body · 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.

Success · HTTP 200 · JSON
{
  "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"
  }
}
Validation · HTTP 422 · JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": { "error": ["The product id field is required."] }
}
Product unavailable · HTTP 422
{
  "remark": "product_unavailable",
  "status": "error",
  "message": { "error": ["Product is currently unavailable"] }
}
Customization rules failed · HTTP 422
{
  "remark": "customization_validation_error",
  "status": "error",
  "message": {
    "error": [
      "Please select at least 1 option(s) for Size. Available options: 4: Regular, 7: Large."
    ]
  }
}
Disabled dish · HTTP 404
{
  "remark": "product_not_found",
  "status": "error",
  "message": { "error": ["Product not found"] }
}

Update item: 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.

Request · HTTP
PUT /api/cart/items/31
Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4
Accept: application/json
Content-Type: application/json
Request body · 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.

Updated cart · HTTP 200
{
  "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"
  }
}
Validation · HTTP 422 · JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": { "error": ["The quantity field is required."] }
}
Product unavailable · HTTP 422
{
  "remark": "product_unavailable",
  "status": "error",
  "message": { "error": ["Product is currently unavailable"] }
}
Customization rules failed · HTTP 422
{
  "remark": "customization_validation_error",
  "status": "error",
  "message": {
    "error": [
      "One or more customization options are invalid for this product."
    ]
  }
}
Cart row not found · HTTP 404 · JSON
{
  "remark": "cart_item_not_found",
  "status": "error",
  "message": { "error": ["Cart item not found"] }
}

Remove item: 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.

Request · HTTP
DELETE /api/cart/items/12
Authorization: Bearer 1|e3b0c44298fc1c149afbf4c8996fb92427ae41e4
Accept: application/json
Success · HTTP 200 · 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"
  }
}
Cart item not found · HTTP 404 · JSON
{
  "remark": "cart_item_not_found",
  "status": "error",
  "message": { "error": ["Cart item not found"] }
}

5 · Addresses, branches, and delivery slots

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.

Address operations

Method & pathRequestResult & conditions
GET/user/addressesNoneLists 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/addressesRequired: 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 IDCaller-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 IDDeletes caller-owned address. If it was default, latest remaining address is promoted. Missing/foreign: 404.
POST/user/addresses/{id}/set-defaultPath address ID; no bodySets caller-owned address as default and clears other defaults. Missing/foreign: 404.
GET/user/addresses/delivery-areasNoneLists active delivery areas, separated by emirate/area, with active slots.
GET/user/addresses/delivery-time-preferences?delivery_area_id={id}Active integer delivery_area_idReturns available time preferences for the active area. Missing/invalid/inactive area: 422.

Address API contracts

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.

List addresses: GET /user/addresses

No body or query parameters. Returns caller-owned addresses newest first, with data.total_addresses and data.addresses[]. The array may be empty.

Create an address: POST /user/addresses

Send a JSON body. Required fields:

FieldRuleBehavior
nameRequired string, max 100 characters.Customer's label/name for the address.
contact_numberRequired string, max 40 characters.Contact number for delivery.
delivery_area_idRequired 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_preferenceRequired 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.

Create request
{
  "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
}

Read one address: 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.

Update an address: 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.

Set default: POST /user/addresses/{id}/set-default

No 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 address: 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.

Address response example

Address details — abbreviated slot fields
{
  "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"
    }
  }
}

Delivery areas and delivery time slots

List active areas: GET /user/addresses/delivery-areas

No 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.

Delivery areas response
{
  "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"
          }
        ]
      }
    ]
  }
}

List slots for an area: 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.

Branches and delivery options

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.

List branches: GET /branches

Requires 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.

Delivery method choices: GET /delivery-methods

Requires 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.

Set default branch: PUT /user/default-branch

Requires 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".

Branch list response — abbreviated
{
  "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": []
      }
    ]
  }
}
Set default branch request
{"branch_id": 3}
Method & pathAuthResult
GET/branchesSanctum; allowlisted from verification/profile gatesActive branches, default-branch marker, daily-order hours and current availability.
GET/delivery-areasSanctum + verified + complete profileActive delivery areas and slot configuration.
GET/delivery-time-preferences?delivery_area_id={id}Sanctum; allowlisted from verification/profile gatesSlot choices for specified active area; invalid/missing ID returns validation error.
GET/delivery-methodsSanctum; allowlisted from verification/profile gatesSupported methods standard_delivery and branch_pickup, plus active branches and their daily-order hours/status.
PUT/user/default-branchSanctum; allowlisted from verification/profile gatesBody branch_id integer; branch must exist and be active. Success returns selected branch; invalid branch: 422.
Daily order hours Branch hours are operating hours, not customer-selected time slots. Use 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.

6 · Account profile, KYC, notifications, and withdrawals

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.

Account basics

Method & pathRequestResult & conditions
POST/user-data-submitRequires firstname, lastname; accepts profile/address fields.Used to complete profile when registration step permits. Sets user details and completes registration.
GET/dashboardNoneReturns authenticated user object directly.
GET/user-infoNoneReturns user inside standard data.user envelope.
GET/profileNoneReturns profile, image URL, and verification flags.
POST/profile or POST/profile-settingRequires 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-passwordcurrent_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/historyOptional search transaction reference.Paginated caller deposit history. The route accepts any verb, but clients should use GET.
GET/transactionsOptional search, type (plus or other), remark.Paginated transaction history and remark choices.

KYC

Method & pathRequestResult & conditions
GET/kyc-formNoneReturns currently configured dynamic KYC fields. A pending review or verified account cannot submit again; controller returns error JSON.
POST/kyc-submitMultipart/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.

Push notifications

Method & pathRequestResult
POST/push-notification/registerdevice_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/removedevice_tokenRemoves caller-owned device token and returns whether removed.
GET/push-notification/devicesNoneLists caller's registered devices.
POST/push-notification/sendRequired 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.

Withdrawals

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 & pathRequestResult & conditions
GET/withdraw-methodNoneLists active withdrawal methods and configured dynamic form.
POST/withdraw-requestmethod_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/confirmtrx 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/historyOptional search transaction reference.Paginated caller withdrawals; pending status 0 excluded.

Account deletion request

Method & pathRequestResult
GET/account/delete-infoNoneExplains deletion and permanence; does not delete account.
POST/account/confirm-deleteRequired 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.

Endpoint response examples

GET /profile

GET /profile · successful response
{
  "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-delete

Success 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.

POST /account/confirm-delete · successful response
{
  "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>"
  }
}

Detailed endpoint guide

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 /dashboard

Requires 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.

GET /dashboard · direct user object (abbreviated)
{
  "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-info

Uses the same access middleware as the dashboard, but returns the current user under data.user with the standard user_info success envelope.

GET /user-info · response (abbreviated)
{
  "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 /profile

Returns 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-submit

This 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.

POST /user-data-submit · request
{
  "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).

POST /user-data-submit · success
{
  "remark": "profile_completed",
  "status": "success",
  "message": {"success": ["Profile completed successfully"]}
}
POST /user-data-submit · already completed (HTTP 200)
{
  "remark": "already_completed",
  "status": "error",
  "message": {
    "error": ["You've already completed your profile"]
  }
}
POST /user-data-submit · required names missing (HTTP 200)
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "The firstname field is required.",
      "The lastname field is required."
    ]
  }
}
GET /user-info · response shape
{
  "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-setting

These 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.

POST /profile · request body JSON fields (upload separately as multipart)
{
  "firstname": "Sam",
  "lastname": "Customer",
  "gender": "female",
  "date_of_birth": "1995-04-12"
}
POST /profile · success (abbreviated)
{
  "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
    }
  }
}
POST /profile · validation error (legacy HTTP 200)
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["The firstname field is required."]
  }
}

POST /change-password

Requires 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.

POST /change-password · request
{
  "current_password": "<CURRENT_PASSWORD>",
  "password": "<NEW_PASSWORD>",
  "password_confirmation": "<NEW_PASSWORD>"
}
POST /change-password · incorrect current password
{
  "remark": "validation_error",
  "status": "error",
  "message": {"error": ["The password doesn't match!"]}
}
POST /change-password · success
{
  "remark": "password_changed",
  "status": "success",
  "message": {
    "success": ["Password changed successfully"]
  }
}

GET /kyc-form

Returns 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).

GET /kyc-form · response shape (empty configured form)
{
  "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.

GET /kyc-form · already under review (HTTP 200)
{
  "remark": "under_review",
  "status": "error",
  "message": {
    "error": ["Your KYC is under review"]
  }
}
GET /kyc-form · already verified (HTTP 200)
{
  "remark": "already_verified",
  "status": "error",
  "message": {
    "error": ["You are already KYC verified"]
  }
}

POST /kyc-submit

Submit 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:

POST /kyc-submit · success
{
  "remark": "kyc_submitted",
  "status": "success",
  "message": {"success": ["KYC data submitted successfully"]}
}
POST /kyc-submit · configured-field validation error (message varies)
{
  "remark": "validation_error",
  "status": "error",
  "message": {"error": ["<VALIDATION_MESSAGE_FOR_A_CONFIGURED_FIELD>"]}
}

GET /deposit/history

Although 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.

GET /deposit/history · empty result (abbreviated)
{
  "remark": "deposits",
  "status": "success",
  "message": {"success": ["Deposit data"]},
  "data": {
    "deposits": {
      "current_page": 1,
      "data": [],
      "per_page": 10,
      "total": 0
    }
  }
}

GET /transactions

Optional 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.

GET /transactions · empty result shape
{
  "remark": "transactions",
  "status": "success",
  "message": {"success": ["Transactions data"]},
  "data": {
    "transactions": {
      "current_page": 1,
      "data": [],
      "per_page": 10,
      "total": 0
    },
    "remarks": []
  }
}

POST /push-notification/register

Requires 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.

POST /push-notification/register · request
{
  "device_token": "<FCM_DEVICE_TOKEN>",
  "device_type": "android",
  "device_id": "device-001",
  "app_version": "1.0.0"
}

POST /push-notification/remove

Requires 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/devices

Returns only the caller's device metadata (not the token itself), newest updated first. No devices is a successful empty data.devices array.

GET /push-notification/devices · empty result
{
  "remark": "push_notification_devices",
  "status": "success",
  "message": {"success": ["Device list fetched successfully"]},
  "data": {"devices": []}
}
POST /push-notification/register · success
{
  "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:

POST /push-notification/remove · request body
{
  "device_token": "<FCM_DEVICE_TOKEN>"
}

POST /push-notification/send

Requires 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.

POST /push-notification/send · no active devices
{
  "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.

POST /push-notification/remove · token not found
{
  "remark": "push_notification_removed",
  "status": "success",
  "message": {"success": ["Device token was not found"]},
  "data": {"removed": false}
}

GET /withdraw-method

Requires KYC middleware. Returns enabled withdrawal methods and their configured metadata; an empty configured list returns an empty data.withdrawMethod array.

GET /withdraw-method · no active methods (HTTP 200)
{
  "remark": "withdraw_methods",
  "status": "success",
  "message": {
    "success": ["Withdrawals methods"]
  },
  "data": {
    "withdrawMethod": []
  }
}

POST /withdraw-request

Requires 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.

POST /withdraw-request · request
{
  "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".

POST /withdraw-request · success (dynamic form abbreviated)
{
  "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/confirm

Requires 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.

POST /withdraw-request/confirm · request shape
{
  "trx": "<TRANSACTION_REFERENCE_FROM_REQUEST>",
  "authenticator_code": "<ONLY_IF_2FA_ENABLED>",
  "<CONFIGURED_METHOD_FIELD>": "<CUSTOMER_VALUE>"
}
POST /withdraw-request/confirm · success
{
  "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/history

Requires 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.

GET /withdraw/history · empty result (abbreviated)
{
  "remark": "withdrawals",
  "status": "success",
  "message": {"success": ["Withdrawals"]},
  "data": {
    "withdrawals": {
      "current_page": 1,
      "data": [],
      "per_page": 10,
      "total": 0
    }
  }
}

GET /account/delete-info

Returns the deletion warning and categories of data/access affected. It does not create a request or delete any user data.

GET /account/delete-info · response
{
  "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-delete

Requires 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.

POST /account/confirm-delete · request
{
  "password": "<CURRENT_PASSWORD>",
  "reason": "I no longer need this account"
}
POST /account/confirm-delete · incorrect password
{
  "remark": "invalid_password",
  "status": "error",
  "message": {"error": ["Password is incorrect"]}
}
POST /account/confirm-delete · request already pending (HTTP 409)
{
  "remark": "deletion_request_exists",
  "status": "error",
  "message": {
    "error": ["You already have a deletion request pending"]
  }
}

7 · Subscription plans

For purchase pricing, Stripe/Paymennt flows, and purchase-specific validation, see 8 · Subscription purchase.

Plans

Method & pathRequestResult & 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}/detailsPublic; 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.

Public plan listing: 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 valuePrograms selectedReturned data.type
allAll programs related to enabled plansall
delivery or delivery_subscriptionsubscription_plan = delivery_subscriptiondelivery_subscription
pickup or pickup_subscriptionsubscription_plan = pickup_subscriptionpickup_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.

Example response — abbreviated plan values
{
  "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: [].

Plan details and menu: GET /subscription-plans/{plan}/details

This 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.
Example response — menu arrays abbreviated
{
  "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.

Authenticated subscription and checkout endpoints

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 & pathRequestResult & conditions
GET/payment-methodsSanctum; 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/methodsSanctum + complete profile; allowlisted from the verification gate.Alias of payment-method listing.
GET/checkoutSanctum; allowlisted from verification/profile gates.Returns current cart summary, default address, delivery methods, branches, and payment methods.
GET/delivery-methodsSanctum; allowlisted from verification/profile gates.Returns standard delivery/branch pickup choices and branches with daily-order hours/status.
GET/couponsSanctum; allowlisted from verification/profile gates.Lists currently eligible/available coupons.
POST/coupon/applyRequired 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}/statusPath subscription ID.Caller-owned subscription status, payment status, dates, plan/program, pricing/payment totals. Missing/foreign: 404.
POST/subscription/{id}/retry-paymentRequired 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-dashboardSanctum; allowlisted from verification/profile gates.Returns subscription dashboard data for caller.
GET/user/active-subscriptionNoneReturns 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}/pausePath ID; no body specified.Pauses eligible caller subscription; response includes status/pause data.
POST/user/subscriptions/{subscription}/resumePath ID; no body specified.Resumes eligible paused caller subscription; response includes status/dates.

8 · Subscription purchase API

Authenticated REST API for purchasing delivery and pickup subscriptions using Stripe or Paymennt. Cash on Delivery and account balance are not covered here.

Endpoint and authentication: POST /subscription/purchase

HTTP
POST /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.

Select a payment gateway

First request the enabled methods:

HTTP
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.

Common request fields

FieldRequiredDescription
program_idYesExisting program ID. The program must be active and have a subscription type.
plan_idYesActive plan ID belonging to program_id.
start_dateYesDate in YYYY-MM-DD format; today or later.
gatewayYesUse "stripe" or "paymennt" for the flows documented here.
method_codeYesInteger method_code from the selected entry in GET /api/payment-methods.
currencyYesCurrency from the selected payment-method entry.
terms_acceptedYestrue or 1.
meal_selectionsNoOptional map keyed by plan day ID. When provided, every plan day must have exactly one eligible meal in each included meal category.
allergen_idNoArray of active allergen IDs.
dislike_idNoArray of active dislike IDs.
snacksNoBoolean. Snack price is AED 6 per subscription day when selected.
coupon_codeNoOptional valid coupon code.

Use the plan details and saved-address API responses to obtain IDs and available delivery slots before submitting the purchase.

Delivery subscription

The plan's program must have subscription_plan: "delivery_subscription".

Required delivery-specific fields

FieldRequiredDescription
address_idYesID of an address belonging to the authenticated user.
delivery_time_preferenceYes in practiceActive 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_weekdaysYesNon-empty array. Allowed values: Monday, Tuesday, Wednesday, Thursday, Friday, Sunday.

Optional

FieldDescription
branch_idOptional active branch ID.
cool_bagBoolean. true is allowed only for delivery subscriptions.
Discovering valid slot keys To discover valid slot keys, call the authenticated address list/show endpoint and read available_delivery_time_slots. Each slot includes key, label, start_time, end_time, and a time range. Send its key as delivery_time_preference.

Stripe delivery request

JSON
{
  "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
}

Paymennt delivery request

JSON
{
  "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
}

Pickup subscription

The plan's program must have subscription_plan: "pickup_subscription".

Required pickup-specific field

FieldRequiredDescription
branch_idYesID of an active pickup branch.
Pickup restrictions Do not send address_id, delivery_time_preference, or delivery_weekdays for pickup. cool_bag: true is rejected for pickup.

Stripe pickup request

JSON
{
  "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
}

Paymennt pickup request

JSON
{
  "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
}

Successful response

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.

JSON
{
  "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"
    }
  }
}

Stripe client flow

For Stripe, the response also includes:

  • data.payment_page_url
  • data.redirect_url
Verify server-side Open redirect_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.

Paymennt client flow

For a Paymennt API purchase, the response's data.payment also includes:

JSON
{
  "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:

JSON
{
  "payment_flow": "native_sdk",
  "checkout_id": "<CHECKOUT_ID_FROM_PAYMENNT>",
  "checkout_key": "<CHECKOUT_KEY_FROM_PAYMENNT>",
  "redirect_url": null
}
Native SDK flow Start Paymennt's native checkout using the SDK and the returned checkout credentials/environment. Do not attempt to open redirect_url for this native flow; it is null. After checkout, poll the server status endpoint to confirm the final result.

Pricing notes

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.

9 · Daily orders and subscription deliveries

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.

Daily order lifecycle: cart to completion

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.

  1. Prepare checkout. Load the customer's cart, delivery addresses/areas, active branches and their daily-order hours/status, and enabled payment methods. Use a delivery-area preference ID only when the selected address has active preferences; branch hours are enforced automatically. Subscription meal-delivery schedules are a separate flow documented below.
  2. Place the order. Submit the current cart selection and delivery/payment fields to 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.
  3. Handle the payment branch. Balance and pay-on-delivery orders are placed immediately. For other gateways, the response includes an order and deposit in initiated state, along with payment handoff, callback, and status-check information. Keep the order ID and deposit ID.
  4. Confirm payment on the server. Complete the provider flow, then use 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.
  5. Follow order fulfillment. Use 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.
  6. Finish and retain the record. When the fulfillment system reports delivery, the order list/detail shows its delivered state. Retrieve 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.
Payment callbacks and fulfillment are different steps 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.

Order and payment state reference

Lifecycle pointOrder statePayment state / next action
External gateway startedRaw status 0 (initiated)Deposit status 0 (initiated); continue provider checkout and poll status.
Payment confirmedRaw status 1 (pending)Deposit status 1 (paid); the payment-success workflow attempts Foodics sync and clears the cart.
Balance / pay on delivery placementRaw status 1 (pending)Balance returns paid; pay-on-delivery returns cash_on_delivery. Both clear the cart and attempt Foodics sync.
In fulfillmentRaw status 2 (out_for_delivery)Read order status/details; no customer API mutation is provided.
FulfilledRaw status 3 or 4 (delivered)Invoice is available; rating is allowed for an item on this order.
CancelledRaw status 5 (cancelled)May result from an eligible customer cancellation, rejected payment, or failed Paymennt checkout initialization.

Daily orders

Method & pathRequestResult & conditions
POST/ordersRequired 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/ordersOptional 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}/detailsPath 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}/cancelRequired 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}/rateRequired 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}/arrivedNo 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}/invoiceNo body.Returns invoice summary for caller-owned order; missing/foreign: 404.
POST/orders/{orderId}/foodics-syncNo body.Manually syncs eligible paid/COD order. Missing: 404; unpaid/ineligible: 409; Foodics sync failure: 422.

Example saved-address delivery request:

JSON
{
  "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):

JSON
{
  "delivery_method": "branch_pickup",
  "branch_id": 3,
  "gateway": "stripe",
  "method_code": 123,
  "currency": "AED"
}

Subscription delivery changes and add-ons

Method & pathRequestResult & conditions
POST/subscription-deliveries/{mealId}/rescheduleRequired scheduled_at, valid date/time after now.Updates caller-owned pending delivery. Validation: 422; missing/foreign: 404; non-pending: 422.
GET/subscription-deliveries/{mealId}/addonsNo body.Returns available add-ons and existing requests for caller's delivery. Missing/foreign: 404.
POST/subscription-deliveries/{mealId}/addonsRequired 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.

Endpoint response examples

POST /orders

If 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.

POST /orders · empty-cart error
{
  "remark": "cart_empty",
  "status": "error",
  "message": {
    "error": ["Cart is empty"]
  }
}

Detailed endpoint guide

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.

Place a daily order: POST /orders

Submit 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.

List orders: GET /orders

Optional 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 /orders · no filters
GET /api/orders
GET /orders · no orders yet (HTTP 200)
{
  "remark": "orders",
  "status": "success",
  "message": {
    "success": ["User orders"]
  },
  "data": {
    "filter": "all",
    "total_orders": 0,
    "orders": []
  }
}
GET /orders · upcoming filter with no matching orders
GET /api/orders?status=upcoming
GET /orders · no upcoming orders (HTTP 200)
{
  "remark": "orders",
  "status": "success",
  "message": {
    "success": ["User orders"]
  },
  "data": {
    "filter": "upcoming",
    "total_orders": 0,
    "orders": []
  }
}
GET /orders · search with no matching order or meal
GET /api/orders?search=not-found
GET /orders · search has no matches (HTTP 200)
{
  "remark": "orders",
  "status": "success",
  "message": {
    "success": ["User orders"]
  },
  "data": {
    "filter": "all",
    "total_orders": 0,
    "orders": []
  }
}
  • Daily-order statuses: raw 0/1 → upcoming, 2 → ongoing, 3/4 → delivered, 5 → cancelled.
  • Subscription-delivery statuses: pending → upcoming; out_for_delivery/delivered → ongoing; received → delivered; cancelled → cancelled.
  • Each item is tagged type: "order" or type: "subscription". Use the matching details contract below for its full representation.
GET /orders · populated result (abbreviated)
{
  "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}]
      }
    ]
  }
}

Order details: GET /orders/{orderId}/details

The 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.

GET /orders/SUB-501/details · subscription delivery response (abbreviated)
{
  "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": []
    }
  }
}

Cancel an order: POST /orders/{orderId}/cancel

Send 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.

POST /orders/{orderId}/cancel · request
{"reason": "I need to change my order"}

Rate an ordered item: POST /orders/{orderId}/rate

Requires 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.

POST /orders/{orderId}/rate · request
{"dish_id": 12, "rating": 5, "message": "Excellent"}
POST /orders/{orderId}/rate · duplicate review
{
  "remark": "already_rated",
  "status": "error",
  "message": {"error": ["You have already rated this product"]}
}

Report arrival for pickup: POST /orders/{orderId}/arrived

No 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.

Invoice: GET /orders/{orderId}/invoice

Returns 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.

Foodics sync retry: POST /orders/{orderId}/foodics-sync

No 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.

Subscription delivery reschedule and add-ons

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.

POST /subscription-deliveries/{mealId}/addons · request
{
  "addons": [{"addon_id": 2, "quantity": 1}],
  "note": "Please include with delivery"
}
POST /subscription-deliveries/{mealId}/reschedule · request
{
  "scheduled_at": "2026-11-12 10:30:00"
}
POST /subscription-deliveries/{mealId}/reschedule · success (abbreviated)
{
  "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"
    }
  }
}
POST /orders/{orderId}/cancel · success
{
  "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}
  }
}
POST /orders/{orderId}/arrived · success
{
  "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}
  }
}
POST /orders/{orderId}/foodics-sync · not eligible
{
  "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."
    }
  }
}

Additional request and condition-specific response examples

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.

List orders with filters: GET /orders

Send 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 /orders · upcoming filter and search
GET /api/orders?status=upcoming&search=chicken
GET /orders · mixed order and subscription results (abbreviated)
{
  "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}]
      }
    ]
  }
}

Daily order payment-method JSON: POST /orders

These 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.

1. Wallet balance — request
POST /orders · balance request
{
  "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.

POST /orders · balance success (full response shape)
{
  "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."
    }
  }
}
2. Cash / pay on delivery — request

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.

POST /orders · COD request
{
  "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).

POST /orders · COD success (full response shape)
{
  "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."
    }
  }
}
3. Standard hosted payment gateway — request

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.

POST /orders · standard gateway request
{
  "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.

POST /orders · hosted gateway initiated (complete navigation shape)
{
  "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>"
  }
}
4. Paymennt hosted checkout link — request

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.

POST /orders · Paymennt request
{
  "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.

POST /orders · Paymennt checkout-link initiated
{
  "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):

POST /orders · Paymennt initialization failed
{
  "remark": "payment_initialization_failed",
  "status": "error",
  "message": {
    "error": ["Paymennt could not create a checkout link."]
  }
}
POST /orders · owned address not found (HTTP 422)
{
  "remark": "address_not_found",
  "status": "error",
  "message": {"error": ["Address not found"]}
}
POST /orders · invalid or expired coupon (HTTP 422)
{
  "remark": "invalid_coupon",
  "status": "error",
  "message": {"error": ["Invalid or expired coupon code"]}
}
POST /orders · payment method/amount rejected (HTTP 422)
{
  "remark": "invalid_payment_method",
  "status": "error",
  "message": {"error": ["Invalid payment method or amount"]}
}
POST /orders · insufficient balance (HTTP 422)
{
  "remark": "insufficient_balance",
  "status": "error",
  "message": {"error": ["Insufficient balance"]}
}
POST /orders · standard-delivery address missing (HTTP 422)
{
  "remark": "address_required",
  "status": "error",
  "message": {"error": ["Address is required for standard delivery"]}
}

Read a daily order: GET /orders/{orderId}/details

Use 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.

GET /orders/123/details · daily order response (abbreviated)
{
  "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"}]
    }
  }
}
GET /orders/{orderId}/details · owned order or delivery not found (HTTP 404)
{
  "remark": "order_not_found",
  "status": "error",
  "message": {"error": ["Order not found"]}
}
GET /orders/SUB-9999/details · subscription delivery not found (HTTP 404)
{
  "remark": "delivery_not_found",
  "status": "error",
  "message": {"error": ["Subscription delivery not found"]}
}

Cancel an order: POST /orders/{orderId}/cancel

Send the required request body shown above. A cancelled/delivered or otherwise ineligible order is rejected; invalid or missing reason fails validation.

POST /orders/{orderId}/cancel · order already in a non-cancellable state (HTTP 422)
{
  "remark": "order_not_cancellable",
  "status": "error",
  "message": {"error": ["This order cannot be cancelled"]}
}
POST /orders/{orderId}/cancel · missing or foreign order (HTTP 404)
{
  "remark": "order_not_found",
  "status": "error",
  "message": {"error": ["Order not found"]}
}
POST /orders/{orderId}/cancel · missing reason (HTTP 422)
{
  "remark": "validation_error",
  "status": "error",
  "message": {"error": ["The reason field is required."]}
}

Rate an ordered item: POST /orders/{orderId}/rate

Send 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.

POST /orders/{orderId}/rate · success
{
  "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"}}
}
POST /orders/{orderId}/rate · order not delivered or dish not in order (HTTP 422)
{
  "remark": "rating_not_allowed",
  "status": "error",
  "message": {"error": ["You can rate only delivered items you ordered"]}
}
POST /orders/{orderId}/rate · missing or foreign order (HTTP 422)
{
  "remark": "rating_not_allowed",
  "status": "error",
  "message": {"error": ["You can rate only delivered items you ordered"]}
}

Report pickup arrival: POST /orders/{orderId}/arrived

Send 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.

POST /orders/{orderId}/arrived · delivery order or missing car details (HTTP 422)
{
  "remark": "arrival_not_allowed",
  "status": "error",
  "message": {"error": ["Arrival is available only for branch pickup orders with car details"]}
}
POST /orders/{orderId}/arrived · order not found or not owned (HTTP 404)
{
  "remark": "order_not_found",
  "status": "error",
  "message": {"error": ["Order not found"]}
}
POST /orders/{orderId}/arrived · pickup status not ready (HTTP 422)
{
  "remark": "arrival_not_allowed",
  "status": "error",
  "message": {"error": ["This order is not ready for branch pickup arrival"]}
}

Read an invoice: GET /orders/{orderId}/invoice

This 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.

GET /orders/123/invoice · invoice response (abbreviated)
{
  "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": []}]
    }
  }
}
GET /orders/{orderId}/invoice · order not found or not owned (HTTP 404)
{
  "remark": "order_not_found",
  "status": "error",
  "message": {"error": ["Order not found"]}
}

Retry Foodics synchronization: POST /orders/{orderId}/foodics-sync

Send 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.

POST /orders/{orderId}/foodics-sync · already synced
{
  "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}
  }
}
POST /orders/{orderId}/foodics-sync · validation failure in enabled integration (HTTP 422)
{
  "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."}
  }
}

Reschedule a subscription delivery: POST /subscription-deliveries/{mealId}/reschedule

Send 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.

POST /subscription-deliveries/{mealId}/reschedule · delivery is not pending (HTTP 422)
{
  "remark": "delivery_not_reschedulable",
  "status": "error",
  "message": {"error": ["Only pending subscription deliveries can be rescheduled"]}
}
POST /subscription-deliveries/{mealId}/reschedule · invalid or past time (HTTP 422)
{
  "remark": "validation_error",
  "status": "error",
  "message": {"error": ["The scheduled at field must be a date after now."]}
}
POST /subscription-deliveries/{mealId}/reschedule · missing or foreign delivery (HTTP 404)
{
  "remark": "delivery_not_found",
  "status": "error",
  "message": {"error": ["Subscription delivery not found"]}
}

Read available subscription add-ons: GET /subscription-deliveries/{mealId}/addons

Send 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.

GET /subscription-deliveries/501/addons · empty choices and requests
{
  "remark": "subscription_addons",
  "status": "success",
  "message": {"success": ["Subscription add-ons"]},
  "data": {"available_addons": [], "requests": []}
}
GET /subscription-deliveries/{mealId}/addons · missing or foreign delivery (HTTP 404)
{
  "remark": "delivery_not_found",
  "status": "error",
  "message": {"error": ["Subscription delivery not found"]}
}

Request subscription add-ons: POST /subscription-deliveries/{mealId}/addons

Send 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.

POST /subscription-deliveries/501/addons · created request
{
  "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"}
      }
    ]
  }
}
POST /subscription-deliveries/{mealId}/addons · one or more add-ons inactive (HTTP 422)
{
  "remark": "invalid_addon",
  "status": "error",
  "message": {"error": ["One or more add-ons are unavailable"]}
}
POST /subscription-deliveries/{mealId}/addons · delivery is not pending (HTTP 422)
{
  "remark": "addons_not_allowed",
  "status": "error",
  "message": {"error": ["Add-ons can only be requested for pending subscription meals"]}
}
POST /subscription-deliveries/{mealId}/addons · missing or foreign delivery (HTTP 404)
{
  "remark": "delivery_not_found",
  "status": "error",
  "message": {"error": ["Subscription delivery not found"]}
}
POST /subscription-deliveries/{mealId}/addons · missing add-ons array (HTTP 422)
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "The addons field is required."
    ]
  }
}

10 · Payments and payment status

List configured payment gateways: GET /payment-methods

This 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 /payment-methods · request
GET /api/payment-methods
Authorization: ******;ACCESS_TOKEN>
Accept: application/json
GET /payment-methods · configured gateways (illustrative)
{
  "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
        }
      }
    ]
  }
}
GET /payment-methods · no enabled gateways (HTTP 200)
{
  "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.

Create or inspect payment

Method & pathRequestResult & conditions
GET/payments/{depositId}/statusSanctum; 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}/statusSanctum; path deposit ID.Alias to the payment status handler.
GET/payment/{depositId}/quick-statusSanctum; path deposit ID.Currently routes to the same status handler, not a separately minimal quick-status implementation.
POST/payment/statusSanctum; 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-statusSanctum; same lookup fields as query parameters.Legacy alias to status-by-session lookup.
GET/orders/{orderId}/statusSanctum; path order ID.Returns order/payment status; missing/foreign: 404. Rejected payment may move order to cancelled.
POST/deposit/insertSanctum; 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.
Unresolved deposit routes 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.

Hosted/mobile payment navigation

Method & pathAuthResult
GET/payment/confirm/{encryptedDepositId}SanctumDecrypts 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/callbackSanctumAccepts 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}/completedSanctumReturns payment completion check and, when paid, order/subscription details. Caller ownership required.
GET/payment/{depositId}/historySanctumReturns status/history information for caller-owned payment.
POST/payment/webhookPublic; extra throttle 60/minRoute points to PaymentController::paymentWebhook, but that method could not be found in the API payment controller. Verify/fix before relying on this route.

Stripe vs Paymennt

  • Select a configured method using the method_code and currency from GET /payment-methods; the server validates enabled gateway and amount bounds.
  • Stripe uses the configured gateway checkout handoff; 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.
  • Paymennt API subscription purchases start the native mobile checkout and return provider: "paymennt", integration: "paymennt_mobile_sdk", checkout_id, checkout_key, and environment; the response sets redirect_url to null for this flow.
  • Poll the authenticated status URL from the purchase response. Paymennt refresh verifies returned amount/currency/order reference and captures authorized mobile checkout before marking paid.
  • Gateway charge/payable are separate from the server-calculated subscription pricing quote. The API calculates final prices; clients must not submit trusted totals.

Payment status values

  • initiated payment started, final result not yet recorded.
  • pending waiting for provider confirmation.
  • paid confirmed successfully.
  • failed rejected/failed.

Always use the authenticated server status endpoint to decide final UI outcome.

Check payment status

HTTP
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:

HTTP
POST /api/payment/status
Authorization: Bearer <ACCESS_TOKEN>
Accept: application/json
Content-Type: application/json
JSON
{
  "deposit_id": 789
}

deposit_id is the preferred lookup key. The endpoint also accepts subscription_id or session_id.

Validation and payment errors

JSON
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": ["Select an available delivery time for the selected address."]
  }
}
HTTPremarkCause
422validation_errorMissing/invalid program, plan, start date, payment method, currency, terms, or other fields.
422validation_errorDelivery address missing/invalid, requested slot inactive, or weekday selection invalid. For a stale slot, data.delivery_time_preference contains currently active slots when available.
422validation_errorPickup branch missing/inactive, or delivery-only cool bag selected for pickup.
422validation_errorMethod code/currency do not identify an enabled payment method, or the amount is outside that method's limits.
409subscription_already_existsThe user already has an active or pending subscription.
422subscription_payment_method_not_supportedThe chosen method is Pay on Delivery.
502payment_initialization_failedPaymennt native checkout could not be initialized.

Endpoint response examples

GET /payments/{depositId}/status

Example 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.

GET /payments/{depositId}/status · pending response
{
  "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/status

When no caller-owned payment matches the supplied lookup key, the endpoint returns a not-found error rather than a successful empty result.

POST /payment/status · payment not found
{
  "remark": "payment_not_found",
  "status": "error",
  "message": {
    "error": ["Payment not found for the provided reference."]
  }
}

Detailed endpoint guide

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.

Create a deposit: POST /deposit/insert

Requires 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.

POST /deposit/insert · request
{
  "amount": 100,
  "method_code": 123,
  "currency": "AED"
}
POST /deposit/insert · success (URLs abbreviated)
{
  "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>"
  }
}

Read payment status: GET /payments/{depositId}/status and aliases

The 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:

GET /payments/{depositId}/status · paid response (abbreviated)
{
  "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:

GET /payments/{depositId}/status · not found
{
  "remark": "payment_not_found",
  "status": "error",
  "message": {"error": ["Payment not found"]}
}

Lookup status by reference: POST /payment/status or GET /payments/check-status

Supply 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.

POST /payment/status · request
{
  "deposit_id": 789
}
POST /payment/status · invalid lookup
{
  "remark": "validation_error",
  "status": "error",
  "message": {"error": ["The deposit id must be an integer."]}
}

Check completed state: GET /payment/{depositId}/completed

Use 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.

GET /payment/{depositId}/completed · pending state
{
  "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>"
  }
}

Payment handoff: 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.

GET /payment/confirm/{encryptedDepositId} · response shape
{
  "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
  }
}

Callback and final verification: GET /payment/callback, GET /payment/{depositId}/completed

The 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.

GET /payment/callback · response shape
{
  "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}
  }
}
GET /payment/callback · missing deposit_id
{
  "remark": "invalid_callback",
  "status": "error",
  "message": {"error": ["Invalid callback parameters"]}
}

Payment history: GET /payment/{depositId}/history

Returns 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.

GET /payment/{depositId}/history · response shape
{
  "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
  }
}

Order status: GET /orders/{orderId}/status and GET /order/{orderId}/status

Both 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.

GET /orders/{orderId}/status · response shape
{
  "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:

GET /orders/{orderId}/status · order not found or not owned (HTTP 404)
{
  "remark": "order_not_found",
  "status": "error",
  "message": {
    "error": ["Order not found"]
  }
}

Unimplemented payment endpoints

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.

11 · Foodics integrations

Webhook

POST /foodics/webhook is public and additionally throttled to 60 requests/minute. The API middleware throttle also applies.

  • If a webhook secret is configured, send it in X-Foodics-Webhook-Secret; a mismatch returns 401.
  • The controller has no general required JSON schema validation. It checks configured webhook enablement, Be Healthy brand/branch filtering, and duplicate payloads.
  • Disabled webhook or irrelevant/non-Be-Healthy order: 202 accepted/ignored response.
  • Duplicate event: { "status": "ok", "duplicate": true }.
  • Accepted event is persisted/dispatched and returns 202 with webhook ID.
  • Subscription meal usage is deducted/reversed for configured order statuses; defaults in code are deduction status 4 and reversal statuses 3, 5, 7. Processing requires an active linked application subscription.

Authenticated Foodics subscription operations

Method & pathRequestResult & conditions
POST/foodics/subscriptions/linkapplication_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/pickupRequired 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.

Authenticated Foodics diagnostics

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 & pathResult
GET/foodics/testwhoami and Foodics settings/connection information.
GET/foodics/test/branchesFoodics branches.
GET/foodics/test/customersFoodics customers.
GET/foodics/test/productsFoodics products.
GET/foodics/test/ordersFoodics orders.

The test endpoints do not define additional query/body validation and mostly return proxied Foodics client responses.

Endpoint response examples

POST /foodics/pickup

The 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.

POST /foodics/pickup · successful response (HTTP 201)
{
  "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/webhook

A configured webhook-secret mismatch is rejected. Accepted, duplicate, or ignored webhook responses are described above; processing is asynchronous.

POST /foodics/webhook · unauthorized error
{
  "message": "Unauthorized"
}

12 · Endpoint-by-endpoint request, validation, and response contracts

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.

Response status and schema caveat Validation through Laravel's automatic validator normally responds with HTTP 422 and an 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.

Read-only and lookup endpoints: individual response contracts

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.

OperationInputs and validationSuccessful response fieldsExpected errors / notes
GET /general-settingNo body/query.data.general_setting.site_name.Database/configuration errors use framework response.
GET /onboardingNo 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 /faqsNo 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/queryOptional 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/helpNo body/query.data.support_methods[] (id/name/description/icon/color).Static support choices.
GET /contactNo body/query.data contact options returned by contact controller.Only active configured contact options.
GET /get-countriesNo body/query.data.countries[] (country/dial_code/country_code).Reads bundled country resource.
GET /authorizationSanctum; 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-homePublic; 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 /categoriesPublic; no body/query.data.locale, data.categories[].Active Be Healthy categories only; add-on categories excluded.
GET /productsOptional 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}/reviewsSanctum; optional per_page clamped 1–50, page paginator query.data.product_id, summary (average/count/distribution), paginated reviews.404 product not found.
GET /cartSanctum; 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/addressesSanctum; 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-areasSanctum + 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-preferencesSanctum; 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 /branchesSanctum; route is allowlisted from verification/profile gates.data.total_branches, data.branches[], default marker and daily order slots.Active branches only.
GET /delivery-areasSanctum + 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-preferencesSanctum; 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-methodsSanctum; 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-methodsSanctum; 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/methodsSanctum + 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 /dashboardSanctum + 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-infoSanctum; route is allowlisted from verification/profile gates; bodyless.Standard envelope with data.user.401 without a valid token.
GET /profileSanctum; route is allowlisted from verification/profile gates; bodyless.Profile fields, verification flags and image URL.401 without a valid token.
GET /kyc-formSanctum + 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/historySanctum; 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 /transactionsSanctum; optional search, type, remark; pagination.Paginated transactions and available remark choices.Filters apply to caller's transactions.
GET /push-notification/devicesSanctum; no input.Current caller's registered device list.Empty list is valid.
GET /withdraw-methodSanctum + 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/historySanctum + 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-infoSanctum; 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}/detailsPublic; 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 /checkoutSanctum; 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 /couponsSanctum; route is allowlisted from verification/profile gates; no query/body.Currently available coupon choices.Expired/ineligible coupons excluded by availability query.
GET /subscription-dashboardSanctum; 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-subscriptionSanctum + verified + profile complete.data.subscription with plan, dates, delivery/pickup detail; null if no active record.Caller-scoped.
GET /subscription/{id}/statusSanctum + verified + profile complete; caller-owned ID.Subscription/payment states, deposit, pricing, amounts, plan/program and dates.404 missing/foreign subscription.
GET /ordersSanctum; 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}/detailsSanctum; 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}/addonsCaller-owned meal delivery ID; no body.Available add-ons and previous add-on requests.404 delivery not found.
GET /orders/{orderId}/invoiceCaller-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-statusSanctum; 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-statusSanctum; 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}/completedSanctum; 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}/historySanctum; 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}/statusSanctum; 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}/statusSanctum; 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/callbackSanctum; 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/testSanctum; 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/branchesSanctum; 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/customersSanctum; 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/productsSanctum; 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/ordersSanctum; 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.

Authentication and account creation

OperationRequest fields and validationSuccess response contractExpected errors / conditions
POST /auth/loginJSON: 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/registerJSON: 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/requestmobile_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/resendmobile_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/verifymobile_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-profileprofile_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/emailvalue 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-codeemail, six-character code.data.reset_token and expiry (600 seconds).422 invalid/expired code; 404 account missing; 429 throttle/attempt limit.
POST /auth/password/resetemail, 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-emailSanctum; 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-mobileSanctum; 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-g2faSanctum; 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 /logoutSanctum; no body.remark: logout, status: ok.401 unauthenticated. All current user's personal access tokens are revoked.

Example login response:

JSON
{
  "remark": "login",
  "status": "success",
  "data": {
    "user": { "id": 7, "email": "customer@example.com" },
    "access_token": "<ACCESS_TOKEN_FROM_RESPONSE>",
    "token_type": "Bearer"
  }
}

Catalog, wishlist, and cart mutations

OperationRequest fields and validationSuccess response contractExpected errors / conditions
POST /products/{id}/wishlist/toggleSanctum; 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/itemsproduct_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.

Addresses and account changes

OperationRequest fields and validationSuccess response contractExpected errors / conditions
POST /user/addressesRequired 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-defaultSanctum; 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-branchbranch_id required integer; selected branch must be active.Updated default branch summary.422 missing/inactive/nonexistent branch.
POST /user-data-submitRequires 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-settingRequires 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-passwordcurrent_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-submitMultipart/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-requestKYC 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/confirmKYC 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/registerdevice_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-tokenSanctum; 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/removeRequired 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/sendtitle 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-deletepassword 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/ticketfull_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.

Subscription lifecycle operations

OperationRequest fields and validationSuccess response contractExpected errors / conditions
POST /coupon/applycode 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/purchaseRequired 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-paymentmethod_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}/pauseNo 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}/resumeNo 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}/statusPath 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.

Daily orders and subscription-delivery actions

OperationRequest fields and validationSuccess response contractExpected errors / conditions
POST /ordersdelivery_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}/cancelreason 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}/ratedish_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}/arrivedNo 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-syncNo 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}/reschedulescheduled_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}/addonsaddons 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"}.

Payments and Foodics operations

OperationRequest fields and validationSuccess response contractExpected errors / conditions
POST /deposit/insertSanctum; 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/statusOptional 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 aliasesPath 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, /historyPath 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/linkapplication_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/pickupRequired 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/webhookPublic; 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.

Per-operation error envelope examples

Explicit application validation errors commonly have this shape; the status varies by endpoint:

422 example
{
  "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.

Copyable request body JSON

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.

OperationExample 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/webhookNot documented as a working request: the route declaration points to a controller method that is not implemented.

Success response JSON examples

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.

Standard success envelope
{
  "remark": "general_setting",
  "status": "success",
  "message": { "success": ["General setting data"] },
  "data": { "general_setting": { "site_name": "Be Healthy" } }
}
Login response shape
{
  "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"
  }
}
Cart response shape
{
  "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
  }
}
Payment status response shape
{
  "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"
  }
}
FCM token update response
{
  "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 JSON examples

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.

Laravel validation response (HTTP 422)
{
  "message": "The given data was invalid.",
  "errors": {
    "email": ["The email field is required."],
    "password": ["The password confirmation does not match."]
  }
}
Application validation envelope
{
  "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" }
    ]
  }
}
Field validation errors (422)
{
  "remark": "validation_error",
  "status": "error",
  "message": {
    "error": [
      "The quantity must be at least 1.",
      "The selected product is unavailable."
    ]
  }
}

13 · Endpoints that need implementation/verification

The route declarations and controller implementation are not fully aligned in these places:

  1. GET /deposit/confirm, GET /deposit/manual, and POST /deposit/manual reference API payment methods not found on the API PaymentController.
  2. POST /payment/webhook references paymentWebhook, which was not found on the API PaymentController.
  3. GET /payment/{depositId}/quick-status currently invokes the standard status action rather than a separate lightweight implementation.
  4. 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.
  5. Some older auth/account/business-error branches return HTTP 200 with "status": "error"; clients should inspect the response body and this reference should be revised when those handlers are normalized.
Documentation status These are documented as currently implemented rather than assumed to work as intended. Verify against the running application before relying on them in production.