Case Study · ArchetypeDG · Custom ecommerce development · Ecommerce automation

ArchetypeDG

ArchetypeDG needed a storefront, an operations console and a partner programme that a small team could run without manual busywork. Commerce Pundit delivered custom ecommerce development for all three on one secure platform, using AI-assisted development under a spec-first process and ecommerce automation for the repeatable operations behind every order.

Laptop showing the ArchetypeDG shop with CADRE and M3TA Holster products
Client
Archetype Development Group
Industry
Tactical gear, D2C
Market
United States
Platform
Custom headless commerce
Delivery
~8 weeks

At a glance

The project in six lines

Client
ArchetypeDG, a US direct-to-consumer tactical holster brand
Challenge
Launch a secure store whose daily operations do not depend on manual work
Solution
Custom ecommerce development: storefront, ops console, partner portal and automation worker on AWS
Integrations
Stripe, PayPal, Stripe Tax, ShipStation / ShipEngine, Amazon SES, GTM
Timeline
8 weeks to a production-ready build
Result
75% of commits AI-assisted, 12 automated workflows, 395 test files

Reported outcomes

Numbers we can stand behind.

  • ~8 wks from first commit to a production-ready build
  • 75% of commits co-authored with AI coding agents
  • 218 API endpoints powering store, console and partners
  • 395 automated test files guarding the build

01 — The challenge

Great product. Operations that must run themselves.

A two-product launch had to grow into hundreds without a rebuild. Every order creates work: payment, tax, a label, a packing slip, emails, returns and partner commissions. Doing that by hand does not scale, so ecommerce automation had to sit at the core of the build. Money, accounts and customer data also leave no room for guesswork.

  1. Orders create a chain of tasks

    Payment, tax, fulfilment, tracking and customer emails all had to happen reliably and in order.

  2. Money paths are unforgiving

    Capture, cancel, refund and return rules needed strict guardrails against double charges and mismatches.

  3. Growth channels needed proof

    Influencers, ads and search all had to be tracked in a way that respects customer privacy and consent.

  4. Speed could not cost quality

    A short timeline still demanded tests, security and documentation a client can inherit.

The solution

One platform that connects the store, the back office and the partners

Payments, tax, shipping, email and analytics sit behind swappable integration ports. Changing a vendor means adding one provider and a setting, never rewriting checkout.

What we built

40+ connected modules across six business areas

Separate customer, staff and partner logins, with role-based permissions checked on every request.

Storefront

Fast, searchable, accessible

  • Product pages with gallery, variants and live stock
  • Collections, search and CMS-managed pages
  • Moderated reviews with photos
  • Sitemap, structured data and llms.txt

Delivered: 19 storefront modules

Checkout

Secure payments, correct tax

  • Card, Apple Pay, Google Pay and PayPal
  • Hosted payment fields, no card data on our servers
  • Stripe Tax at checkout
  • Authorise at order, capture at fulfilment

Delivered: amount-mismatch and duplicate-charge guards

Fulfilment

One-click labels and slips

  • Fulfilment grid with packing queue
  • 4×6 shipping label bought in the app
  • Packing slip and tracking recorded
  • Shipment email sent automatically

Delivered: daily carrier reconciliation fallback

Returns

Self-serve returns and cancels

  • Customer returns within 60 days of delivery
  • Prepaid return label created
  • Approve, receive, inspect, refund, replace
  • Pre-ship cancel with customer and staff emails

Delivered: SLA badges and email at every stage

Ops console

One console for the team

  • Executive dashboard and sales reporting
  • Orders, inventory, customers and CSV export
  • Reviews, CMS, SEO and email templates
  • Roles, sessions and an audit log

Delivered: 22 admin modules, 53 screens

Partners and growth

Attribution that respects privacy

  • Partner portal with links, orders and earnings export
  • Commission ledger and affiliate reports
  • Consent banner, GPC and Consent Mode v2
  • GTM data layer, Meta Pixel, Merchant feed

Delivered: isolated partner login realm

Three services, one delivery

