Emag
Description
eMag integrates Enso catalog, offer, order, pricing, and fulfilment flows with the eMag marketplace.
The package stores integration settings and courier-account configuration, synchronizes remote categories and commissions, publishes or matches local products as eMag offers, reacts to order callbacks, creates and updates local eMag order records, and supports invoice upload plus AWB generation.
It is a private marketplace integration package intended for Enso deployments that operate on eMag.
Installation
This is a proprietary package distributed through the private Enso registry.
Run the package migrations:
php artisan migrate
The package also publishes backend client assets into the host application:
php artisan vendor:publish --tag=emag-assets
In production, when the integration is enabled, the package schedules:
enso:emag:generate-awbsdaily at07:00when AWB scheduling is enabled in commercial settingsenso:emag:order-fallbackevery 15 minutes
Features
- Encrypted settings for API credentials, company, sale channel, and warehouse/contact metadata.
- Offer actions for activate, deactivate, upload, download, manual/automatic pricing, picture download, match publishing, and new-product publishing.
- Order processing with acknowledgement, synchronization, invoice upload, AWB generation, quarantined order flows, and signed invoice serving.
- Callback endpoints for AWBs, orders, returns, cancellations, and newly available products.
- Commands for enabling/disabling the API and syncing categories, commissions, courier accounts, and AWBs.
Usage
The package centers on two core models:
LaravelEnso\\Emag\\Models\\OfferLaravelEnso\\Emag\\Models\\Order
Useful offer actions:
activate()deactivate()upload()download()downloadPictures()updateMeasurements()syncCommission()publishMatch(Product $product, $pnk)publishNew(Product $product)
Useful order actions:
acknowledge()sync()generateAWB()uploadInvoice()process(int $id)
Operational commands:
php artisan enso:emag:api-up
php artisan enso:emag:api-down
php artisan enso:emag:sync-categories
php artisan enso:emag:sync-commissions --only-missing
php artisan enso:emag:sync-courier-accounts
php artisan enso:emag:generate-awbs
php artisan enso:emag:order-fallback
php artisan enso:emag:quarantined-orders
API
HTTP routes
Settings:
GET api/integrations/emag/settings/indexPATCH api/integrations/emag/settings/{settings}
Courier accounts:
GET api/integrations/emag/courierAccounts/options
Offers:
PATCH api/integrations/emag/offers/{offer}/activatePATCH api/integrations/emag/offers/{offer}/deactivatePATCH api/integrations/emag/offers/{offer}/uploadPATCH api/integrations/emag/offers/{offer}/downloadPATCH api/integrations/emag/offers/{offer}/manualPATCH api/integrations/emag/offers/{offer}/automaticPOST api/integrations/emag/offers/{offer}/downloadPicturesPOST api/integrations/emag/offers/{offer}/updateMeasurementsPOST api/integrations/emag/offers/{product}/publishMatchPOST api/integrations/emag/offers/{product}/publishNewPOST api/integrations/emag/offers/{product}/match
Orders:
GET api/integrations/emag/orders/{order}/showGET api/integrations/emag/orders/{order}/urlPOST api/integrations/emag/orders/{order}/invoicePOST api/integrations/emag/orders/{order}/awbGET api/integrations/emag/orders/{order}/awbsGET api/integrations/emag/orders/quarantinedPATCH api/integrations/emag/orders/quarantined/{order}
Callbacks:
GET api/emag/callbacks/awb/{awb}GET api/emag/callbacks/order/{order}GET api/emag/callbacks/return/{order}GET api/emag/callbacks/cancel/{order}GET api/emag/callbacks/product/{product}
Web:
GET integrations/emag/orders/{order}/invoice
Depends On
Required Enso packages:
laravel-enso/api↗laravel-enso/commercial↗laravel-enso/core↗laravel-enso/discounts↗laravel-enso/dynamic-methods↗laravel-enso/enums↗laravel-enso/helpers↗laravel-enso/migrator↗laravel-enso/products↗laravel-enso/sale-channels↗laravel-enso/services↗laravel-enso/unit-conversion↗
Companion frontend package: