# api_new.rebates.com — repo context

> Curated overview for code_search. Source: `bitbucket_server:AD/api_new.rebates.com` (Bitbucket, project AD). CodeIgniter 4 REST API / PHP. Default branch `master`.

## Purpose
The **Rebates.com backend REST API** (the "new" API) — the server behind the `rebates-ui.com` web front end and the browser extension. CodeIgniter 4 JSON API with JWT auth (the `auth` route filter). Owns the cashback/rebates domain data in MySQL: users, stores/merchants, deals, cashback, coins/perks, claims, referrals, subscriptions, banners, gadget insurance.

## Structure
- `html/` — CI4 app (web root `html/public/`). `app/Controllers/` = the API surface (map below), `app/Config/Routes.php` = routes (auto-route on + explicit groups), `app/Models/` = data models.
- **Ignore** `html/system/` (framework) and `html/vendor/` (Composer deps) — vendored, not app code.

## API surface (controller → area)
- **Auth** — `AuthController`: signin, signup, social-signin, forgot/change-password, `auth/me`.
- **User / account** — `UserController` (dashboard, profile, billing, invoice, claims, credit-card, coins, perks, newsletter, contact-us), `DashboardController` (purchases, withdrawals, coins history, billing).
- **Stores / merchants** — `StoreController`: home, popular / affiliate / trending stores, categories, search, hot / holiday / travel deals, cashback stores, merchant + daily-offers pages, IP check.
- **Deals / alerts** — `DealController` (deal details, deal-alerts CRUD, save posted deal).
- **Cashback / withdrawals** — `CashBackController` (balance, withdraw money, PayPal withdrawal).
- **Shopping** — `ShopController` / `ShopControllerCommon` (home, product search/detail, Amazon coupons, shopping guide, lander/redirect).
- **Subscription** — `SubscriptionController` (landing, create, mobile OTP, cancel + feedback).
- **Referrals / banners / insurance** — `ReferralsController`, `BannerController`, `GadgetInsuranceController`.
- **Content / SEO** — `BlogsController` (articles), `SeoController` (sitemaps).
- **Browser extension** — `/extension/*` (`StoreController`): all merchants, merchant offers, BTB configs, popular/cashback stores, best offers.

## Models (MySQL, owned here)
`AuthModel`, `UserModel`, `CashbackModel`, `PaymentModel`, `DealAlertModel`, `ClaimsModel`, `ReferralsModel`, `SubscriptionModel`, `ShopModel`, `PerksModel`, `BannerModel`, `GadgetInsuranceModel`, `CampaignModel`, `DashboardModel`, `CommonModel`.

## Search notes
- This is the **backend/API**; the matching UI is `rebates-ui.com`. Endpoint logic is in `html/app/Controllers/*`; data models in `html/app/Models/*`. The JWT `auth` filter guards user / account / cashback routes.
- Ignore `html/system/` and `html/vendor/`.

## Tech
CodeIgniter 4 · PHP · MySQL · JWT auth. Serves `rebates-ui.com` + the Rebates browser extension.