Custom headless ecommerce development, automation and AI-assisted development

Custom ecommerce development

A storefront and console built around the business

No theme limits and no plugin stack to maintain. The front end and the back end evolve separately.

  • Next.js storefront with search, collections, variants and live stock
  • Card, Apple Pay, Google Pay and PayPal checkout with tax at checkout
  • Hosted payment fields, so card data stays off the site
  • Separate customer, staff and partner logins

Ecommerce automation

Operations that run on events and schedules

Each workflow fires on an event or a schedule and retries on failure, so work does not depend on someone remembering it.

  • Labels, packing slips, tracking and shipment emails
  • Abandoned-cart and review-request email sequences
  • Self-serve returns with a staff workflow and SLA badges
  • A daily job that reconciles carrier data

AI-assisted development

AI where it helps, and rules where it must not

AI agents helped build the platform under written specs and guardrails. The store runs on deterministic automation and is ready for AI features.

  • AI coding agents working spec first, with tests in every change
  • llms.txt, JSON-LD and Merchant feeds for AI search and shopping
  • Review insights behind a provider port, so a language model can be added later

03 — AI and automation

AI-assisted development shaped how it was built. Ecommerce automation runs how it operates.

The storefront does not hide a chatbot. The AI is in the engineering process, and the automation is in every order. The architecture is ready for AI-powered features when the business wants them.

In practice

Engineering processSpec, plan, tasks, code and tests, automated hardening scan, pipeline

Principles that kept AI-assisted delivery safe and reviewable.
  • Spec firstNo feature without a written spec
  • GuardrailsAgents may not invent APIs or schema
  • Tests required95% coverage target on money paths
  • Humans decideRisk signals advise, never auto-block

04 — Automation at work

12 ecommerce automation workflows that run on their own

Each one fires on an event or a schedule and writes its side effects through the outbox, so a failure retries instead of vanishing.

One order, no manual steps

Live path from checkout to aftercare — every handoff is handled by a workflow.

Fully automated

  1. Order placed

    Payment authorised, stock checked

  2. Tax and payment guards

    Live tax quote, duplicate-charge and mismatch checks

  3. Packing

    Shipping label and packing slip generated

  4. Shipped

    Tracking recorded, shipment email sent

  5. Delivered

    Review request sequence starts

  6. After the sale

    Returns, refunds and partner commissions follow set rules

Workflow Trigger What happens automatically
Order and paymentOrder placedPayment authorised, stock checked, guards block amount mismatches and duplicate charges, confirmation email queued.
Sales taxCheckout, refundLive tax quote at checkout. Orders and refunds are reported to the tax provider in the background.
Fulfilment and labelsOrder moves to packingLabel and packing slip generated, tracking recorded, shipment email sent. A daily job reconciles carriers for missed webhooks.
Abandoned-cart recoveryCart left behindMulti-step email sequence on admin-set delays. Stops when an order is placed and respects marketing consent.
Review requestsOrder deliveredReminder sequence invites a review and stops once one is submitted.
Review intelligenceReview approvedModeration queue, topic counts and FAQ-gap flags for editors.
Returns (RMA)Customer starts a return60-day window from delivery, prepaid label, staff workflow with SLA badges and emails at each stage.
InventoryStock changesReservations and stock moves recorded, low-stock alerts to staff, back-in-stock alerts to shoppers.
AffiliatesReferred visit or orderConsent-aware attribution feeds a commission ledger and partner earnings exports.
PrivacyScheduledConsent Mode v2 and Global Privacy Control honoured, with scheduled privacy sweeps.
Email deliveryEvery sendEditable templates. Bounce and complaint events update a suppression list.
Release pipelineCode pushedImages build in parallel and are type-checked, staging deploys automatically, production waits for manual approval.

05 — Security by design

Controls built in, not bolted on

Payments and data

Safe by construction

  • Hosted fields keep card data off our servers (PCI SAQ-A design)
  • Money stored as exact integer units
  • Idempotency keys on payments and refunds
  • Append-only audit trail enforced in the database

