Skip to content
Projects
2026 ·Pre-launch

Cash-on-delivery commerce

Commerce for cash-on-delivery markets: couriers, settlements and a double-entry ledger, with a path from a single shop to a multi-seller marketplace.

GoPostgreSQLS3

The problem

Most online selling in Bangladesh is cash on delivery through a courier, and the hard part is not the storefront. It is knowing whether the courier’s settlement matches the orders. It runs the shop, books couriers against all 64 districts and their thanas, and keeps the books straight; adding a second seller turns the same shop into a marketplace with commission and payouts.

Challenges

Money that has to reconcile

Every amount is an integer in the smallest unit, shown with South Asian digit grouping. Behind it sits a double-entry ledger (courier and gateway receivables, bank, per-seller payables, commission) that rejects an unbalanced entry before it ever reaches the database.

Checking courier settlements

Couriers pay out in bulk and report in spreadsheets whose columns vary. Settlement reports are matched by column header, parsed without floating point, and the gap between what the courier paid and what matched orders account for is shown plainly, with parcels left unpaid too long flagged for follow-up.

Never overselling

Stock is only claimed at checkout, never while browsing: it moves from available to reserved, and a cancelled order returns it, so two customers cannot buy the last item.

Implementation

Each shop’s own payment and SMS accounts

Payments go through each shop’s own merchant account rather than a shared one, and SMS is sent through a pluggable gateway, because there is no single SMS provider every business uses.

Photos served at the right size

Product images are stored once and delivered through the platform’s image service, so storefronts load quickly on phones without the seller resizing anything.

Why this stack

Go
A large domain (catalogue, orders, couriers, ledger, payouts) kept in one type-checked codebase.
PostgreSQL
Money and stock need transactions, constraints and row-level isolation between shops.
S3-compatible storage
Product photos live in object storage and are served through the image service.

What it does

  • Cash on delivery with courier booking across every district and thana
  • Double-entry ledger and courier settlement reconciliation
  • Catalogue with variants, CSV import and coupons
  • Marketplace mode with commission and seller payouts
  • Custom storefront domains and printable receipts
  • Staff roles kept separate from money settings