WeekwrightAPI reference
Open the app

v0.1.4

Build on your weekly pack

Weekwright product API (v1). Public docs use stores/packs/billing vocabulary.

Base URL

Productionhttps://api.weekwright.io/v1

Staginghttps://api.staging.weekwright.io/v1

Every route is served at the root and under /v1. The server picker above updates every example on this page.

Authentication

Sign in with POST /session. The response sets a session cookie that is HttpOnly, Secure, and host-only. Send it back with every call; from a browser, use credentials: 'include'.

The session is bound to one account, chosen by the server. A request cannot name an account or a list of stores, so there is nothing to pass and nothing to guess. Sessions last seven days.

curl
# sign in once, keep the cookie, then call anything
curl -sS -X POST "$BASE/session" -c cookies.txt \
  -H 'Content-Type: application/json' \
  -d '{"email":"[email protected]","password":"demo-pass"}'

curl -sS "$BASE/me" -b cookies.txt

The demo account above exists only on a local API. Use your own account on staging or production.

Conventions

  • JSON in, JSON out. Bodies are limited to 1 MiB. Unknown fields on write calls are rejected.
  • Money is an integer in minor units plus an ISO 4217 code, like {"amountMinor": 1248000, "currency": "USD"}. Amounts are never summed across currencies.
  • Dates. Timestamps are RFC 3339 in UTC. A report's week start and end are calendar dates.
  • IDs are UUIDs. A malformed ID returns 400.
  • Pages. List calls take limit and cursor; pass back the cursor you were given.

Errors

Failures use the usual HTTP status and one body shape. Branch on error.code; show error.message to a person.

Error body
{
  "error": {
    "code": "not_found",
    "message": "That report was not found."
  }
}
StatusMeaning
400The request was malformed.
401Not signed in, or the session ended. Sign in again.
403Signed in, but not a member of the account that owns this.
404Not found, or not visible to your account.
422The request was understood but a value is not acceptable.
429Too many attempts. Wait for the number of seconds in Retry-After.

Account

Sign in and start a session

POST/session No sign-in #

Checks the email and password and sets the host-only session cookie (HttpOnly, Secure, SameSite=Lax, Path=/, no Domain attribute). The session is bound to the account the server picks for the user. The request cannot name an account. Sessions last seven days. Same empty 204 as POST /signup. Email is compared after trimming and lower-casing. A wrong password and an unknown email both return 401 with the same message, so the response does not reveal which emails are registered. Calls are limited per TCP peer, and an email with repeated wrong passwords is locked for a while, even if the next password is right. Both limits return 429 with Retry-After, set no cookie, and live in process memory, so they are not shared across API replicas.

Request body

FieldTypeDescription
emailrequired string · email
passwordrequired string · password

Responses

Signed in and session cookie set. No response body.

Empty body.

Sign out

DELETE/session No sign-in #

Ends the current session and clears the session cookie. Safe to call when already signed out: it still returns 204.

Responses

Signed out and session cookie cleared. No response body.

Empty body.

Create an account and start a session

POST/signup No sign-in #

Creates the account, an owner user, and a 14-day trial, then sets the host-only session cookie (HttpOnly, Secure, SameSite=Lax, Path=/, no Domain attribute). Same empty 204 as POST /session. The email starts unverified and a confirmation link is emailed to it (see POST /me/email/verification to resend). A failed send does not fail signup. Password length is 8–72 characters. A duplicate email returns 409. Calls are limited per TCP peer by an in-process counter so a public origin cannot flood account creation. The limit is not shared across API replicas and does not use X-Forwarded-For.

Request body

FieldTypeDescription
emailrequired string · email
passwordrequired string · password

min length 8 · max length 72

name string

Account and profile name. Omitted or blank uses the email local-part, or "My store" when that is empty.

max length 200

Responses

Account created and session cookie set. No response body.

Empty body.

Get current user profile

GET/me Needs sign-in #

Responses

Profile

FieldTypeDescription
idrequired string · uuid
emailrequired string · email
emailVerifiedrequired boolean

False until the person opens the emailed confirmation link. Changing the email sets it back to false. The web app shows a notice while it is false.

name string · nullable
accountId string · uuid

Tenant account bound to the session

Example response
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "email": "[email protected]",
  "emailVerified": true,
  "name": "name",
  "accountId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40"
}

Update profile

PATCH/me Needs sign-in #

Changing email clears emailVerified, retires every unused emailed link for the account, and sends a new confirmation link to the new address. Prevents silent inbox takeover from a stolen session.

Request body

FieldTypeDescription
name string
email string · email

Responses

Updated profile

FieldTypeDescription
idrequired string · uuid
emailrequired string · email
emailVerifiedrequired boolean

False until the person opens the emailed confirmation link. Changing the email sets it back to false. The web app shows a notice while it is false.

name string · nullable
accountId string · uuid

Tenant account bound to the session

Example response
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "email": "[email protected]",
  "emailVerified": true,
  "name": "name",
  "accountId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40"
}

Change password

POST/me/password Needs sign-in #

Request body

FieldTypeDescription
currentPasswordrequired string · password
newPasswordrequired string · password

Responses

Password changed

Empty body.

Send or resend the email confirmation link