Access and identity

Least privilege

  • Argon2id password hashing
  • Tokens in secure HTTP-only cookies only
  • Separate customer, staff and partner realms
  • Role checks in the service layer, bot protection and rate limits

Platform

Hardened pipeline

  • Nonce-based Content Security Policy and CSRF protection
  • Secrets in a managed vault, failing closed if missing
  • Infrastructure as code with runbooks
  • Licence scan keeps dependencies client-safe

06 — Results

Numbers we can stand behind

  • 1,000+ Hours saved Manual order, shipping, returns and email work removed
  • 0.5% Error rate Orders needing manual correction
  • 90+ Page speed score Google PageSpeed score on key storefront pages
  • 99.99% Uptime Platform availability since launch

Measurement framework

How we count AI-assisted delivery

AI-assisted commits are those carrying a Cursor or Claude co-author credit. AI agents co-author; engineers set the specs and rules.

AI-assisted commits ÷ All commits

Equals 75% AI-assisted delivery for this build, measured from co-author credits in the repository history.

07 — How we delivered

From specification to a platform that runs itself

  1. 01

    Specify

    Architecture plan, decision records, design tokens and an engineering rulebook agreed before code.

  2. 02

    Build

    Storefront, console and integrations built with AI agents against specs, with tests in every change.

  3. 03

    Automate

    Worker, outbox, email sequences, labels, returns and reconciliation added module by module.

  4. 04

    Harden

    Security controls, accessibility and performance checks, runbooks and a gated production pipeline.

08 — Built on

Technology stack

A cohesive digital ecosystem for storefront, ops console, partners and automated fulfilment on AWS.

Frequently asked questions

Questions teams ask about AI-built commerce

Answers about how AI was used to build the platform, and how the store runs day to day.

Is AI used inside the store or only to build it?

Mainly to build it. The store itself runs on deterministic ecommerce automation, not a chatbot. It is also AI-ready: llms.txt, structured data and a review-insight service behind a provider port mean a language model can be added without a rewrite.

How do you keep AI-assisted development safe?

Specs, plans and tasks come before code. A written rulebook forbids agents from inventing APIs, schema fields or cloud settings. Tests ship with every change, payments, auth, inventory and returns carry a 95% coverage target, and automated hardening scans run in the pipeline.

How are payments kept secure?

Card entry uses the payment provider’s hosted fields, so card numbers never touch the site’s pages or servers (a PCI SAQ-A style design). Amounts are stored as integer minor units, and payments and refunds use idempotency keys.

Can payment, shipping or tax vendors be swapped later?

Yes. Payments, shipping, tax, email, analytics and search sit behind integration ports. Changing a vendor means adding one provider file and a setting, not rewriting checkout.

What happens if a webhook or an email fails?

External side effects go through a transactional outbox with retries. Mutations are idempotent, a daily job reconciles carrier data in case a webhook was missed, and bounces and complaints feed a suppression list.

Who owns the code?

The project rules restrict dependencies to permissive licences (MIT, Apache-2.0, BSD, ISC) and a licence scan checks them, so the client can own and reuse the platform.

How long does a project like this take?

This build went from first commit to a production-ready platform in about eight weeks. Timelines for custom ecommerce development depend on scope, integrations and how much of your operations you want automated.

What can come next?

Typical next steps are new automation workflows, LLM-powered review insights and customer assistance on the existing ports, performance and AI-search optimisation, and further phases such as wholesale or multi-carrier shipping.

Free for D2C and ecommerce teams

Which part of your operations would you automate first?

Get a free 30 minute Commerce Automation Audit. We review your order, shipping, returns, email and partner workflows and show you which three ecommerce automation opportunities to tackle first, with an effort estimate.

Atlanta · Ahmedabad · sales@commercepundit.com · 770-285-8191
We reply within one business day.

  • Your top 3 ecommerce automation opportunities
  • A map of your systems and how they could connect
  • Where AI helps, and where it should not
  • Bonus: the 12 Workflows to Automate First checklist (PDF)