# Storefront & Orders

## Overview

The Store turns your product catalog into a public, customisable mini-shop and gives you a single inbox for every order. Find it under More → Store (admin-only). It has three relevant areas:

Area | Purpose
--- | ---
Storefront | Design and configure your public shop: theme, branding, web address, custom domain, currency, shipping, and a payment link.
Orders | A list and detail view of every order from every channel, with status updates and payment-link reminders.
Public storefront | The buyer-facing site, shown in one of eight themes, with an "Order on WhatsApp" flow.

Buyers browse the public shop, build a cart, and check out with a name, phone, and address. The storefront builds the order on your server — re-checking every price, applying coupons and shipping, scoring COD risk, and reducing stock — then hands the buyer off to WhatsApp to finish in chat. You confirm and collect payment, either by an automatic payment link or in conversation. Every order — whether it came from the storefront, the official Cloud API, Twilio, or was entered by hand — lands in one Orders inbox.

Beyond the basics, the Store includes a full closing funnel: server-side checkout with lead capture, coupons, product reviews, abandoned-cart recovery, cash-on-delivery with return-risk scoring, automatic Razorpay payment links that confirm payment for you, a private order-tracking page, and search-engine optimisation and analytics.

## Prerequisites

The storefront is created during the WhatsApp Store setup wizard, which creates the shop and connects a sending WhatsApp device. If you open Storefront settings before finishing the wizard, WaDesk sends you there rather than quietly creating an empty shop.

To do this | You need
--- | ---
Reach the Store at all | Workspace role Admin (the whole Store area is admin-only).
Run a public storefront | The WhatsApp Store wizard completed — a shop plus a connected device. The connected number powers the "Order on WhatsApp" button.
List products in the shop | Products with status Active and "Available for sale" on (see the Catalog page).
Sync the same products to a Meta catalog | A Meta Business Catalog — optional, only for the WhatsApp catalog button / cart / order notifications.
Use a custom domain | Access to your domain's DNS to add a CNAME record.

## Storefront settings

Open Store → Storefront. The View live button opens your public shop in a new tab. The form is grouped into sections.

### Theme

Pick one of eight built-in themes from the visual picker. Switching is instant.

Theme | Style
--- | ---
Aurora | Minimal (the default theme)
Meridian | Magazine
Verdure | Organic
Bazaar | Colorful grid
Noir | Dark luxe
Kraft | Handmade
Mercato | Deli / cafe
Studio | Portfolio

### Identity & branding

