Skip to main content

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

ComponentFileRole
MenzzoApisrc/CoreBundle/Api/MenzzoApi.phpMagento API client (v1)
MenzzoApiV2src/CoreBundle/Api/MenzzoApiV2.phpMagento API client (v2)
SaleServicesrc/CoreBundle/Services/SaleService.phpOrder processing logic
Configurationapp/config/parameters.ymlAPI 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

CommandScheduleDescription
menzzo:v2:salesEvery 10 minImport new orders from Magento
menzzo:v2:sales:updateEvery 30 minSynchronize order statuses
menzzo:v2:sales:paymentScheduledProcess payment information
menzzo:v2:productsScheduledSynchronize 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

ScenarioBehavior
API timeoutRetry on next scheduled run
Duplicate order IDSkipped during import
Invalid product dataLogged and skipped
Authentication failureAlert raised; check credentials in parameters.yml