Your Store Takes the Order. Who Handles Everything After?
Launching an online store on Salla, Zid or Shopify takes days. Once it reaches hundreds of orders a day, problems appear that the storefront cannot solve on its own. Who deducts stock? Who issues the ZATCA-compliant e-invoice? How do you match a payment gateway's lump-sum settlement, net of fees, against hundreds of orders? What happens when a customer returns half an order? And what does each item really earn after delivery and platform fees?
In many stores these questions are answered by hand: someone exports orders from the store dashboard, someone else keys them into accounting, and a third person updates stock in the store every evening. That works at twenty orders a day and collapses at two hundred. E-commerce ERP integration means data moves between the store and the system automatically, so every order becomes a complete transaction in inventory, accounting and VAT without re-entry.
This guide covers the core integration points, where errors usually creep in, the Saudi rules that affect your data, and how to phase the work.
What Goes Wrong Without Integration
- Overselling: stock in the store is updated manually, so it accepts orders for items already gone.
- Double entry: every order is typed twice, with room for errors in quantity, price or address.
- Late invoices: the invoice goes out days after shipping, or comes from the platform in a form that never reaches the ledger.
- Painful reconciliation: the gateway pays one amount covering dozens of orders after fees, and finance spends days working out what has been paid.
- Returns with no trail: the item comes back but stock does not change, or a refund goes out without a credit note.
- Unknown profit: revenue is visible in the dashboard; margin after delivery, fees and returns is not.
How the Data Should Flow
Most platforms offer APIs to read orders and update products and stock, plus webhooks that push an event to your system when an order is created or changes status. Good integration decides, for each type of data, which system is the master, which way it flows and how often.
| Data | Master | Direction | Timing |
|---|---|---|---|
| Item master and cost | ERP | ERP to store | On change |
| Descriptions and images | Usually the store | Stays in the store | No sync needed |
| Prices | ERP | ERP to store | On change |
| Available stock | ERP | ERP to store | Real time or every few minutes |
| Orders | Store | Store to ERP | On creation |
| Shipping status and tracking | ERP or carrier | To store and customer | On every change |
| Returns and refunds | Depends on workflow | Both ways | On approval |
The golden rule: one master per data type. If prices are edited both in the store and in the ERP, nobody will know which one is right.
The Core Integration Points
1. Inventory sync
Every sale in the store, a branch or a marketplace changes what is available. The ERP should publish available-to-sell stock, meaning on-hand minus quantities reserved for orders being picked, to every channel, and hold back a small buffer to cover count differences and simultaneous orders at peak times.
Hypothetical example: an item has 18 units on hand, four reserved for unshipped orders, so 14 are available. Sold on the website and one marketplace with a two-unit buffer, each channel shows 12, and both update the moment either sells.
2. Order to transaction
A new order becomes a sales order with items, quantities, prices, discounts and shipping charge, linked to a customer record (or creating one), with stock reserved in the right warehouse. Picking, packing, label, carrier hand-over, invoice and journal entry follow. It is the same order-to-cash process as any business, at e-commerce speed and volume.
3. E-invoicing
Consumer orders need a simplified tax invoice at 15% VAT with a QR code, reported to ZATCA within 24 hours under the integration phase. Business orders above SAR 1,000 need a standard invoice with the buyer's VAT number and address, cleared by ZATCA before it is shared. If you sell to both, the integration has to tell them apart from customer data. Our e-invoicing and ERP guide covers ZATCA integration in depth.
4. Payment gateway reconciliation
This is the point store owners underestimate most. Gateways do not pay order by order. They settle a batch for a period, net of their fees, sometimes also net of refunds on earlier orders.
Hypothetical example: in one week, 420 card orders totalled SAR 126,000 including VAT. The gateway paid SAR 121,470. The SAR 4,530 gap is processing fees plus refunds of SAR 1,380 on two returned orders. Without integration, someone opens the gateway report and matches every order by hand. With it, the settlement file is imported, each line matched to its order and invoice, fees posted as an expense, and any unpaid order shows up.
Buy-now-pay-later providers such as Tamara and Tabby work the same way, settling on their own terms net of commission. Cash on delivery is collected by the carrier and remitted later. Give each payment method its own clearing account in the ledger, cleared when the money arrives.
5. Carriers
Connecting carriers lets the system create the label from order data, receive the tracking number and send it to the customer, and update the order on delivery. Recording the actual delivery date matters legally, as we will see, and the actual shipping cost should be charged to each order so you can see its profitability. For delivery operations in more depth, see our article on last-mile delivery.
6. Returns and refunds
A return should trigger four linked steps: receive and inspect the item and restock it if resaleable; issue an electronic credit note referencing the original invoice; refund through the original payment method; and record the reason. The reason is what turns returns from a cost into information. If most returns of one item are for size, the problem is the size chart, not the product.
7. Marketplaces
Selling on Noon or Amazon adds commissions that vary by category and, sometimes, stock held in the platform's own warehouses. Treat those warehouses as stock locations in the ERP, record transfers to them as stock movements rather than sales, and post commissions and fees from the periodic settlement statements.
Three Ways to Connect
| Approach | When it fits | Watch out for |
|---|---|---|
| Ready-made connector | One store on a popular platform with standard processes | Does it cover returns and settlements, or only orders and stock? |
| Integration middleware | Several channels and systems needing mapping rules | Extra subscription and another point of failure to monitor |
| Custom API integration | Specific processes connectors do not handle | Who maintains it when the platform's API changes? |
Whichever you choose, insist on a clear log of every sync: what was sent, when, and whether it succeeded. Without it, tracing a missing order is guesswork.
The Saudi E-Commerce Law
The E-Commerce Law issued by Royal Decree M/126 in 1440H, in force since late 2019, imposes obligations that touch your system data directly:
- disclose the store's name, address, commercial registration number and contact details;
- show the total price clearly, including fees, taxes and delivery;
- give the consumer an itemised invoice;
- allow the consumer to cancel within seven days of receiving goods they have not used, with exceptions such as customised items;
- allow cancellation if delivery is more than 15 days late against the agreed date, force majeure aside.
Both windows run from the receipt date or the agreed delivery date. If your system does not record the actual delivery date of every order, you cannot apply your returns policy correctly or answer a complaint with evidence.
If the store collects customer data and sends marketing, the Personal Data Protection Law and its regulations require consent for marketing messages and an easy way for customers to opt out at any time.
Worked Example: True Order Profit
Hypothetical example: a SAR 300 order before VAT, three items with a combined cost of SAR 165, paid by card on the website and delivered within the city. Figures in brackets are deducted.
| Line | SAR |
|---|---|
| Revenue before VAT | 300 |
| Cost of goods | (165) |
| Gateway fee (estimate) | (7) |
| Delivery and packing | (24) |
| Expected share of return costs | (9) |
| Margin after order costs | 95 |
A standard sales report shows SAR 135 gross margin. What actually remains before marketing, salaries and rent is SAR 95. If the store offers free delivery on every order above SAR 150, a SAR 160 order with similar cost ratios may barely break even. These calculations need delivery cost and fees recorded at order level, which is exactly what integration provides.
Cash on Delivery Needs Special Care
With cash on delivery, the invoice is issued and the order shipped, but the money sits with the carrier until remitted, and a refused delivery comes back with nothing collected.
Hypothetical example: a store ships 600 COD orders worth SAR 180,000 in a month. Customers refuse 36 orders worth SAR 10,800. The carrier remits SAR 162,900 after collection fees. The store needs to know which orders were collected but not yet remitted, which were refused and need a credit note on return to stock, and what the refusals cost in two-way shipping. A clearing account per carrier, fed by the carrier's collection statement, answers those questions in minutes.
Preparing for Peak Season
Ramadan and the run-up to Eid, National Day, back-to-school and year-end sales can multiply order volume within days. An integration that copes with 200 orders a day may lag at 2,000. Weeks before the season: load-test at the expected volume and check the platform's API limits; raise the hidden buffer on best-sellers; position stock and review reorder points for seasonal lines; agree extra pickups with carriers; and name the person who watches stuck orders and unreported invoices every day.
Numbers to Watch After Go-Live
- Cancellations for stock reasons: a weekly rise means published stock is not reliable.
- Stuck orders: orders in the store that never reached the ERP.
- Pick-to-ship time: against the delivery promise made to customers.
- Unreported invoices: simplified invoices approaching the 24-hour window.
- Payment clearing balances: old unexplained balances signal incomplete reconciliation.
- Return rate and reasons by item: outliers point to descriptions, sizing or quality.
Common Integration Mistakes
- Connecting before a stock count: you simply automate the publishing of wrong balances.
- Two masters for price: editing prices in the store and the ERP creates endless conflicts.
- Ignoring variants: a product in five sizes and three colours is fifteen codes, not one.
- Booking net payouts as revenue: recording what the gateway paid after fees as sales hides the fees and distorts the VAT return.
- Nobody owns failures: every integration fails occasionally. What matters is that a named person knows the same day.
A Phased Plan
- Unify item codes: every product and variant (size, colour) carries one code in both systems.
- Orders and stock: automatic order import and stock publishing, with daily checks for differences in the first weeks.
- Invoicing and postings: e-invoice every order from the ERP and post the entries.
- Shipping and returns: carrier connections and a returns workflow with credit notes.
- Settlements and reporting: import gateway and marketplace statements; report profit by order and channel.
Do not connect everything on day one. Get orders and stock stable first, then add each layer.
How Tranquil Fits
Tranquil brings sales and distribution, inventory, accounting and e-invoicing compliant with Phase 1 and Phase 2 into one cloud system, with order management. The team's customisation services include API integrations with other systems to suit the store. If you also run physical branches, see our article on omnichannel ERP for retail.
Frequently Asked Questions
What is e-commerce ERP integration?
Automatic data exchange between your online store and your ERP: orders flow from the store to the ERP, and stock and prices flow from the ERP to the store, so every order becomes a complete transaction in inventory, accounting and VAT without re-entry.
Is the invoice my store platform issues enough?
It must meet ZATCA requirements for the phase your business is in and be reflected in your ledger and VAT return. Issuing it from the system that posts the entries keeps invoices and books aligned.
How do I reconcile gateway payouts with orders?
Import the detailed settlement report, match each line to its order, post fees as a separate expense, and use a clearing account per gateway that empties when the payout arrives. Anything left in it is an unpaid order or an unexplained fee.
What is the return window for Saudi online stores?
Under the E-Commerce Law, consumers may cancel within seven days of receiving unused goods, with exceptions. You can offer longer in your own policy.
Where do I start with a Salla store and separate accounting software?
Unify item codes, then connect orders and stock, then invoicing and settlements. You can talk to the Tranquil team about integration options for your store.

