Skip to content

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

HandlerPaths§
verifyProductAndUpdateView/brand/mobile/verify/product/:authCode, /user/mobile/verify/product/:authCode5.1
getUserPointLeaderboards/mobile/user-point/leaderboard, /user/mobile/user-point/leaderboard3.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-catalog11.1
getRelatedCatalogue/mobile/related-catalog, /mobile/open/related-catalog11.2
getApplicableDiscounts/mobile/discount/applicable, /mobile/open/discount/applicable12.4
syncBagWithClient/mobile/syncBag, /mobile/open/syncBag12.1
getLoyaltyBrand/mobile/loyalty/brand, /mobile/loyalty6.5/6.6
createEventLead/mobile/event/lead/:event_id, /user/mobile/event/lead/:event_id16.7
getAllEvents/mobile/events, /user/mobile/events16.5
createFormResponse/brand/mobile/form/response, /brand/mobile/public/form/response16.8
addUserDeviceToken/user/mobile/user-device-token, /mobile/user-device-token19.1
get_collectibles_leaderboards/mobile/user/collectibles/leaderboards, /user/mobile/user/collectibles/leaderboards8.7
getCampaignsForCollectibleSecondLastStep.../pre_campaign_progress, .../campaign_progress7.9
addToCloudinaryPOST and PUT /user/mobile/uploadImage20.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 ​

  1. HTTP 200 on failure. Branch on success, never on the status code (except 401 from auth middleware and 404 from GET /api/v2/brand/mobile/cms).
  2. The points ledger and mini-game routes have no envelope — they pass the ledger service body straight back, so success/result is absent and a failure is not flattened to a 200.
  3. /uploadImage returns status, not success.
  4. Strict Joi — unexpected keys are rejected, so don't echo a GET response straight back into a PUT.
  5. phone_prefix is conditionally required wherever phoneNumber/phone_number appears.
  6. Emails with + are rejected on every customer-identity endpoint.
  7. isPrimary defaults to true when adding an address (§4.1) — a second address silently demotes the first unless you pass false.
  8. Paired params: limit+offset on §3.14 and §9.2, lat+lng on §16.10, sortItem+sortType everywhere — supplying only one half means the pair is ignored (or, for lat/lng, rejected).
  9. city is accepted but not applied in §16.10 — it triggers the group filter without being included in it (listedHub_controller.js).
  10. GET endpoints that mutate: §12.5 (discount/reward/:discountId) creates a promotion. Don't retry it blindly.
  11. Bodies that skip the payload wrapper: §6.10 (collectibles), §7.6 (event_item), §19.4 (bare array). Everything under /api/v2/ wraps normally.
  12. hubId/roomId come from the x-auth-token JWT; the query-param overrides listed on the endpoint pages only apply when the token doesn't carry them.

Batch platform, Shopify app and API documentation