MMecsto developers

Docs SDK View models

View models

The typed shapes loaders and hooks return. These are deliberately not database rows — they are a stable surface the platform maintains across schema changes.

Generated from the SDK’s type definitions. Fields shown are the top-level ones.

AccountPages

the prop contracts for THEME-AUTHORED account-area page bodies (login, account, orders, order detail, subscriptions, addresses).

storeName: string
initialEmail: string
sendCode: (email: string) => Promise<void>
verifyCode: (email: string, code: string) => Promise<void>
name: string
phone: string
email: string
profile: AccountProfile | null
saveProfile: (patch: AccountProfile) => Promise<void>
maxLengths: { name: number
orders: Order[]
coinName: string | null
timezone: string
orderHref: (order: Order) => string
+26 more
Address

one entry from the customers.addresses JSONB array.

id: string
label: string | null
line1: string
line2: string | null
city: string | null
state: string | null
postalCode: string | null
country: string | null
isDefault: boolean
AuthContext

the resolved customer identity.

userId: string
customerId: string | null
authEmail: string
BrandCustomization

the merchant's brand-side customization (the platform-mandated floor per MECSTO_THEME_CONTRACT §3.2).

primary: string
markOnly: string | null
light: string | null
dark: string | null
email: string | null
phone: string | null
address: string | null
socialLinks: Record<string, string>
logo: LogoAsset | null
brandName: string | null
brandPrimaryColor: string | null
brandSecondaryColor: string | null
favicon: string | null
socialShareImage: string | null
+1 more
Category

taxonomy used to group listings.

id: string
slug: string
name: string
description: string | null
CheckoutIntent

input to `useCheckoutInit`.

email: string
name: string
phone: string
name: string
gstin: string
pan: string
line1: string
line2: string
city: string
state: string
postalCode: string
country: string
storeId: string
listingId: string
+20 more
Content

generic content entries (rich HTML pages, articles).

id: string
slug: string
title: string
body: string
publishedAt: string | null
updatedAt: string
ContentViews

Content view-models — the canonical shapes the sites-* content endpoints emit (MECSTO_SITES_PUBLIC_VIEW_MODELS.md §3.5–3.15).

url: string
alt: string | null
id: string
question: string
answerHtml: string
sortOrder: number
group: string | null
id: string
customerName: string
customerLogo: SdkImage | null
quote: string
rating: number | null
sortOrder: number
id: string
+26 more
CustomerProfile

the signed-in customer's view-model.

id: string
email: string
name: string | null
phone: string | null
addresses: Address[]
EditableField

the shape of a manifest-declared editable field, plus the resolved value type used at render time.

type: EditableFieldType
default: unknown
max_length: number
aspect_ratio: string
item_schema: Record<string, ItemSchemaValue>
options: string[]
label: string
group: string
page: string
description: string
Listing

a sellable item (bookable service, digital product, or project).

dbMode: string | null | undefined, ): ListingSubscriptionMode { const map: Record<string, ListingSubscriptionMode> = { none: "one_time", only: "subscription", both: "both", }
id: string
slug: string
title: string
description: string | null
kind: ListingKind
priceMinor: number
currency: string
subscriptionPriceMinor: number | null
subscriptionMode: ListingSubscriptionMode
media: string[]
categoryIds: string[]
gracePeriodMinutes: number | null
recurring: ListingRecurring | null
+19 more
Loyalty

the customer's balance for the tenant's program.

balance: number
coinName: string
MerchantModel

the resolved business-concept SINGLETONS a renderer composes (mec/mbrain/ARCH_MERCHANT_MODEL_V1.md v3).

catalogVersion: string
concepts: Record<string, ConceptData>
identity: Record<string, ConceptData>
marketing: Record<string, ConceptData>
Order

customer-facing receipt view.

orderNumber: string
status: OrderStatus
amountMinor: number
currency: string
createdAt: string
confirmedAt: string | null
scheduledAt: string | null
listingSnapshot: Record<string, unknown>
storeSnapshot: Record<string, unknown>
loyaltyCoinsEarned: number
loyaltyCoinsRedeemed: number
customerEmail: string
customerNote: string | null
Promotion

preview of a discount applied to a base amount.

promotionId: string | null
discountMinor: number
finalAmountMinor: number
codeApplied: string | null
errorCode: string | null
reason: string | null
Store

the tenant's full public view.

logoUrl: string | null
faviconUrl: string | null
primaryColor: string | null
accentColor: string | null
buttonStyle: StoreButtonStyle | null
email: string | null
phone: string | null
address: string | null
language: string
currency: string
localeString: string
platform: string
url: string
title: string | null
+26 more
Subscription

customer's recurring purchase view.

id: string
scheduledFor: string
id: string
state: SubscriptionState
nextCycleAt: string | null
cyclesCompleted: number
cyclesFailed: number
createdAt: string
listingSnapshot: Record<string, unknown>
nextCycle: SubscriptionCycle | null
TeamProfile

a person on the merchant's team.

id: string
name: string
role: string | null
bio: string | null
headshotUrl: string | null
sortOrder: number
TenantContext

minimal identity record for the resolved tenant.

tenantUuid: string
slug: string
displayName: string
themeKey: string | null
storefrontThemeId: string | null
host: string
Tokens

the shape of a resolved TokenSet themes consume at render time.

text: string
surface: string
border: string
brandPrimary: string
brandPrimaryHover: string
brandPrimaryActive: string
brandPrimaryLight: string
brandPrimaryLighter: string
brandPrimaryDark: string
brandPrimaryDarker: string
brandSecondary: string | null
surfaceBase: string
surfaceElevated: string
surfaceAccent: string
+26 more