Acumatica + eMAG integration: how it works end to end
This is the integration MEGZO runs in production for an anonymous Romanian eMAG seller on Acumatica. The shape is deliberate: Acumatica stays the source of truth for products, prices, stock, and fiscal documents; eMAG is a sales channel that MEGZO keeps in sync. Nothing important lives inside MEGZO. It is a config-driven sync layer between your ERP and the marketplace, not a second system of record. That distinction matters if you have ever watched a hub-centric tool quietly become the place your data actually lives.
The engine runs on two clocks: a 5-minute pull heartbeat, plus webhook wake-ups where eMAG supports them. Most of the time the heartbeat is enough; the wake-ups just cut the lag on new orders.
Publishing catalog, price, and stock to eMAG
Offers originate in Acumatica. MEGZO reads the catalog, maps each item to its eMAG offer, and publishes price and stock. Two eMAG-specific rules are enforced at the boundary, not as an afterthought:
- Price is ex-VAT. eMAG's sale_price is the price without VAT. MEGZO sends the ex-VAT figure and lets the Acumatica tax zone produce VAT totals that line up with the fiscal invoice, so you don't get penny mismatches on the order.
- min and max are required. eMAG rejects an offer publish that lacks min_sale_price and max_sale_price. MEGZO refuses to publish without them rather than letting eMAG bounce the call. These bounds are also your guardrail against a bad multiplier shipping a wrong price.
Stock publishes with oversell protection built in. The channel quantity is max(0, available − buffer), where the buffer is configurable per offer; the production reference uses a buffer of 2. So if Acumatica shows 5 on hand, eMAG sees 3. The point is to absorb the gap between a sale on eMAG and the moment your ERP catches up, so you don't sell the last unit twice. A reconciliation pass continuously checks channel stock against the ERP and corrects drift instead of trusting that every push landed.
Ingesting an eMAG order as one Acumatica Sales Order
When an order lands on eMAG, MEGZO reads it and creates exactly one Acumatica Sales Order. "Exactly one" is the whole game here. Idempotency is enforced three ways: a unique order_link per channel order, a per-order lock so two workers can't race the same order, and a dup pre-check against the ERP before the SO is created. Retries — and there are always retries in a distributed system — never produce a second Sales Order. After ingestion MEGZO acknowledges the order on eMAG, which moves it from new to in-progress and locks edits on the eMAG side.
Attaching the invoice PDF — and the boundary that matters
Read this part carefully, because it is the line we do not cross. MEGZO never generates a fiscal or legal invoice, and never creates or submits anything to e-Factura / ANAF. Your ERP and ANAF own fiscal invoicing, full stop.
What MEGZO does is narrow: it fetches an already-produced invoice PDF — by default an Acumatica file attachment on the order — and attaches that existing PDF to the eMAG order. Fetch and attach. No generation, no submission, no fiscal logic. If the PDF doesn't exist in the ERP yet, there is nothing to attach, and MEGZO does not invent one. Any tool that offers to "generate your invoice" is doing something MEGZO deliberately refuses to do.
Minting the AWB
For shipping, MEGZO calls eMAG's awb/save, which mints the AWB and auto-finalises the order on eMAG in the same step. One detail to plan around: eMAG allows status reversals (finalised back to returned or canceled) only within a 48-hour window after finalisation, so the timing of the AWB call has real consequences. MEGZO treats that window as a hard rule rather than assuming transitions are free.
What this gives you
End to end: offers and prices flow out, stock flows out with a safety buffer, orders flow in as clean single Sales Orders, the real invoice gets attached, and the AWB closes the loop. Your ERP stays the single source of truth; MEGZO is the managed, per-tenant layer that keeps eMAG honest about it.
The same engine runs other connectors — WooCommerce and Shopify are live, Trendyol is on the roadmap — without changing how your ERP stays in charge. See the other guides, or get started.