Skip to main content

Data Model Overview

This section gives the entity model per store and the key API surface. It follows the polyglot ownership rules: each fact has one owner; domains reference Medusa by ID + snapshot.

Context map​

Ownership quick reference​

EntityStoreOwnerKey refs
Product / Variant / KitPGMedusa—
Price / PriceListPGMedusaproduct
Cart / OrderPGMedusacustomer
PromotionPGMedusa—
Inventory / ReservationPGMedusavariant, location
Payment sessionPGMedusaorder
Invoice / Ledger / PayoutPGFinanceorderId, partnerId
AssetMongoWarrantymedusaProductId, ownerId, serial
WarrantyClaimMongoWarrantyassetId
ServiceTicket / JobMongoFSMassetId, medusaOrderId, technicianId
AMCContractMongoFSMassetId, customerId
ChannelPartnerMongoDMSterritory, tier
PointsLedgerMongoLoyaltycustomerId/partnerId
Customer360MongoCRMmedusaCustomerId
Content (post/testimonial…)MongoPayload—
TenantConfig / AutomationSub / AuditLogMongoPlatformtenantId

ID conventions​

  • Internal: UUID v7 (time-ordered) everywhere.
  • Public/human: nanoid base32 short ID for assets/warranty/"My Products" and ticket numbers.
  • Cross-store refs: store the Medusa ID (medusaOrderId, etc.) and a denormalized snapshot of needed fields.

Per-store detail pages​

Schemas below are design sketches (TypeScript-ish), not final migrations. They establish shape, ownership, and references.