POST/me/email/verification Needs sign-in #

Emails a single-use confirmation link to the signed-in user's current address. The link works once and expires in 24 hours. Asking again retires the earlier link, so only the newest one works. When the email is already confirmed this returns 204 and sends nothing. The address always comes from the session's user; the request has no body. Limited per user and per TCP peer by in-process counters, so the limit is not shared across API replicas. 502 means the mail relay refused the message; try again later.

Responses

Link sent, or the email was already confirmed. No response body.

Empty body.

Get which emails the signed-in person gets

GET/me/notifications Needs sign-in #

Whether the person gets the Monday report email. It is on for everyone until they turn it off, here or with the Unsubscribe link in the email.

Responses

The person's email choices

FieldTypeDescription
reportEmailrequired boolean

Whether the person gets the Monday report email.

addressUndeliverablerequired boolean

True when the mail provider reported the person's address as bouncing for good or as a spam complaint. The Monday email no longer goes to it, whatever reportEmail says. Changing the address in the profile clears it.

Example response
{
  "reportEmail": true,
  "addressUndeliverable": true
}

Turn the Monday report email on or off

PATCH/me/notifications Needs sign-in #

Sets whether the signed-in person gets the Monday report email. It changes only their own choice: the person always comes from the session, and the request names no one else. Turning it back on resumes the email from the next report onward; reports already built are not sent late.

Request body

FieldTypeDescription
reportEmailrequired boolean

true to get the Monday report email, false to stop it.

Responses

The choice that is now in force

FieldTypeDescription
reportEmailrequired boolean

Whether the person gets the Monday report email.

addressUndeliverablerequired boolean

True when the mail provider reported the person's address as bouncing for good or as a spam complaint. The Monday email no longer goes to it, whatever reportEmail says. Changing the address in the profile clears it.

Example response
{
  "reportEmail": true,
  "addressUndeliverable": true
}

Stop the Monday report email with the link from the email

POST/unsubscribe No sign-in #

Public on purpose: the person pressing Unsubscribe in their inbox has no session, and mail providers post here for them (RFC 8058 one-click), without the app's Origin. The signed token in the link is the credential. It names one person and can do one thing: turn that person's Monday email off. It does not expire, so a link in an old email still works. The request has no body, so a provider's List-Unsubscribe=One-Click form post is accepted. Turning it off twice is fine. A token that is not valid, or that names someone who no longer exists, gets the same 422. 404 when the server has no signing key for these links.

Parameters

NameWhere and typeDescription
trequiredquery · string

The token from the unsubscribe link.

min length 1 · max length 256

Responses

The email is off. No response body.

Empty body.

Confirm an email address with the emailed token

POST/email/verify No sign-in #

Public on purpose: the person clicking the link may be on another device, so there is no session. The token is the credential. It is single-use and expires 24 hours after it was sent. A token that is unknown, expired, already used, or retired by a newer link or by an email change gets the same 422, so a caller cannot probe which. Calls are limited per TCP peer by an in-process counter.

Request body

FieldTypeDescription
tokenrequired string

The token from the link in the confirmation email.

min length 1 · max length 128

Responses

Email confirmed. No response body.

Empty body.

Email a link to choose a new password

POST/password/forgot No sign-in #

Public, because the person asking cannot sign in. Always answers 204 with no body for a well-formed email, whether or not an account exists, so the response never says which emails are registered. When an account exists, a single-use link that expires in 1 hour is emailed to it; asking again retires the earlier link. The lookup and the send happen after the response, so the timing does not say either. Limited per TCP peer (10 a minute) and per email (3 an hour) by in-process counters, which count unknown emails the same way. 422 means the value is not an email address at all.

Request body

FieldTypeDescription
emailrequired string · email

max length 254

Responses

Accepted. A link is sent if an account exists. No response body.

Empty body.

Choose a new password with the emailed token

POST/password/reset No sign-in #

Public: the token is the credential. Spends the token, stores the new password as bcrypt, and signs the user out on every device, all in one transaction. A correct reset also confirms the email, since the link proved the person reads that inbox. It does not sign anyone in. The password is checked first, so a too-short one answers 422 invalid_password and leaves the link usable. A token that is unknown, expired, already used, or retired by a newer link or an email change answers 422 invalid_link, the same for every cause, so a caller cannot probe. Limited to 20 calls a minute per TCP peer.

Request body

FieldTypeDescription
tokenrequired string

The token from the link in the reset email.

min length 1 · max length 128

newPasswordrequired string · password

min length 8 · max length 72

Responses

Password changed and every session ended. No response body.

Empty body.

Onboarding and account status for routing

GET/me/status Needs sign-in #

Frontend routes off onboarding.step. Waiting UI may poll this endpoint with a ceiling of ≥2–5s between polls (no sub-second polling). firstReport.message is always a client-safe mapped string (never raw vendor errors).

Responses

Status

FieldTypeDescription
accountIdrequired string · uuid

Tenant account for this session (same as UserProfile.accountId)

