Accounting automation · Salla + Shopify → Wafeq · Client build, shown with demo data

Qayd

A Saudi retailer sells on Salla and Shopify and keeps its books in Wafeq. I built the system that turns every order into the right invoice, payment or credit note, and a panel that shows the owner and the accountant where each order stands.

Panel overview on desktop: Salla, Shopify and Wafeq connection health, three orders that need attention, and today’s invoices with a 7-day chart.
The same overview on a phone, with a bottom tab bar.

Captured from the live demo: fictional stores, invented customers and sample orders that reset every few hours.

Role
System design, backend and panel
Stack
Cloudflare Workers · D1 · Salla, Shopify and Wafeq APIs
Scope
Invoices, payments, credit notes, stock matching, reports, alerts

Every order becomes the right accounting document. Nobody retypes it.

Each store order has to become a tax invoice in Wafeq, reported to ZATCA, and a payment on the right account: mada, Tabby, Tamara and cash on delivery each settle somewhere different. A cancellation needs a credit note against the original invoice. Done by hand, every order is typed twice and checked three times.

I first automated this with Zapier code steps, and that version runs in production. This system is the next step: the same rules on a Cloudflare Worker with its own database, plus a panel in Arabic that answers the accountant’s daily question: did this order reach Wafeq, and where did the money go?

Orders

Every order, beside what it became in Wafeq.

Orders from both stores in one list, with the invoice number next to each. Search by order, customer or invoice; filter by store and state. On a phone, table rows become cards.

Orders list on desktop with store, customer, amount, state and Wafeq invoice number columns
OrdersBoth stores, one list
Orders on a phone as cards with search and filters
On a phoneRows become cards
Order record

Each order tells its own story.

An order page shows what happened and when: received, invoiced, paid into which account, cancelled and credited. The accountant can see why a payment landed on Tamara’s account and not the bank’s.

A cancelled Shopify order: invoice issued and paid via Tabby, then a credit note against the same invoice
A cancellationInvoice, payment, then credit note
Order summary on a phone with the Wafeq invoice number and payment account
Order summaryInvoice and payment account
Exceptions

Problems arrive as a short to-do list.

When Wafeq does not answer, the Worker tries again after 5, 15, 60 and 360 minutes. What needs a person, such as a total that differs from the store or an order invoiced by hand, waits on the overview with one button to clear it, and reaches the team on Telegram.

Needs attention list on a phone: a retry in progress, a total mismatch and an order to issue by hand
Needs attentionOne action per problem
Settings on a phone with store and Wafeq connections
ConnectionsStores, Wafeq and alerts
Shared stock

Match the products before syncing the stock.

Both stores sell from one stock, so each product needs one shared SKU. The matching screen proposes pairs by name and the owner approves each one. No quantity changes until a match is approved.

Product matching on desktop: Salla and Shopify products paired with a name-match score and a proposed SKU
Product matchingProposed pairs, approved by hand
A proposed product pair on a phone with its SKU field and approve button
On a phoneApprove or reject each pair
Reports

Any period, as an Excel file for the accountant.

Net sales, VAT, credit notes and payments by account, for any period up to a year and for either store. The Excel files are built in the browser, which keeps the Worker inside the free plan’s CPU limit.

Reports on desktop: net sales, invoices, credit notes and payments per Wafeq account for the last 7 days
ReportsPeriod totals and payments by account
Reports on a phone with period buttons and the Excel download
Excel downloadReady for the accountant

What was verified

  • 226 automated tests on local data, with every outside request mocked
  • The invoicing rules behind it run in production as Zapier code steps I wrote, issuing invoices, payments and credit notes in Wafeq for both stores
  • The demo runs the real panel and API on sample data, with no keys and no outside requests

Honest scope

  • The client chose to keep the simpler Zapier setup, so this Worker never went live; it only ran in shadow mode beside it
  • Store names, customers and orders in the demo are fictional, and the client is not named
  • Shared-stock sync waits on matching SKUs and has not run on real stock
  • No time or cost savings have been measured
Next

What does your team retype every day?

Orders into accounting, leads into a CRM, stock between stores. Tell me which copy-and-paste job you want gone.