Skip to 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 ​

View diagram source
sequenceDiagram
    participant MAG as Magento 2
    participant API as mz.sale.api
    participant CMD as menzzo:v2:sales
    participant SVC as SaleService
    participant DB as Database

    CMD->>CMD: Read last imported Magento ID
    CMD->>API: GET orders (entity_id > last_id)
    API->>MAG: API request
    MAG-->>API: JSON payload
    API-->>CMD: Order list
    CMD->>SVC: addOrder(payload, isV2Data=true)
    SVC->>DB: Persist Sale + SaleProducts

Diagram

Inbound: Status Updates ​

View diagram source
sequenceDiagram
    participant CMD as menzzo:v2:sales:update
    participant API as mz.sale.api
    participant MAG as Magento 2

    CMD->>CMD: Load local sales
    CMD->>API: GET orders by IDs
    API->>MAG: API request
    MAG-->>API: Updated statuses
    API-->>CMD: Compare statuses
    CMD->>CMD: Update if changed

Diagram

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.

yaml
magento:
  api_url: "https://..."
  api_user: "..."
  api_key: "..."

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

Internal developer documentation for Menzzo systems.