---
name: shopify-daily-sales-report
description: "Each morning: yesterday's Shopify net sales, order count, average order value and best-selling product, against the day before. Use when the user asks for this, or when it runs on a schedule."
---

# Shopify daily sales report

Each morning: yesterday's Shopify net sales, order count, average order value and best-selling product, against the day before.

Store owners open the Shopify app before they get out of bed, see today's first two orders and learn nothing. The question worth answering in the morning is how yesterday went as a whole: sales, orders, basket size and what sold.

The agent closes yesterday in the shop's own timezone, leaves out test and canceled orders, and counts sales after discounts and returns, before shipping and tax, so the number holds up when you compare it with the month-end reports.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- A Shopify custom app (created in the Dev Dashboard, or in older stores under Settings, Apps and sales channels, Develop apps) with the `read_orders` and `read_products` Admin API scopes; its access token in `SHOPIFY_ADMIN_TOKEN` and the store's `.myshopify.com` domain.
- Or a Shopify connector or MCP server that can query the Admin API for your store.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Get the shop's timezone** (Shopify): Query `shop { ianaTimezone currencyCode }` with the Admin GraphQL API and set yesterday from 00:00 to 24:00 in that zone.
2. **Pull yesterday's orders** (Shopify): Page through `orders(first: 250, query: "created_at:>='2026-10-15T00:00:00-04:00' created_at:<'2026-10-16T00:00:00-04:00'")` with `test`, `cancelledAt`, `discountCodes`, `currentSubtotalPriceSet` and `lineItems(first: 50) { nodes { quantity product { title } discountedTotalSet { shopMoney { amount } } } }`, following `pageInfo.endCursor`.
3. **Count net sales**: Leave out orders with `test: true` or a `cancelledAt`. Net sales is the sum of `currentSubtotalPriceSet.shopMoney.amount` (after discounts and returns, before shipping and tax); average order value is net sales divided by orders.
4. **Find the top product**: Group line items by product, sum `discountedTotalSet` and `quantity`, and rank by sales. Keep the top five for the card.
5. **Write the report**: Net sales, orders and average order value against the day before and the same weekday last week, the top product, the top five, and the discount codes used.

## Route B: the browser

### What you need

- Signed in to Shopify as the store owner or a staff member whose permissions include **Reports** and **Orders**; pick the store first if the account has several.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://admin.shopify.com/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Open the store's sales report**: From the store picker at admin.shopify.com, open the store, then **Analytics > Reports** and open **Sales over time**. Set the date picker to **Yesterday** and **Compare to: Previous day**. Analytics already uses the store's timezone.
2. **Read the day's totals**: Take **Net sales**, **Orders** and **Average order value** from the summary row, each with the change shown against the day before. Then change the comparison to a custom range for the same weekday last week and note those three numbers too.
3. **Rank the products**: Back in **Reports**, open **Sales by product**, keep the date on **Yesterday** and sort by **Net sales**. Read the top five with **Net items sold** and net sales.
4. **Check discounts and refunds**: Open the **Sales by discount** report for yesterday to see each code and the orders it was used on. Then go to **Orders**, filter **Date: Yesterday** and **Status: Refunded** or **Partially refunded**, and note the count and amounts.

Note: Shopify Analytics books a return on the day the refund happens, while the API route counts yesterday's orders at their current value, so net sales can differ slightly between the two routes. Test orders are already excluded from Analytics. Reports can take up to a few hours to catch up on the latest orders.

## The report

- **Net sales** yesterday, against the day before and the same weekday last week.
- **Orders** and **average order value**.
- **Top product** by sales, and the top five with units and sales.
- Discount codes used and refunds issued, if any.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "shopify-daily-sales-report/<date of this run, e.g. 2026-10-16>",
  "item_key": "shopify-daily-sales-report",
  "project": "Acme Store",
  "source": "Shopify daily sales report skill",
  "kind": "metric",
  "title": "Yesterday: $6,142 in sales from 86 orders",
  "metric": {
    "label": "Net sales",
    "value": 6142,
    "prefix": "$",
    "better": "higher",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": [
    {
      "type": "Grid",
      "props": {
        "columns": 3
      },
      "children": [
        {
          "type": "Stat",
          "props": {
            "label": "Orders",
            "value": 86,
            "delta": 6.2
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Average order",
            "value": 71.42,
            "prefix": "$",
            "delta": -2.9
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Top product",
            "value": "Linen tote"
          }
        }
      ]
    }
  ],
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Product",
          "Units",
          "Sales"
        ],
        "align": [
          "left",
          "right",
          "right"
        ],
        "rows": [
          [
            "Linen tote",
            31,
            "$1,209"
          ],
          [
            "Ceramic mug",
            22,
            "$528"
          ],
          [
            "Wool throw",
            4,
            "$440"
          ],
          [
            "Beeswax candle",
            17,
            "$323"
          ],
          [
            "Canvas apron",
            7,
            "$245"
          ]
        ]
      }
    },
    {
      "type": "KeyValue",
      "props": {
        "items": [
          {
            "key": "Discount codes",
            "value": "FALL15 on 12 orders"
          },
          {
            "key": "Refunds",
            "value": "1 order, $39"
          },
          {
            "key": "Same weekday last week",
            "value": "$5,480 from 79 orders"
          }
        ]
      }
    }
  ],
  "size": "md"
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

Set `period_start` and `period_end` to the window the number covers: the tile names it from them ("Last 7 days", "Today", "This month"). For a count right now (open items, a balance), send `"period_label": ""` so no period shows; for another name, send it as `period_label` (at most 24 characters).

## Run it on a schedule

Suggested: Every day at 7:15 (`15 7 * * *`). From cron, with the agent signed in on that machine:

```bash
15 7 * * * claude -p "Run the shopify-daily-sales-report skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/shopify-daily-sales-report#schedule

Source: https://briefkin.dev/skills/shopify-daily-sales-report