emailrequired string · email
emailVerifiedrequired boolean
billingrequired BillingStatus
Show fields
FieldTypeDescription
statusrequired string
nonetrialingactivepast_duecanceled
trialEndsAt string · date-time · nullable
currentPeriodEndsAt string · date-time · nullable
shoprequired ShopSummary
Show fields
FieldTypeDescription
id string · uuid · nullable
connectedrequired boolean
shopDomain string · nullable

Store domain for display; not a vendor brand in UI copy

connectedAt string · date-time · nullable
onboardingrequired Onboarding
Show fields
FieldTypeDescription
steprequired string
verify_emailbillingconnect_shopwaiting_first_reportcomplete
firstReportrequired FirstReportStatus

v1: account-scoped on MeStatus.onboarding.firstReport. Phase B: moves under the active shop; do not assume account-scoped forever.

Show fields
FieldTypeDescription
staterequired string
not_startedqueuedgeneratingreadyfailed
reportId string · uuid · nullable
expectedAt string · date-time · nullable
message string · nullable

Client-safe status/error string only

Example response
{
  "accountId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "email": "[email protected]",
  "emailVerified": true,
  "billing": {
    "status": "none",
    "trialEndsAt": "2026-03-09T07:00:00Z",
    "currentPeriodEndsAt": "2026-03-09T07:00:00Z"
  },
  "shop": {
    "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
    "connected": true,
    "shopDomain": "cozy-goods.example",
    "connectedAt": "2026-03-09T07:00:00Z"
  },
  "onboarding": {
    "step": "verify_email",
    "firstReport": {
      "state": "not_started",
      "reportId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
      "expectedAt": "2026-03-09T07:00:00Z",
      "message": "That report was not found."
    }
  }
}

Stores overview with rollup totals

GET/account/overview Needs sign-in #

Shop set is derived server-side from session accountId + membership. Totals use latest ready report per store; waiting stores appear in stores[] but are omitted from rollup math. Never sum across currencies — use totalsByCurrency[]. Responses should carry short TTL Cache-Control (e.g. private, max-age=30–60) so multi-store home does not amplify load.

Responses

Overview

FieldTypeDescription
totalsrequired AccountOverviewTotals

No single cross-currency revenue sum. Roll up per currency only.

Show fields
FieldTypeDescription
storeCountReadyrequired integer
totalsByCurrencyrequired array of CurrencyTotals
Show fields
FieldTypeDescription
currencyrequired string

ISO 4217

min length 3 · max length 3

revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

ordersrequired integer
storesrequired array of StoreOverviewItem
Show fields
FieldTypeDescription
idrequired string · uuid
namerequired string

Customer-facing store name

shopDomain string · nullable

Store domain for display

statusrequired string
readywaitingfaileddisconnected
latestReady StoreLatestReady · nullable
Show fields
FieldTypeDescription
reportIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
summaryLinerequired string
revenue MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

orders integer
Example response
{
  "totals": {
    "storeCountReady": 0,
    "totalsByCurrency": [
      {
        "currency": "USD",
        "revenue": {
          "amountMinor": 1248000,
          "currency": "USD"
        },
        "orders": 0
      }
    ]
  },
  "stores": [
    {
      "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
      "name": "name",
      "shopDomain": "cozy-goods.example",
      "status": "ready",
      "latestReady": {
        "reportId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
        "weekStart": "2026-03-09",
        "weekEnd": "2026-03-09",
        "summaryLine": "summaryLine",
        "revenue": {
          "amountMinor": 1248000,
          "currency": "USD"
        },
        "orders": 0
      }
    }
  ]
}

Billing

Create billing checkout redirect

POST/billing/checkout-session Needs sign-in #

Returns an opaque URL. Client must not assume a specific payment vendor.

Parameters

NameWhere and typeDescription
Idempotency-Keyheader · string

Optional. Retries with the same key must not double-create sessions.

max length 255

Responses

Redirect URL

FieldTypeDescription
urlrequired string · uri

Opaque redirect URL

Example response
{
  "url": "https://example.com/"
}

Create billing portal redirect

POST/billing/portal-session Needs sign-in #

Returns an opaque URL for managing payment methods and invoices. An account that has not finished checkout yet has nothing to manage and gets 409 no_subscription.

Parameters

NameWhere and typeDescription
Idempotency-Keyheader · string

Optional. Retries with the same key must not double-create sessions.

max length 255

Responses

Redirect URL

FieldTypeDescription
urlrequired string · uri

Opaque redirect URL

Example response
{
  "url": "https://example.com/"
}

Store

Start store connect flow

GET/shop/connect Needs sign-in #

Returns an opaque authorize URL. Uses signed state server-side (CSRF-proof).

Responses

Authorize URL

FieldTypeDescription
authorizeUrlrequired string · uri
Example response
{
  "authorizeUrl": "https://example.com/"
}

Connect the store from a finished install

POST/shop/claim Needs sign-in #

After the merchant approves access, they land on the app with a single-use token. Signed in, they send it here and the store is connected to the session's account. The account comes from the session, never from the request. The token is spent only when the store is connected: an unknown, expired, or already used token gets the same 422, and a store that another account has connected gets 409 and the token stays good. An account can hold several stores, so a second store is added to the first.

Request body

FieldTypeDescription
tokenrequired string

The token from the link the install ended on.

min length 1 · max length 128

Responses

Store connected

FieldTypeDescription
id string · uuid · nullable

