Corporate Companies
Partner companies, their approved email domains and the coupons their employees may use. The website verifies a guest's work email, resolves the domain here and unlocks the mapped coupons.
📄️ List / search companies (paginated)
Most-recently-updated first. Optional `q` matches the company name or any of its domains (case-insensitive substring); optional `status` filters exactly (ACTIVE / INACTIVE). 1-based `page`; defaults to `page=1&size=20`.
📄️ Create or update a company
Creates when `id` is blank; otherwise overwrites the existing company. `domains` and `couponIds` are replaced wholesale — send the full set the drawer is showing, not a delta. Domains are lower-cased and de-duplicated; a domain already approved for another company is rejected.
📄️ Resolve a work-email domain to its company
Accepts a bare domain (`deloitte.com`), an `@domain`, or a whole address — all resolve the same way. A domain belongs to exactly one company.
📄️ Export all companies as CSV
Streams `corporate_companies.csv` in the upload format, one row per domain, so the file can be edited and uploaded back. A company with no domains, or no coupons, has no row — either would export as a blank cell that fails to re-upload.
📄️ Download a CSV template
Streams `corporate_companies_sample.csv`.
📄️ Get a company by id
Get a company by id
📄️ Delete a company
Removes the company along with its domains and coupon mappings. The coupons themselves are untouched.
📄️ Bulk create/update companies from a CSV upload
Multipart/form-data upload, field name `file`. One row per approved domain; rows sharing a company are folded together. Download `/sample` for a template. Coupons are named by code (`EBP10`), pipe-separated for more than one. Writes are additive — the file's domains and coupons are added to whatever the company already holds, never replacing them, so re-uploading the same file changes nothing. The whole file is validated before anything is saved and every fault is reported with its spreadsheet row number.
📄️ Replace the coupons mapped to a company
What the Map Coupon dialog submits. The given set replaces whatever was mapped before.