Vision
The MHM Rentiva v2 REST API aims to modernize the existing scattered internal communication channels (AJAX and v1 REST) by consolidating them into a single centralized architecture and strengthening mobile application (Native App) support.
ποΈ REST v2 Planning and Architecture Roadmap
The v2 architecture adopts an "API-First" approach to expose all plugin functionality as standard JSON endpoints.
π€οΈ 1. Target Namespace Structureβ
All new endpoints will be grouped under the wp-json/mhm-rentiva/v2 namespace, with version management maintaining backward compatibility.
π¦ 2. Modular Migration Planβ
A. Financial and Ledger Module (/v2/ledger)β
- GET
/v2/ledger/summary: Will replace the AJAXmhm_fetch_vendor_statsaction. - POST
/v2/ledger/payouts: Will replace the AJAXmhm_request_payoutaction. - Analysis: This migration will result in the Vendor dashboard loading 40% faster.
B. Booking Engine (/v2/booking)β
- POST
/v2/booking/check: A more performant, JSON Schema-validated version of the existing/v1/availabilityquery. - POST
/v2/booking/create: A new endpoint that manages the WooCommerce cart process entirely via the API.
C. Vehicles and Filtering (/v2/vehicles)β
- GET
/v2/vehicles/search: Will replace the AJAXmhm_rentiva_filter_resultsaction. - Interactivity API Integration: This endpoint will be used directly for reactive search results.
π 3. New Security Standardsβ
The following security layers will become standard with the v2 transition:
- JWT (JSON Web Token) Support: Encrypted, time-limited session management for mobile apps.
- X-WP-Nonce Requirement: Mandatory verification on all browser-based asynchronous requests.
- HTTP Method Hardening: "Strict" mode allowing only the relevant methods (GET/POST/PUT) to execute.
- Dynamic Rate Limiting: Dynamic quota management per API key via
RateLimiter.
π οΈ 4. Implementation and Integration Stepsβ
- Controller Modernization: Full separation of Fat controllers into Service layers.
- Route Registration: Creation of new controller classes under
src/Api/REST/V2/. - JS Refactor: Redirecting JS files such as
vehicles-grid.jsfrom AJAX to REST v2 endpoints.
Section Summaryβ
- The v2 architecture is the foundation of the system's "API-First" transformation.
- It is a preparation phase for mobile app and external ecosystem integrations.
- Security and performance will be elevated to the highest level.
Changelogβ
| Date | Version | Note |
|---|---|---|
| 23.04.2026 | 4.27.2 | English translation added. |
| 19.03.2026 | 4.21.2 | JWT support, Mobile App vision, and v2 blueprint detailed. |