Same id as ShopSummary.id / stores[].id

connectedrequired boolean
shopDomain string · nullable
connectedAt string · date-time · nullable
scopes array of string
Example response
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "connected": true,
  "shopDomain": "cozy-goods.example",
  "connectedAt": "2026-03-09T07:00:00Z",
  "scopes": [
    "scopes"
  ]
}

Current store connection

GET/shop/connection Needs sign-in #

Responses

Connection

FieldTypeDescription
id string · uuid · nullable

Same id as ShopSummary.id / stores[].id

connectedrequired boolean
shopDomain string · nullable
connectedAt string · date-time · nullable
scopes array of string
Example response
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "connected": true,
  "shopDomain": "cozy-goods.example",
  "connectedAt": "2026-03-09T07:00:00Z",
  "scopes": [
    "scopes"
  ]
}

Disconnect a store

DELETE/shop/connection Needs sign-in #

Stops report jobs for the disconnected store, deletes its stored access tokens, and keeps its past reports. An account can hold several stores, so pass shopId to say which one. Without it, the account's first store is disconnected, as before. A shopId that is not one of the session account's stores is a 404, the same as one that does not exist.

Parameters

NameWhere and typeDescription
shopIdquery · string · uuid

Responses

Disconnected

Empty body.

Reports

List weekly packs for the account

GET/reports Needs sign-in #

AuthZ via account membership and shop ownership. Optional shopId filter for drill-in.

Parameters

NameWhere and typeDescription
shopIdquery · string · uuid
limitquery · integer

Sidebar Recent reports uses limit=5.

min 1 · max 100 · default 5

cursorquery · string

Responses

Report list

FieldTypeDescription
itemsrequired array of ReportListItem
Show fields
FieldTypeDescription
idrequired string · uuid
shopIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
statusrequired string
readyfailed
summaryLine string · nullable
createdAtrequired string · date-time
nextCursor string · nullable
Example response
{
  "items": [
    {
      "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
      "shopId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
      "weekStart": "2026-03-09",
      "weekEnd": "2026-03-09",
      "status": "ready",
      "summaryLine": "summaryLine",
      "createdAt": "2026-03-09T07:00:00Z"
    }
  ],
  "nextCursor": "nextCursor"
}

Weekly pack detail

GET/reports/{reportId} Needs sign-in #

Bound to owning account via shop ownership (no IDOR). Sections mirror email: summary → sales → traffic → ops. weekAction is shop-scoped; not included on account overview.

Parameters

NameWhere and typeDescription
reportIdrequiredpath · string · uuid

Responses

Report detail

FieldTypeDescription
idrequired string · uuid
shopIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
statusrequired string
readyfailed
summaryLine string · nullable
weekAction WeekAction

This week's action — verb-led, numeric title + optional why

Show fields
FieldTypeDescription
titlerequired string
detail string · nullable
sku string · nullable
metric string · nullable
salesrequired ReportSales
Show fields
FieldTypeDescription
revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

ordersrequired integer
aovrequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

revenueChangePctrequired number · double
topProductsrequired array of TopProduct
Show fields
FieldTypeDescription
titlerequired string
unitsrequired integer
revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

trafficrequired ReportTraffic
Show fields
FieldTypeDescription
sessionsrequired integer
conversionRaterequired number · double
topChannelsrequired array of TopChannel
Show fields
FieldTypeDescription
namerequired string
sessionsrequired integer
opsrequired ReportOps
Show fields
FieldTypeDescription
unfulfilledOrdersrequired integer
lowStockSkusrequired array of LowStockSku
Show fields
FieldTypeDescription
skurequired string
titlerequired string
availablerequired integer
returnsRatePct number · double · nullable
insightsrequired array of ReportInsight

Findings for the week, most urgent first, at most eight. Empty for a report built before findings existed, and for a week with nothing to say.

Show fields
FieldTypeDescription
kindrequired string
stock_runwayrevenue_driverdead_stockconcentrationreturnsfulfillmentmomentumorder_agingdiscountingproduct_returnsbest_daybundle
severityrequired string

act is do something now, watch is keep an eye on it, win is something went well, tip is a pattern worth using where nothing is wrong.

actwatchwintip
titlerequired string
evidencerequired string
action string · nullable

What to do. Null for a win.

impact MoneyAmount · nullable

A rough estimate of the money involved, when there is a fair one.

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

impactNote string · nullable

What the impact measures, such as "of sales a day at risk".

sku string · nullable
scorecardrequired array of ReportScoreArea

How each area did this week: sales, stock, fulfillment, returns, and product mix. Empty for a report built before the scorecard existed.

Show fields
FieldTypeDescription
arearequired string
salesstockfulfillmentreturnsmix
labelrequired string
graderequired string
strongokwatchact
headlinerequired string
reasonrequired string
narrative string · nullable

A short opening paragraph written by an AI model from this report's own numbers and findings, after a check that every number in it appears in them. Null when the feature is off, when the model could not answer, or when the paragraph did not pass the check. Show it as AI-written, and never instead of the findings, which stand on their own.

pdfUrl string · uri · nullable

Short-lived signed URL or auth-gated proxy path. Never a durable public object URL. Still ownership-bound; never share across accounts.