Field | Rule | Notes
--- | --- | ---
Storefront web address (slug) | Lowercase letters, numbers, hyphens; unique; max 64 | Forms your shop's web address.
Logo URL | Link, max 1024 | A direct image link for the shop logo.
Brand color | Hex colour (e.g. #1FA855) | Colour picker plus a text field; used as the theme's accent colour (defaults to a WhatsApp green if unset).
Hero text | Max 280 | Headline shown at the top of the shop.
Footer text | Max 280 | Footer line (e.g. a copyright notice). Defaults to a year plus shop-name line when blank.
Currency | One of 21 codes | Default for new products and the symbol in the cart (INR, USD, EUR, GBP, AED, KES, NGN, ZAR, BRL, MXN, CRC, PHP, IDR, SGD, MYR, THB, VND, EGP, PKR, BDT, LKR).
Storefront live | On / off | Takes the public shop online or offline. When off, the shop's web address shows a "not found" page.

### Shipping

Configure a simple shipping rule. Values are entered in major units and stored in minor units:

Field | Effect
--- | ---
Flat shipping fee | Added to every order (blank or 0 = free shipping).
Free shipping above | Carts at or over this subtotal ship free.
Shipping note | Up to 160 chars, shown in the cart and on the product page.

### Payment

Pick a payment provider and enter the matching detail. The simple providers just add a payment handle or link to the WhatsApp order message; the buyer pays and you confirm in chat. The Razorpay (auto) provider is different — it creates a real, per-order payment link and marks the order paid automatically once payment is confirmed (see Auto payment links).

Provider | Payment detail to enter
--- | ---
None / cash on delivery | —
UPI (India) | UPI ID + name
Razorpay Payment Link | The payment link URL
Razorpay (auto) | Key ID + Key secret + Webhook secret (the secrets are stored securely and never shown back; leave blank to keep the saved value)
Stripe Payment Link | The payment link URL
PayPal.me | Your PayPal.me handle
Bank transfer | Bank account instructions

> Razorpay (auto) keys are your own. The link is created on your Razorpay account and the money settles to you — WaDesk only creates the link and listens for the "paid" notification. The secrets are stored securely per shop.

### Abandoned-cart recovery

Switch on a WhatsApp nudge for buyers who enter their phone at checkout but don't complete. See Abandoned-cart recovery for how it works.

Field | Effect
--- | ---
Cart recovery enabled | Off by default. When on (and a device is connected), an abandoned cart schedules one nudge.
Delay (minutes) | How long after the cart is abandoned the nudge fires (5–1440, default 30).
Message | Optional custom text. Tokens `{name}` `{shop}` `{url}` `{total}` are substituted. Blank uses a sensible default.

## Custom domain verification

By default your shop is reachable at its built-in web address. To use your own domain, enter it in the Custom domain field (e.g. `shop.yourbiz.com`) and save. WaDesk then shows the CNAME target to point at.

1. At your DNS provider, create a CNAME record for your domain pointing to the CNAME target shown on the page.
2. Back in WaDesk, click Verify now. WaDesk checks your domain's DNS and confirms it points to the expected target.
3. On success the domain is marked verified, your shop serves from it, and the page reloads. On failure you see the records found and the expected target so you can compare.

> Changing the custom domain marks it unverified again — you must re-verify after any change. Only a verified custom domain serves the public shop; until then the built-in web address keeps working. DNS changes can take a while to spread, so a fresh CNAME may need a few minutes (occasionally longer) before Verify succeeds.

## The public storefront

The buyer-facing shop is served at its built-in web address, your subdomain, or your verified custom domain. WaDesk figures out which shop to show from the web address and applies that shop's chosen theme. Only shops that are set live are shown; anything else shows a "not found" page.

Page | What it does
--- | ---
Catalog grid | Shows available, active products (48 per page) with a category filter and a price range, plus a "Show more" button that loads further pages.
Product detail | The gallery, full description, and a related-products row (same category first, then anything else from the shop, up to 8).
Order on WhatsApp | Finds your WhatsApp number (from your provider settings or the connected device), so buyers can hand off their cart to a WhatsApp chat with you.

### How the public web address is chosen

The buyer-facing address is chosen in three ways, in order: a verified custom domain (`https://shop.brand.com`); your shop's subdomain (`https://yourshop.shops.brand.com`); otherwise the built-in path-based address — so setups without subdomain DNS still work.

## Server-side checkout

When a buyer builds a cart and checks out, the shop asks for their name, phone, and address, then sends it to your server. WaDesk does not trust the cart from the browser — it rebuilds the order on the server:

Step | What the server does
--- | ---
Re-price | Every price is re-read from your own records; the browser's price is ignored. This blocks price tampering.
Cap quantity | Each item's quantity is capped at the product's available stock.
Coupon | Any applied coupon is re-checked and the discount recalculated (see Coupons).
Shipping | Worked out from the shop's shipping rule (flat fee / free above a threshold).
COD risk | For cash-on-delivery, a return-risk score is attached (see COD & RTO).
Stock | Stock-tracked products are reduced at the same time.
Save | A new storefront order is created with the customer's details, items, totals, and a unique tracking code.

The shop then clears the cart, opens WhatsApp pre-filled with the order summary (including the tracking link), and cancels any pending cart-recovery nudge for that phone. Checkout never sends a WhatsApp message itself — it just hands the buyer a ready-to-send WhatsApp link to tap.

> Lead capture. Because the phone and address are saved at checkout (and even when the buyer leaves the phone field, for recovery), you keep the customer even if they never tap through to WhatsApp.

## Coupons

Create discount codes under Store → Coupons. Buyers enter a code at checkout; Apply shows a live quote, and the discount is re-checked and recorded when the order is placed.

Field | Meaning
--- | ---
Type | Percentage (e.g. 10% off) or a fixed amount off.
Minimum order | Cart subtotal must reach this before the code applies.
Maximum discount | Caps how much a percentage coupon can take off.
Free shipping | Optionally waive the shipping fee.
Expiry | Date after which the code stops working.
Usage limit | Total uses allowed; the count goes up on each successful order.

The order stores both the code used and the discount amount, so the discount stays part of the permanent record even if the coupon is later edited or deleted.

## Product reviews

Buyers can leave a star rating and review on any product page; each review is saved as pending. The product page shows a rating summary (average plus count) and the list of approved reviews — shown consistently across all eight themes.

Moderate under Store → Reviews: tabs for pending / approved / rejected, with approve / reject / delete actions and a pending-count badge in the sidebar. Only approved reviews are public, so nothing shows on the shop until you clear it.

> Review submissions are rate-limited to prevent spam. New reviews always start pending — nothing is published automatically.

## Customer order tracking

Every storefront order gets a unique, unguessable tracking link. The buyer can open a standalone, branded status page from that link — no login needed. The link is included in both the checkout hand-off and the WhatsApp message.

The page shows the order's progress (new → confirmed → paid → shipped), the items, totals including shipping and any discount, the delivery address, a Pay now button when a payment link is present, and a "message us" WhatsApp link. It's read-only — viewing it never changes the order or sends anything.

## SEO & analytics

Public shop and product pages include the social-preview tags (Open Graph and Twitter cards) so links show a nice preview when shared. Product pages also include structured product data (name, price, currency, availability, and average rating when reviews exist) so they can qualify for rich results in search.

Page views are counted per shop per day (each time someone fully loads the catalog grid or a product page). The Store dashboard's 30-day views tile shows this real figure.

## Orders list

Open Store → Orders for every order from every channel. The toolbar offers search by phone or name, a status filter, and a source filter; the list shows 25 per page. Each row shows when the order came in, the customer, where it came from, the item count, total, status, and an Open link. Count tiles summarise All / new / confirmed / paid / shipped / cancelled.

Each order records where it came from:

Source | Created from
--- | ---
WABA | An order placed through the WhatsApp Cloud API.
Storefront | A cart from your public shop, read from the WhatsApp message.
Twilio | An inbound Twilio WhatsApp message.
Manual | Entered by an operator.

## Order detail & status updates

The order detail page shows the line items (with image, quantity, and per-item price), the order total, and the customer's contact details. Reply on WhatsApp jumps to the chat. From the Update status card you can change the status, set or edit a payment link (validated as a URL), and add internal notes (up to 1000 chars).

Orders move through these statuses:

Status | Meaning
--- | ---
New | Just received, not yet actioned (the default).
Confirmed | You have accepted the order.
Paid | Payment received.
Shipped | Dispatched to the customer.
Cancelled | The order was cancelled.

An order can also be removed from the detail or list actions. Removing an order deletes only the order — not the customer or the conversation. Each order keeps its own copy of the items, so past orders stay intact even if a product is later deleted.

## Payment-link reminders

When an order has a payment link set, the detail page shows Send payment link via WhatsApp.

1. Set (or confirm) the payment link and save it — the reminder uses the saved link.
2. Click Send payment link via WhatsApp.
3. WaDesk composes a message addressed to the customer with the order total and the link, then dispatches it through the workspace's connected WhatsApp engine.
4. The result (sent or failed) is reported back, and the outbound message is recorded.

> This sends a real WhatsApp message to the customer's number. Save the payment link first (the reminder requires a valid URL), and only use it against genuine orders.

## Auto payment links & webhook auto-confirm

With the Razorpay (auto) provider set up (your own Key ID / Key secret / Webhook secret), WaDesk creates a real, per-order Razorpay payment link and can confirm payment automatically.

1. On the order detail page, click Generate Razorpay link + send. WaDesk creates a link on your Razorpay account (for the order total, tagged with the order number) and sends it to the customer over WhatsApp in one step.
2. The buyer pays via the link.
3. Razorpay notifies WaDesk. WaDesk identifies the order, confirms the notification is genuine using your webhook secret, and marks the order paid.

Property | Detail
--- | ---
Money flow | Settles to your Razorpay account — WaDesk only creates the link and listens for the result.
Genuineness check | Strict: a missing or incorrect signature is rejected and the order is left unchanged.
No double-counting | A repeated "paid" notification for an already-paid order does nothing — the order is marked paid only once.
Secrets | The key secret and webhook secret are stored securely and never sent back to the browser.
Webhook URL | Point your Razorpay webhook at `https://yourdomain/webhooks/storefront-pay` and subscribe to the "payment link paid" event.

> Other providers (UPI, static Razorpay/Stripe links, PayPal.me, bank transfer, COD) still work as paste-in handles — only Razorpay (auto) creates links and confirms payment automatically.

## Abandoned-cart recovery

When a buyer enters their phone at checkout but doesn't complete the order, WaDesk can send a single WhatsApp nudge with a link back to the shop. It's off by default — enable it under Storefront settings → Abandoned-cart recovery.

1. As soon as the buyer types their phone and moves on, the shop quietly notes the cart (once per visit).
2. If recovery is enabled and a WhatsApp device is connected, WaDesk schedules a single nudge for delay minutes later (default 30). Only one pending nudge exists per phone per shop.
3. If the buyer completes the order, the pending nudge is cancelled and the cart is marked recovered.

Detail | Behaviour
--- | ---
Message type | Plain text (no approved template needed), so it works on the Unofficial API engine too.
Requires | A connected device in the workspace — without one, recovery is skipped quietly.
Personalisation | The message can include `{name}` `{shop}` `{url}` `{total}`.
No double-send | A pending nudge for the same phone and shop won't schedule a second one.

## COD & RTO risk scoring

At checkout the buyer chooses prepaid or cash on delivery. For COD orders, WaDesk computes a Return-to-Origin (RTO) risk score (0–100) and a band, so you can decide whether to confirm, ask for prepayment, or call first.

Signal | Effect on risk
--- | ---
First-time buyer | Raises risk (no track record).
Prior cancellations | Raises risk per past cancelled order.
Order well above the customer's usual value | Raises risk.
Suspiciously short phone number | Raises risk.
Repeat customer | Lowers risk.

The score and band (low / medium / high) are saved on the order and shown as a colour-coded badge on the order detail page, alongside the COD label. Prepaid orders are not scored.

## Troubleshooting

Symptom | Cause & fix
--- | ---
Opening Storefront settings redirects to a wizard | No shop exists yet. Complete the WhatsApp Store setup wizard first.
The shop's web address shows "not found" | The storefront is off (Storefront live = off) or the web address is wrong. Turn it live and confirm the address.
No products show on the shop | Products must be status Active and "Available for sale". Drafts and out-of-stock items are hidden.
Custom domain won't verify | The CNAME isn't pointing to the shown target yet, or the DNS change hasn't spread. Compare the records in the Verify result against the expected target and wait.
Custom domain stopped serving after an edit | Editing the domain marks it unverified. Re-run Verify now.
"Order on WhatsApp" button missing a number | No provider phone and no connected device. Connect a device in the wizard or connect a provider number.
Payment reminder failed to send | Check the connected engine is healthy and the payment link is saved as a valid URL. The send result is reported on screen.
"Generate Razorpay link" does nothing / errors | The provider must be Razorpay (auto) with a valid Key ID + Key secret saved. Without keys, no link is created.
Order didn't auto-mark as paid | The Razorpay webhook must point at `/webhooks/storefront-pay` and the saved Webhook secret must match Razorpay's — the genuineness check is strict.
Cart-recovery nudge never arrives | Recovery must be enabled, a device must be connected, and the buyer must enter a phone at checkout. If they complete the order, the nudge is cancelled by design.
Coupon won't apply | Check it isn't expired, the cart meets the minimum order, and the usage limit isn't reached.
A review isn't showing on the shop | New reviews are pending — approve it under Store → Reviews. Only approved reviews are public.
Web address rejected | It can only use lowercase letters, numbers, and hyphens, must be unique, and max 64 characters.