Professional Restful API Documentation Portal
| Method | Endpoint | Description | Security |
|---|---|---|---|
| POST | /api/warehouses/send-otp | Sends a 6-digit OTP verification code to the requested email. Valid for 15 minutes. | PUBLIC |
| POST | /api/warehouses/verify-otp | Validates the OTP code received by email. If correct, unlocks the email for registration. | PUBLIC |
| POST | /api/warehouses/register | Registers a new warehouse in the database (requires a previously verified email address). | OTP VERIFIED |
| GET | /api/warehouses/profile | Retrieves the profile information of the authenticated warehouse. | TOKEN REQ |
| PUT | /api/warehouses/profile | Updates the profile information of the authenticated warehouse. | TOKEN REQ |
| POST | /api/providers/setup | Configures the provider account (Step 2) with store details, specialty, and uploads required documents (RUT, ID, Chamber of Commerce, logo). | MULTIPART |
| POST | /api/auth/register | Registers login credentials for an existing warehouse (sets status to 'pending'). | PUBLIC |
| POST | /api/auth/login | Authenticates users (admin or approved warehouses) and returns a Bearer JWT token. | PUBLIC |
| POST | /api/auth/forgot-password | Requests a 6-digit password reset OTP code sent via email. | PUBLIC |
| POST | /api/auth/reset-password | Resets account password using the received 6-digit recovery OTP code. | PUBLIC |
| GET | /api/admin/warehouses | Lists all registered warehouses and their current approval status (administrator restricted). | ADMIN REQ |
| GET | /api/admin/pending | Lists all registered warehouses waiting for approval (administrator restricted). | ADMIN REQ |
| POST | /api/admin/warehouses/:warehouseId/status | Updates registration status of a warehouse (accepts 'Aprobado' or 'Negado') (administrator restricted). | ADMIN REQ |
| POST | /api/admin/warehouses/:warehouseId/user | Creates a warehouse login user account for a previously approved warehouse (administrator restricted). | ADMIN REQ |
| POST | /api/categories | Creates a new product category (administrator restricted). | ADMIN REQ |
| GET | /api/categories | Retrieves list of all product categories. | PUBLIC |
| POST | /api/lines | Creates a new product line under a category (administrator restricted). | ADMIN REQ |
| GET | /api/lines | Retrieves list of all product lines (optional categoryId filter). | PUBLIC |
| POST | /api/sublines | Creates a new product subline under a line (administrator restricted). | ADMIN REQ |
| GET | /api/sublines | Retrieves list of all product sublines (optional lineId filter). | PUBLIC |
| POST | /api/brands | Creates a new vehicle brand under a category (administrator restricted). | ADMIN REQ |
| GET | /api/brands | Retrieves list of all vehicle brands (optional categoryId filter). | PUBLIC |
| POST | /api/models | Creates a new vehicle model under a brand (administrator restricted). | ADMIN REQ |
| GET | /api/models | Retrieves list of all vehicle models (optional brandId filter). | PUBLIC |
| POST | /api/years | Creates a new year in the master list (administrator restricted). | ADMIN REQ |
| GET | /api/years | Retrieves list of all registered years. | PUBLIC |