createdAtrequired string · date-time
Example response
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "shopId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "weekStart": "2026-03-09",
  "weekEnd": "2026-03-09",
  "status": "ready",
  "summaryLine": "summaryLine",
  "weekAction": {
    "title": "Restock X · 8 left",
    "detail": "detail",
    "sku": "sku",
    "metric": "metric"
  },
  "sales": {
    "revenue": {
      "amountMinor": 1248000,
      "currency": "USD"
    },
    "orders": 0,
    "aov": {
      "amountMinor": 1248000,
      "currency": "USD"
    },
    "revenueChangePct": 0,
    "topProducts": [
      {
        "title": "title",
        "units": 0,
        "revenue": {
          "amountMinor": 1248000,
          "currency": "USD"
        }
      }
    ]
  },
  "traffic": {
    "sessions": 0,
    "conversionRate": 0,
    "topChannels": [
      {
        "name": "name",
        "sessions": 0
      }
    ]
  },
  "ops": {
    "unfulfilledOrders": 0,
    "lowStockSkus": [
      {
        "sku": "sku",
        "title": "title",
        "available": 0
      }
    ],
    "returnsRatePct": 0
  },
  "insights": [
    {
      "kind": "stock_runway",
      "severity": "act",
      "title": "Linen throw runs out in about 3 days",
      "evidence": "6 left, selling about 2 a day.",
      "action": "action",
      "impact": {
        "amountMinor": 1248000,
        "currency": "USD"
      },
      "impactNote": "impactNote",
      "sku": "sku"
    }
  ],
  "scorecard": [
    {
      "area": "sales",
      "label": "Stock health",
      "grade": "strong",
      "headline": "1 product running out",
      "reason": "reason"
    }
  ],
  "narrative": "narrative",
  "pdfUrl": "https://example.com/",
  "createdAt": "2026-03-09T07:00:00Z"
}

Models

Error

FieldTypeDescription
errorrequired object
Show fields
FieldTypeDescription
coderequired string
messagerequired string
Example
{
  "error": {
    "code": "not_found",
    "message": "That report was not found."
  }
}

RedirectUrl

FieldTypeDescription
urlrequired string · uri

Opaque redirect URL

Example
{
  "url": "https://example.com/"
}

NotificationSettings

Which emails a person gets.

FieldTypeDescription
reportEmailrequired boolean

Whether the person gets the Monday report email.

addressUndeliverablerequired boolean

True when the mail provider reported the person's address as bouncing for good or as a spam complaint. The Monday email no longer goes to it, whatever reportEmail says. Changing the address in the profile clears it.

Example
{
  "reportEmail": true,
  "addressUndeliverable": true
}

UserProfile

FieldTypeDescription
idrequired string · uuid
emailrequired string · email
emailVerifiedrequired boolean

False until the person opens the emailed confirmation link. Changing the email sets it back to false. The web app shows a notice while it is false.

name string · nullable
accountId string · uuid

Tenant account bound to the session

Example
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "email": "[email protected]",
  "emailVerified": true,
  "name": "name",
  "accountId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40"
}

BillingStatus

FieldTypeDescription
statusrequired string
nonetrialingactivepast_duecanceled
trialEndsAt string · date-time · nullable
currentPeriodEndsAt string · date-time · nullable
Example
{
  "status": "none",
  "trialEndsAt": "2026-03-09T07:00:00Z",
  "currentPeriodEndsAt": "2026-03-09T07:00:00Z"
}

ShopSummary

FieldTypeDescription
id string · uuid · nullable
connectedrequired boolean
shopDomain string · nullable

Store domain for display; not a vendor brand in UI copy

connectedAt string · date-time · nullable
Example
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "connected": true,
  "shopDomain": "cozy-goods.example",
  "connectedAt": "2026-03-09T07:00:00Z"
}

FirstReportStatus

v1: account-scoped on MeStatus.onboarding.firstReport. Phase B: moves under the active shop; do not assume account-scoped forever.

FieldTypeDescription
staterequired string
not_startedqueuedgeneratingreadyfailed
reportId string · uuid · nullable
expectedAt string · date-time · nullable
message string · nullable

Client-safe status/error string only

Example
{
  "state": "not_started",
  "reportId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "expectedAt": "2026-03-09T07:00:00Z",
  "message": "That report was not found."
}

Onboarding

FieldTypeDescription
steprequired string
verify_emailbillingconnect_shopwaiting_first_reportcomplete
firstReportrequired FirstReportStatus

v1: account-scoped on MeStatus.onboarding.firstReport. Phase B: moves under the active shop; do not assume account-scoped forever.

Show fields
FieldTypeDescription
staterequired string
not_startedqueuedgeneratingreadyfailed
reportId string · uuid · nullable
expectedAt string · date-time · nullable
message string · nullable

Client-safe status/error string only

Example
{
  "step": "verify_email",
  "firstReport": {
    "state": "not_started",
    "reportId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
    "expectedAt": "2026-03-09T07:00:00Z",
    "message": "That report was not found."
  }
}

MeStatus

FieldTypeDescription
accountIdrequired string · uuid

Tenant account for this session (same as UserProfile.accountId)

