Magento 2 Integration
Magento 2 serves as the primary e-commerce front-office. It is the main source of customer orders, and Logidav synchronizes products, stock, and shipment tracking back to it via SOAP and REST API connections.
Role
- Order source: Logidav imports Magento orders via
mz.sale.api - Status synchronization: status changes in Magento are reflected in Logidav
- Product catalog: products are synchronized between Magento and Logidav
- Stock updates: Logidav pushes current inventory levels to Magento
- Shipment tracking: tracking numbers are sent back to Magento when shipments are created
Components
| Component | File | Role |
|---|---|---|
MenzzoApi | src/CoreBundle/Api/MenzzoApi.php | Magento API client (v1) |
MenzzoApiV2 | src/CoreBundle/Api/MenzzoApiV2.php | Magento API client (v2) |
SaleService | src/CoreBundle/Services/SaleService.php | Order processing logic |
| Configuration | app/config/parameters.yml | API URLs and credentials |
Data Flow
Inbound: Order Import
Inbound: Status Updates
Outbound: Stock and Tracking
Logidav pushes stock levels and shipment tracking numbers back to Magento through the same API clients. Stock updates run on a schedule; tracking numbers are pushed as soon as a carrier label is generated.
Key Commands
| Command | Schedule | Description |
|---|---|---|
menzzo:v2:sales | Every 10 min | Import new orders from Magento |
menzzo:v2:sales:update | Every 30 min | Synchronize order statuses |
menzzo:v2:sales:payment | Scheduled | Process payment information |
menzzo:v2:products | Scheduled | Synchronize product catalog |
Configuration
The Magento API is configured through the mz.sale.api service parameters. Check parameters.yml for the API URLs and credentials.
magento:
api_url: "https://..."
api_user: "..."
api_key: "..."
:::info SOAP vs REST
The v1 client (MenzzoApi) uses SOAP, while the v2 client (MenzzoApiV2) uses REST. New integrations should use the v2 client wherever possible.
:::
Error Handling
| Scenario | Behavior |
|---|---|
| API timeout | Retry on next scheduled run |
| Duplicate order ID | Skipped during import |
| Invalid product data | Logged and skipped |
| Authentication failure | Alert raised; check credentials in parameters.yml |