Appearance
Duplicates, aliases and quirks
23.1 Handlers mounted at more than one path
Grouped on the endpoint pages under a single entry. One handler, several paths — the difference is guest vs. authenticated (the authenticated mount adds isCustomer, so req.meta.userId is available and the response is personalised).
| Handler | Paths | § |
|---|---|---|
verifyProductAndUpdateView | /brand/mobile/verify/product/:authCode, /user/mobile/verify/product/:authCode | 5.1 |
getUserPointLeaderboards | /mobile/user-point/leaderboard, /user/mobile/user-point/leaderboard | 3.15 |
deactivateUser | /mobile/user/deactivate (POST), /user/mobile/deregister/oauth (GET) | 3.13 |
deactivateUserConfirmation | /mobile/user/deactivate/confirm (POST), /user/mobile/deregister/apple-oauth/confirm (PUT) | 3.13 |
getTagCatalogue | /mobile/tags-catalog, /mobile/open/tags-catalog | 11.1 |
getRelatedCatalogue | /mobile/related-catalog, /mobile/open/related-catalog | 11.2 |
getApplicableDiscounts | /mobile/discount/applicable, /mobile/open/discount/applicable | 12.4 |
syncBagWithClient | /mobile/syncBag, /mobile/open/syncBag | 12.1 |
getLoyaltyBrand | /mobile/loyalty/brand, /mobile/loyalty | 6.5/6.6 |
createEventLead | /mobile/event/lead/:event_id, /user/mobile/event/lead/:event_id | 16.7 |
getAllEvents | /mobile/events, /user/mobile/events | 16.5 |
createFormResponse | /brand/mobile/form/response, /brand/mobile/public/form/response | 16.8 |
addUserDeviceToken | /user/mobile/user-device-token, /mobile/user-device-token | 19.1 |
get_collectibles_leaderboards | /mobile/user/collectibles/leaderboards, /user/mobile/user/collectibles/leaderboards | 8.7 |
getCampaignsForCollectibleSecondLastStep | .../pre_campaign_progress, .../campaign_progress | 7.9 |
addToCloudinary | POST and PUT /user/mobile/uploadImage | 20.1 |
23.2 True duplicate declaration
GET /api/v1/brand/mobile/user/loyalty/campaigns/:id → getLoyaltyCampaignByIdForUser is declared twice in routes/v1/loyalty_campaign_route.ts. Express keeps the first; the second is dead weight and should be deleted.
23.3 Route-ordering hazards
In routes/v1/loyalty_campaign_route.ts, campaigns/tag, campaigns/group and campaigns/category/:categoryName are declared before campaigns/:id, which is what makes them reachable. Adding a new literal segment under campaigns/ after the :id route would shadow it.
23.4 Behaviours worth knowing before you integrate
- HTTP 200 on failure. Branch on
success, never on the status code (except 401 from auth middleware and 404 fromGET /api/v2/brand/mobile/cms). - The points ledger and mini-game routes have no envelope — they pass the ledger service body straight back, so
success/resultis absent and a failure is not flattened to a 200. /uploadImagereturnsstatus, notsuccess.- Strict Joi — unexpected keys are rejected, so don't echo a GET response straight back into a PUT.
phone_prefixis conditionally required whereverphoneNumber/phone_numberappears.- Emails with
+are rejected on every customer-identity endpoint. isPrimarydefaults totruewhen adding an address (§4.1) — a second address silently demotes the first unless you passfalse.- Paired params:
limit+offseton §3.14 and §9.2,lat+lngon §16.10,sortItem+sortTypeeverywhere — supplying only one half means the pair is ignored (or, forlat/lng, rejected). cityis accepted but not applied in §16.10 — it triggers the group filter without being included in it (listedHub_controller.js).GETendpoints that mutate: §12.5 (discount/reward/:discountId) creates a promotion. Don't retry it blindly.- Bodies that skip the
payloadwrapper: §6.10 (collectibles), §7.6 (event_item), §19.4 (bare array). Everything under/api/v2/wraps normally. hubId/roomIdcome from thex-auth-tokenJWT; the query-param overrides listed on the endpoint pages only apply when the token doesn't carry them.