emailrequired string · email
emailVerifiedrequired boolean
billingrequired BillingStatus
Show fields
FieldTypeDescription
statusrequired string
nonetrialingactivepast_duecanceled
trialEndsAt string · date-time · nullable
currentPeriodEndsAt string · date-time · nullable
shoprequired ShopSummary
Show fields
FieldTypeDescription
id string · uuid · nullable
connectedrequired boolean
shopDomain string · nullable

Store domain for display; not a vendor brand in UI copy

connectedAt string · date-time · nullable
onboardingrequired Onboarding
Show fields
FieldTypeDescription
steprequired string
verify_emailbillingconnect_shopwaiting_first_reportcomplete
firstReportrequired FirstReportStatus

v1: account-scoped on MeStatus.onboarding.firstReport. Phase B: moves under the active shop; do not assume account-scoped forever.

Show fields
FieldTypeDescription
staterequired string
not_startedqueuedgeneratingreadyfailed
reportId string · uuid · nullable
expectedAt string · date-time · nullable
message string · nullable

Client-safe status/error string only

Example
{
  "accountId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "email": "[email protected]",
  "emailVerified": true,
  "billing": {
    "status": "none",
    "trialEndsAt": "2026-03-09T07:00:00Z",
    "currentPeriodEndsAt": "2026-03-09T07:00:00Z"
  },
  "shop": {
    "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
    "connected": true,
    "shopDomain": "cozy-goods.example",
    "connectedAt": "2026-03-09T07:00:00Z"
  },
  "onboarding": {
    "step": "verify_email",
    "firstReport": {
      "state": "not_started",
      "reportId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
      "expectedAt": "2026-03-09T07:00:00Z",
      "message": "That report was not found."
    }
  }
}

ShopConnection

FieldTypeDescription
id string · uuid · nullable

Same id as ShopSummary.id / stores[].id

connectedrequired boolean
shopDomain string · nullable
connectedAt string · date-time · nullable
scopes array of string
Example
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "connected": true,
  "shopDomain": "cozy-goods.example",
  "connectedAt": "2026-03-09T07:00:00Z",
  "scopes": [
    "scopes"
  ]
}

MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

Example
{
  "amountMinor": 1248000,
  "currency": "USD"
}

TopProduct

FieldTypeDescription
titlerequired string
unitsrequired integer
revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

Example
{
  "title": "title",
  "units": 0,
  "revenue": {
    "amountMinor": 1248000,
    "currency": "USD"
  }
}

TopChannel

FieldTypeDescription
namerequired string
sessionsrequired integer
Example
{
  "name": "name",
  "sessions": 0
}

LowStockSku

FieldTypeDescription
skurequired string
titlerequired string
availablerequired integer
Example
{
  "sku": "sku",
  "title": "title",
  "available": 0
}

WeekAction

This week's action — verb-led, numeric title + optional why

FieldTypeDescription
titlerequired string
detail string · nullable
sku string · nullable
metric string · nullable
Example
{
  "title": "Restock X · 8 left",
  "detail": "detail",
  "sku": "sku",
  "metric": "metric"
}

ReportInsight

One finding about the week: what was found, the numbers behind it, and what to do. It is worked out from the store's own order and stock numbers, never from customer details. Findings come most urgent first.

FieldTypeDescription
kindrequired string
stock_runwayrevenue_driverdead_stockconcentrationreturnsfulfillmentmomentumorder_agingdiscountingproduct_returnsbest_daybundle
severityrequired string

act is do something now, watch is keep an eye on it, win is something went well, tip is a pattern worth using where nothing is wrong.

actwatchwintip
titlerequired string
evidencerequired string
action string · nullable

What to do. Null for a win.

impact MoneyAmount · nullable

A rough estimate of the money involved, when there is a fair one.

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

impactNote string · nullable

What the impact measures, such as "of sales a day at risk".

sku string · nullable
Example
{
  "kind": "stock_runway",
  "severity": "act",
  "title": "Linen throw runs out in about 3 days",
  "evidence": "6 left, selling about 2 a day.",
  "action": "action",
  "impact": {
    "amountMinor": 1248000,
    "currency": "USD"
  },
  "impactNote": "impactNote",
  "sku": "sku"
}

ReportScoreArea

One line of the scorecard, graded for the week.

FieldTypeDescription
arearequired string
salesstockfulfillmentreturnsmix
labelrequired string
graderequired string
strongokwatchact
headlinerequired string
reasonrequired string
Example
{
  "area": "sales",
  "label": "Stock health",
  "grade": "strong",
  "headline": "1 product running out",
  "reason": "reason"
}

ReportListItem

FieldTypeDescription
idrequired string · uuid
shopIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
statusrequired string
readyfailed
summaryLine string · nullable
createdAtrequired string · date-time
Example
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "shopId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "weekStart": "2026-03-09",
  "weekEnd": "2026-03-09",
  "status": "ready",
  "summaryLine": "summaryLine",
  "createdAt": "2026-03-09T07:00:00Z"
}

ReportList

FieldTypeDescription
itemsrequired array of ReportListItem
Show fields
FieldTypeDescription
idrequired string · uuid
shopIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
statusrequired string
readyfailed
summaryLine string · nullable
createdAtrequired string · date-time
nextCursor string · nullable
Example
{
  "items": [
    {
      "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
      "shopId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
      "weekStart": "2026-03-09",
      "weekEnd": "2026-03-09",
      "status": "ready",
      "summaryLine": "summaryLine",
      "createdAt": "2026-03-09T07:00:00Z"
    }
  ],
  "nextCursor": "nextCursor"
}

ReportSales

FieldTypeDescription
revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

ordersrequired integer
aovrequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

revenueChangePctrequired number · double
topProductsrequired array of TopProduct
Show fields
FieldTypeDescription
titlerequired string
unitsrequired integer
revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

Example
{
  "revenue": {
    "amountMinor": 1248000,
    "currency": "USD"
  },
  "orders": 0,
  "aov": {
    "amountMinor": 1248000,
    "currency": "USD"
  },
  "revenueChangePct": 0,
  "topProducts": [
    {
      "title": "title",
      "units": 0,
      "revenue": {
        "amountMinor": 1248000,
        "currency": "USD"
      }
    }
  ]
}

ReportTraffic

FieldTypeDescription
sessionsrequired integer
conversionRaterequired number · double
topChannelsrequired array of TopChannel
Show fields
FieldTypeDescription
namerequired string
sessionsrequired integer
Example
{
  "sessions": 0,
  "conversionRate": 0,
  "topChannels": [
    {
      "name": "name",
      "sessions": 0
    }
  ]
}

ReportOps

FieldTypeDescription
unfulfilledOrdersrequired integer
lowStockSkusrequired array of LowStockSku
Show fields
FieldTypeDescription
skurequired string
titlerequired string
availablerequired integer
returnsRatePct number · double · nullable
Example
{
  "unfulfilledOrders": 0,
  "lowStockSkus": [
    {
      "sku": "sku",
      "title": "title",
      "available": 0
    }
  ],
  "returnsRatePct": 0
}

ReportDetail

FieldTypeDescription
idrequired string · uuid
shopIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
statusrequired string
readyfailed
summaryLine string · nullable
weekAction WeekAction

This week's action — verb-led, numeric title + optional why

Show fields
FieldTypeDescription
titlerequired string
detail string · nullable
sku string · nullable
metric string · nullable
salesrequired ReportSales
Show fields
FieldTypeDescription
revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

ordersrequired integer
aovrequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

revenueChangePctrequired number · double
topProductsrequired array of TopProduct
Show fields
FieldTypeDescription
titlerequired string
unitsrequired integer
revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

trafficrequired ReportTraffic
Show fields
FieldTypeDescription
sessionsrequired integer
conversionRaterequired number · double
topChannelsrequired array of TopChannel
Show fields
FieldTypeDescription
namerequired string
sessionsrequired integer
opsrequired ReportOps
Show fields
FieldTypeDescription
unfulfilledOrdersrequired integer
lowStockSkusrequired array of LowStockSku
Show fields
FieldTypeDescription
skurequired string
titlerequired string
availablerequired integer
returnsRatePct number · double · nullable
insightsrequired array of ReportInsight

Findings for the week, most urgent first, at most eight. Empty for a report built before findings existed, and for a week with nothing to say.

Show fields
FieldTypeDescription
kindrequired string
stock_runwayrevenue_driverdead_stockconcentrationreturnsfulfillmentmomentumorder_agingdiscountingproduct_returnsbest_daybundle
severityrequired string

act is do something now, watch is keep an eye on it, win is something went well, tip is a pattern worth using where nothing is wrong.

actwatchwintip
titlerequired string
evidencerequired string
action string · nullable

What to do. Null for a win.

impact MoneyAmount · nullable

A rough estimate of the money involved, when there is a fair one.

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

impactNote string · nullable

What the impact measures, such as "of sales a day at risk".

sku string · nullable
scorecardrequired array of ReportScoreArea

How each area did this week: sales, stock, fulfillment, returns, and product mix. Empty for a report built before the scorecard existed.

Show fields
FieldTypeDescription
arearequired string
salesstockfulfillmentreturnsmix
labelrequired string
graderequired string
strongokwatchact
headlinerequired string
reasonrequired string
narrative string · nullable

A short opening paragraph written by an AI model from this report's own numbers and findings, after a check that every number in it appears in them. Null when the feature is off, when the model could not answer, or when the paragraph did not pass the check. Show it as AI-written, and never instead of the findings, which stand on their own.

pdfUrl string · uri · nullable

Short-lived signed URL or auth-gated proxy path. Never a durable public object URL. Still ownership-bound; never share across accounts.

createdAtrequired string · date-time
Example
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "shopId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "weekStart": "2026-03-09",
  "weekEnd": "2026-03-09",
  "status": "ready",
  "summaryLine": "summaryLine",
  "weekAction": {
    "title": "Restock X · 8 left",
    "detail": "detail",
    "sku": "sku",
    "metric": "metric"
  },
  "sales": {
    "revenue": {
      "amountMinor": 1248000,
      "currency": "USD"
    },
    "orders": 0,
    "aov": {
      "amountMinor": 1248000,
      "currency": "USD"
    },
    "revenueChangePct": 0,
    "topProducts": [
      {
        "title": "title",
        "units": 0,
        "revenue": {
          "amountMinor": 1248000,
          "currency": "USD"
        }
      }
    ]
  },
  "traffic": {
    "sessions": 0,
    "conversionRate": 0,
    "topChannels": [
      {
        "name": "name",
        "sessions": 0
      }
    ]
  },
  "ops": {
    "unfulfilledOrders": 0,
    "lowStockSkus": [
      {
        "sku": "sku",
        "title": "title",
        "available": 0
      }
    ],
    "returnsRatePct": 0
  },
  "insights": [
    {
      "kind": "stock_runway",
      "severity": "act",
      "title": "Linen throw runs out in about 3 days",
      "evidence": "6 left, selling about 2 a day.",
      "action": "action",
      "impact": {
        "amountMinor": 1248000,
        "currency": "USD"
      },
      "impactNote": "impactNote",
      "sku": "sku"
    }
  ],
  "scorecard": [
    {
      "area": "sales",
      "label": "Stock health",
      "grade": "strong",
      "headline": "1 product running out",
      "reason": "reason"
    }
  ],
  "narrative": "narrative",
  "pdfUrl": "https://example.com/",
  "createdAt": "2026-03-09T07:00:00Z"
}

StoreLatestReady

FieldTypeDescription
reportIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
summaryLinerequired string
revenue MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

orders integer
Example
{
  "reportId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "weekStart": "2026-03-09",
  "weekEnd": "2026-03-09",
  "summaryLine": "summaryLine",
  "revenue": {
    "amountMinor": 1248000,
    "currency": "USD"
  },
  "orders": 0
}

StoreOverviewItem

FieldTypeDescription
idrequired string · uuid
namerequired string

Customer-facing store name

shopDomain string · nullable

Store domain for display

statusrequired string
readywaitingfaileddisconnected
latestReady StoreLatestReady · nullable
Show fields
FieldTypeDescription
reportIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
summaryLinerequired string
revenue MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

orders integer
Example
{
  "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
  "name": "name",
  "shopDomain": "cozy-goods.example",
  "status": "ready",
  "latestReady": {
    "reportId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
    "weekStart": "2026-03-09",
    "weekEnd": "2026-03-09",
    "summaryLine": "summaryLine",
    "revenue": {
      "amountMinor": 1248000,
      "currency": "USD"
    },
    "orders": 0
  }
}

CurrencyTotals

FieldTypeDescription
currencyrequired string

ISO 4217

min length 3 · max length 3

revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

ordersrequired integer
Example
{
  "currency": "USD",
  "revenue": {
    "amountMinor": 1248000,
    "currency": "USD"
  },
  "orders": 0
}

AccountOverviewTotals

No single cross-currency revenue sum. Roll up per currency only.

FieldTypeDescription
storeCountReadyrequired integer
totalsByCurrencyrequired array of CurrencyTotals
Show fields
FieldTypeDescription
currencyrequired string

ISO 4217

min length 3 · max length 3

revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

ordersrequired integer
Example
{
  "storeCountReady": 0,
  "totalsByCurrency": [
    {
      "currency": "USD",
      "revenue": {
        "amountMinor": 1248000,
        "currency": "USD"
      },
      "orders": 0
    }
  ]
}

AccountOverview

FieldTypeDescription
totalsrequired AccountOverviewTotals

No single cross-currency revenue sum. Roll up per currency only.

Show fields
FieldTypeDescription
storeCountReadyrequired integer
totalsByCurrencyrequired array of CurrencyTotals
Show fields
FieldTypeDescription
currencyrequired string

ISO 4217

min length 3 · max length 3

revenuerequired MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

ordersrequired integer
storesrequired array of StoreOverviewItem
Show fields
FieldTypeDescription
idrequired string · uuid
namerequired string

Customer-facing store name

shopDomain string · nullable

Store domain for display

statusrequired string
readywaitingfaileddisconnected
latestReady StoreLatestReady · nullable
Show fields
FieldTypeDescription
reportIdrequired string · uuid
weekStartrequired string · date
weekEndrequired string · date
summaryLinerequired string
revenue MoneyAmount

Integer minor units + ISO 4217 currency (no floating-point money)

Show fields
FieldTypeDescription
amountMinorrequired integer · int64

Amount in the currency's minor units (e.g. cents)

currencyrequired string

ISO 4217 currency code

min length 3 · max length 3

orders integer
Example
{
  "totals": {
    "storeCountReady": 0,
    "totalsByCurrency": [
      {
        "currency": "USD",
        "revenue": {
          "amountMinor": 1248000,
          "currency": "USD"
        },
        "orders": 0
      }
    ]
  },
  "stores": [
    {
      "id": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
      "name": "name",
      "shopDomain": "cozy-goods.example",
      "status": "ready",
      "latestReady": {
        "reportId": "3f2b1c0e-8a54-4d7e-9a61-5c1d2e7b9f40",
        "weekStart": "2026-03-09",
        "weekEnd": "2026-03-09",
        "summaryLine": "summaryLine",
        "revenue": {
          "amountMinor": 1248000,
          "currency": "USD"
        },
        "orders": 0
      }
    }
  ]
}