Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Make the seller panel's setup checklist actionable
Damian Legawiec9b27d96026b0
diff --git a/packages/dashboard-core/src/api-client.ts b/packages/dashboard-core/src/api-client.tsindex 1452bf296a..47788d5941 100644--- a/packages/dashboard-core/src/api-client.ts+++ b/packages/dashboard-core/src/api-client.ts@@ -58,6 +58,30 @@ export interface PanelApiClient {* and keys, the seller `/me` returns keys scoped to the selected seller.*/fetchPermissions(): Promise<PanelPermissions>+ /**+ * Countries (with their states) for the shared address form.+ *+ * Registered rather than imported, for the same reason as everything else+ * here: reaching for `adminClient` would make the one address form work+ * only in the operator's panel, and a seller filling in a billing address+ * would get an empty country list.+ */+ listCountries?(): Promise<{ data: PanelCountry[] }>+}++/**+ * A country as the address form needs it. Structural, not the Admin SDK's+ * `Country`: both panels' country endpoints answer this shape, and typing+ * the wider one here would bind core to a package a seller's panel does not+ * install.+ */+export interface PanelCountry {+ iso: string+ iso3: string+ name: string+ states_required?: boolean+ zipcode_required?: boolean+ states?: Array<{ abbr: string; name: string }>}/** What a sign-in returns, whichever panel asked. */diff --git a/packages/dashboard-core/src/components/address-form-dialog.tsx b/packages/dashboard-core/src/components/address-form-dialog.tsxindex 99e8c87804..5510563d18 100644--- a/packages/dashboard-core/src/components/address-form-dialog.tsx+++ b/packages/dashboard-core/src/components/address-form-dialog.tsx@@ -1,5 +1,4 @@import { zodResolver } from '@hookform/resolvers/zod'-import type { Address } from '@spree/admin-sdk'import {Button,Checkbox,@@ -74,7 +73,32 @@ const addressFormSchema = z.object({type AddressFormValues = z.infer<typeof addressFormSchema>-function buildDefaults(address: Address | null | undefined): AddressFormValues {+/**+ * Just the fields this dialog reads.+ *+ * Structural rather than the Admin SDK's `Address`, which carries operator+ * data (metadata, customer_id, timestamps) that a seller's serializer+ * deliberately withholds — binding core to the wider type would stop the+ * seller panel from reusing the one address form.+ */+export interface EditableAddress {+ /** Re-seeds the form when the dialog is pointed at a different address. */+ id?: string+ first_name?: string | null+ last_name?: string | null+ address1?: string | null+ address2?: string | null+ city?: string | null+ postal_code?: string | null+ country_code?: string | null+ state_code?: string | null+ phone?: string | null+ label?: string | null+ is_default_billing?: boolean | null+ is_default_shipping?: boolean | null+}++function buildDefaults(address: EditableAddress | null | undefined): AddressFormValues {return {first_name: address?.first_name ?? '',last_name: address?.last_name ?? '',@@ -101,7 +125,7 @@ export function AddressFormDialog({showLabel = false,showDefaultFlags = false,}: {- address: Address | null | undefined+ address: EditableAddress | null | undefinedopen: booleanonOpenChange: (open: boolean) => voidonSave: (address: AddressParams) => void | Promise<void>diff --git a/packages/dashboard-core/src/hooks/use-countries.ts b/packages/dashboard-core/src/hooks/use-countries.tsindex c5dfc0661a..bebe5acdb7 100644--- a/packages/dashboard-core/src/hooks/use-countries.ts+++ b/packages/dashboard-core/src/hooks/use-countries.ts@@ -1,15 +1,22 @@-import type { Country } from '@spree/admin-sdk'import { useQuery } from '@tanstack/react-query'-import { adminClient } from '../client'+import { getApiClient, type PanelCountry } from '../api-client'+/**+ * Countries for the shared address form, through the registered panel client.+ *+ * Deliberately not `adminClient`: this hook backs the one address form both+ * panels use, and importing the operator's client made a seller's country+ * list come back empty — the form rendered, and "No countries found" was the+ * only symptom.+ */export function useCountries() {const { data, isLoading } = useQuery({queryKey: ['countries'],- queryFn: () => adminClient.countries.list({ expand: ['states'] }),+ queryFn: () => getApiClient().listCountries?.() ?? Promise.resolve({ data: [] }),staleTime: 1000 * 60 * 30, // 30 minutes — countries rarely change})- const countries: Country[] = data?.data ?? []+ const countries: PanelCountry[] = data?.data ?? []return { countries, isLoading }}diff --git a/packages/dashboard/src/api-client-setup.ts b/packages/dashboard/src/api-client-setup.tsindex b02185f4cd..216f985bd9 100644--- a/packages/dashboard/src/api-client-setup.ts+++ b/packages/dashboard/src/api-client-setup.ts@@ -18,4 +18,5 @@ setApiClient({return { rules: response.permissions, keys: response.permission_keys ?? [] }},+ listCountries: () => adminClient.countries.list({ expand: ['states'] }),})diff --git a/packages/seller-dashboard-starter/src/routeTree.gen.ts b/packages/seller-dashboard-starter/src/routeTree.gen.tsindex cd105dc73a..db88cb3b60 100644--- a/packages/seller-dashboard-starter/src/routeTree.gen.ts+++ b/packages/seller-dashboard-starter/src/routeTree.gen.ts@@ -16,6 +16,7 @@ import { Route as acceptInvitationDotinvitationIdRouteImport } from './../../selimport { Route as authenticatedSellerIdRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId'import { Route as IndexRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/index'import { Route as TeamRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/team'+import { Route as ProfileRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/profile'import { Route as OnboardingRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/onboarding'const loginRoute = loginRouteImport.update({@@ -53,6 +54,11 @@ const TeamRoute = TeamRouteImport.update({path: '/team',getParentRoute: () => authenticatedSellerIdRoute,} as any)+const ProfileRoute = ProfileRouteImport.update({+ id: '/profile',+ path: '/profile',+ getParentRoute: () => authenticatedSellerIdRoute,+} as any)const OnboardingRoute = OnboardingRouteImport.update({id: '/onboarding',path: '/onboarding',@@ -65,6 +71,7 @@ export interface FileRoutesByFullPath {'/$sellerId': typeof authenticatedSellerIdRouteWithChildren'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute'/$sellerId/onboarding': typeof OnboardingRoute+ '/$sellerId/profile': typeof ProfileRoute'/$sellerId/team': typeof TeamRoute'/$sellerId/': typeof IndexRoute}@@ -73,6 +80,7 @@ export interface FileRoutesByTo {'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute'/': typeof authenticatedIndexRoute'/$sellerId/onboarding': typeof OnboardingRoute+ '/$sellerId/profile': typeof ProfileRoute'/$sellerId/team': typeof TeamRoute'/$sellerId': typeof IndexRoute}@@ -84,6 +92,7 @@ export interface FileRoutesById {'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute'/_authenticated/': typeof authenticatedIndexRoute'/_authenticated/$sellerId/onboarding': typeof OnboardingRoute+ '/_authenticated/$sellerId/profile': typeof ProfileRoute'/_authenticated/$sellerId/team': typeof TeamRoute'/_authenticated/$sellerId/': typeof IndexRoute}@@ -95,6 +104,7 @@ export interface FileRouteTypes {| '/$sellerId'| '/accept-invitation/$invitationId'| '/$sellerId/onboarding'+ | '/$sellerId/profile'| '/$sellerId/team'| '/$sellerId/'fileRoutesByTo: FileRoutesByTo@@ -103,6 +113,7 @@ export interface FileRouteTypes {| '/accept-invitation/$invitationId'| '/'| '/$sellerId/onboarding'+ | '/$sellerId/profile'| '/$sellerId/team'| '/$sellerId'id:@@ -113,6 +124,7 @@ export interface FileRouteTypes {| '/accept-invitation/$invitationId'| '/_authenticated/'| '/_authenticated/$sellerId/onboarding'+ | '/_authenticated/$sellerId/profile'| '/_authenticated/$sellerId/team'| '/_authenticated/$sellerId/'fileRoutesById: FileRoutesById@@ -174,6 +186,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof TeamRouteImportparentRoute: typeof authenticatedSellerIdRoute}+ '/_authenticated/$sellerId/profile': {+ id: '/_authenticated/$sellerId/profile'+ path: '/profile'+ fullPath: '/$sellerId/profile'+ preLoaderRoute: typeof ProfileRouteImport+ parentRoute: typeof authenticatedSellerIdRoute+ }'/_authenticated/$sellerId/onboarding': {id: '/_authenticated/$sellerId/onboarding'path: '/onboarding'@@ -186,12 +205,14 @@ declare module '@tanstack/react-router' {interface authenticatedSellerIdRouteChildren {OnboardingRoute: typeof OnboardingRoute+ ProfileRoute: typeof ProfileRouteTeamRoute: typeof TeamRouteIndexRoute: typeof IndexRoute}const authenticatedSellerIdRouteChildren: authenticatedSellerIdRouteChildren = {OnboardingRoute: OnboardingRoute,+ ProfileRoute: ProfileRoute,TeamRoute: TeamRoute,IndexRoute: IndexRoute,}diff --git a/packages/seller-dashboard/src/api-client.ts b/packages/seller-dashboard/src/api-client.tsindex bb880476d4..b7caa14ec9 100644--- a/packages/seller-dashboard/src/api-client.ts+++ b/packages/seller-dashboard/src/api-client.ts@@ -52,6 +52,9 @@ export function createSellerApiClient({// did) left every `<Can>` on the panel answering false — silently.return { rules: response.permissions ?? [], keys: response.permission_keys ?? [] }},+ // The shared address form reads countries through the registered client,+ // so it works in a panel that has no admin credential.+ listCountries: () => sellerClient().countries.list(),})return clientdiff --git a/packages/seller-dashboard/src/components/seller-address-card.tsx b/packages/seller-dashboard/src/components/seller-address-card.tsxnew file mode 100644index 0000000000..19868fbbaa--- /dev/null+++ b/packages/seller-dashboard/src/components/seller-address-card.tsx@@ -0,0 +1,117 @@+import { AddressFormDialog } from '@spree/dashboard-core'+import {+ AddressBlock,+ Badge,+ Button,+ Card,+ CardAction,+ CardContent,+ CardHeader,+ CardTitle,+} from '@spree/dashboard-ui'+import type { Profile } from '@spree/seller-sdk'+import { useMutation, useQueryClient } from '@tanstack/react-query'+import { useParams } from '@tanstack/react-router'+import { PencilIcon, PlusIcon } from 'lucide-react'+import { useState } from 'react'+import { useTranslation } from 'react-i18next'+import { toast } from 'sonner'+import { sellerClient } from '../api-client'++export type SellerAddressKey = 'billing_address' | 'returns_address'++/**+ * One of the seller's two addresses — where they are invoiced, and where+ * customer returns go — read as a block, edited in the shared address dialog.+ *+ * Used both on the profile page and inline in the onboarding checklist, so a+ * seller working through setup fills the address where they are told about+ * it rather than being sent somewhere else and losing their place. Same+ * component either way, so the two can never diverge.+ */+export function SellerAddressCard({+ profile,+ addressKey,+ headless = false,+}: {+ profile: Profile+ addressKey: SellerAddressKey+ /** Render just the body — the onboarding checklist supplies its own frame. */+ headless?: boolean+}) {+ const { t } = useTranslation()+ const { sellerId } = useParams({ from: '/_authenticated/$sellerId' })+ const queryClient = useQueryClient()+ const [editing, setEditing] = useState(false)++ const address = profile[addressKey]+ const title = t(`profile.${addressKey}`)++ const save = useMutation({+ // Only the address being edited is sent: the other is untouched, and+ // posting both would rewrite a record the seller never opened.+ mutationFn: (values: unknown) => sellerClient().profile.update({ [addressKey]: values }),+ onSuccess: (updated) => {+ queryClient.setQueryData(['seller', sellerId, 'profile'], updated)+ // The checklist reads addresses too, so it has to re-evaluate.+ void queryClient.invalidateQueries({ queryKey: ['seller', sellerId, 'onboarding'] })+ setEditing(false)+ toast.success(t('profile.saved'))+ },+ onError: (err) => toast.error(err instanceof Error ? err.message : t('common.error')),+ })++ const body = address ? (+ <AddressBlock address={address} />+ ) : (+ <p className="text-muted-foreground text-sm">{t('profile.address_not_provided')}</p>+ )++ const editButton = (+ <Button variant={address ? 'outline' : 'default'} size="sm" onClick={() => setEditing(true)}>+ {address ? <PencilIcon className="size-4" /> : <PlusIcon className="size-4" />}+ {address ? t('profile.edit') : t('profile.add_address')}+ </Button>+ )++ const dialog = editing && (+ <AddressFormDialog+ title={title}+ address={address}+ open+ onOpenChange={setEditing}+ onSave={(values) => save.mutate(values)}+ isPending={save.isPending}+ />+ )++ if (headless) {+ return (+ <div className="flex flex-col items-start gap-3">+ {body}+ {editButton}+ {dialog}+ </div>+ )+ }++ return (+ <>+ <Card>+ <CardHeader>+ <CardTitle>+ {title}+ {address ? (+ <Badge variant="success">{t('profile.address_filled')}</Badge>+ ) : (+ <Badge variant="outline">{t('profile.address_missing')}</Badge>+ )}+ </CardTitle>+ <CardAction>{editButton}</CardAction>+ </CardHeader>+ <CardContent>{body}</CardContent>+ </Card>+ {dialog}+ </>+ )+}diff --git a/packages/seller-dashboard/src/locales/en.json b/packages/seller-dashboard/src/locales/en.jsonindex 67b8059468..74c005d63d 100644--- a/packages/seller-dashboard/src/locales/en.json+++ b/packages/seller-dashboard/src/locales/en.json@@ -34,13 +34,27 @@"label": "Switch seller"},"nav": {+ "home": "Home","profile": "Profile","team": "Team","sign_out": "Sign out",- "onboarding": "Getting set up"+ "onboarding": "Setup"+ },+ "home": {+ "title": "Hello, {{name}}",+ "subtitle": "How you stand with this marketplace.",+ "setup_title": "Finish setting up",+ "setup_description": "{{done}} of {{total}} done — complete these to start selling.",+ "setup_cta": "Continue setup",+ "status": "Status",+ "products": "Products",+ "team": "Team members",+ "selling_title": "Selling",+ "selling_yes": "Your products are on sale.",+ "selling_no": "Your products are not on sale yet."},"onboarding": {- "title": "Getting set up",+ "title": "Setup","subtitle": "What this marketplace asks for before you can start selling.","progress_title": "Your progress","progress_count": "{{done}} of {{total}} done",@@ -64,7 +78,8 @@"complete": "Done","pending": "In review","rejected": "Needs another look"- }+ },+ "read_terms": "Read the terms"},"profile": {"subtitle": "How your storefront presents you, and how the marketplace reaches you.",@@ -100,7 +115,13 @@"suspended": "Selling is paused. Contact the marketplace to find out more.","rejected": "Your application was not accepted. Contact the marketplace to find out more.","canceled": "This seller account is closed."- }+ },+ "billing_address": "Billing address",+ "returns_address": "Returns address",+ "address_filled": "Added",+ "address_missing": "Not added",+ "address_not_provided": "No address yet.",+ "add_address": "Add address"},"team": {"title": "Your team",diff --git a/packages/seller-dashboard/src/nav/default.ts b/packages/seller-dashboard/src/nav/default.tsindex ecc81bf456..fe124eb7e7 100644--- a/packages/seller-dashboard/src/nav/default.ts+++ b/packages/seller-dashboard/src/nav/default.ts@@ -1,5 +1,5 @@import { i18n, nav } from '@spree/dashboard-core'-import { ClipboardCheckIcon, StoreIcon, UsersIcon } from 'lucide-react'+import { ClipboardCheckIcon, HomeIcon, StoreIcon, UsersIcon } from 'lucide-react'import { OnboardingNavBadge } from '../components/onboarding-nav-badge'// The panel's built-in sidebar. Registered into the same registry a plugin@@ -13,10 +13,19 @@ import { OnboardingNavBadge } from '../components/onboarding-nav-badge'// serializes; an entry a member cannot act on is hidden by the same// permission filter the operator's sidebar uses.+nav.add({+ key: 'home',+ label: i18n.t('nav.home'),+ path: '/',+ icon: HomeIcon,+ position: 50,+ subject: 'seller_profile',+})+nav.add({key: 'profile',label: i18n.t('nav.profile'),- path: '/',+ path: '/profile',icon: StoreIcon,position: 100,subject: 'seller_profile',diff --git a/packages/seller-dashboard/src/pages/home.tsx b/packages/seller-dashboard/src/pages/home.tsxnew file mode 100644index 0000000000..8270e61f2f--- /dev/null+++ b/packages/seller-dashboard/src/pages/home.tsx@@ -0,0 +1,134 @@+import {+ Button,+ Card,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ Progress,+ StatusBadge,+} from '@spree/dashboard-ui'+import { useQuery } from '@tanstack/react-query'+import { Link, useParams } from '@tanstack/react-router'+import { ChevronRightIcon, PackageIcon, UsersIcon } from 'lucide-react'+import type { ReactNode } from 'react'+import { useTranslation } from 'react-i18next'+import { sellerClient } from '../api-client'+import { CenteredMessage } from '../components/centered-message'++/**+ * Where a seller lands: how they stand with the marketplace, what is left to+ * do, and the counts they would otherwise open a page to see.+ *+ * The operator's home is an analytics dashboard — a sales chart and top+ * products. A seller has no analytics endpoint yet (orders are a later+ * phase), and inventing widgets over data that does not exist would be worse+ * than a smaller page that is true. This shows what the panel can actually+ * answer today; the sales card lands with the orders surface.+ */+export function HomePage() {+ const { t } = useTranslation()+ const { sellerId } = useParams({ from: '/_authenticated/$sellerId' })++ const { data: profile, isLoading } = useQuery({+ queryKey: ['seller', sellerId, 'profile'],+ queryFn: () => sellerClient().profile.get(),+ })++ const { data: onboarding } = useQuery({+ queryKey: ['seller', sellerId, 'onboarding'],+ queryFn: () => sellerClient().onboarding.get(),+ })++ const { data: team } = useQuery({+ queryKey: ['seller', sellerId, 'team'],+ queryFn: () => sellerClient().team.list(),+ })++ if (isLoading) return <CenteredMessage>{t('common.loading')}</CenteredMessage>+ if (!profile) return <CenteredMessage>{t('common.error')}</CenteredMessage>++ const progress = onboarding?.progress+ const setupDone = !progress || progress.total === 0 || progress.done === progress.total++ return (+ <div className="flex flex-col gap-6">+ <div>+ <h1 className="font-medium text-2xl">{t('home.title', { name: profile.name })}</h1>+ <p className="text-muted-foreground text-sm">{t('home.subtitle')}</p>+ </div>++ {/* Setup leads while it is unfinished — until a seller is approved it is+ the only thing on this page that matters. It drops away once done+ rather than sitting at 100% forever. */}+ {!setupDone && progress && (+ <Card>+ <CardHeader>+ <CardTitle>{t('home.setup_title')}</CardTitle>+ <CardDescription>+ {t('home.setup_description', { done: progress.done, total: progress.total })}+ </CardDescription>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ <Progress value={progress.percentage} />+ <div>+ <Button size="sm" asChild>+ <Link to="/$sellerId/onboarding" params={{ sellerId }}>+ {t('home.setup_cta')}+ <ChevronRightIcon className="size-4" />+ </Link>+ </Button>+ </div>+ </CardContent>+ </Card>+ )}++ <div className="grid gap-4 sm:grid-cols-3">+ <StatCard label={t('home.status')}>+ <StatusBadge status={profile.status} />+ </StatCard>+ <StatCard label={t('home.products')} icon={<PackageIcon className="size-4" />}>+ {profile.products_count}+ </StatCard>+ <StatCard label={t('home.team')} icon={<UsersIcon className="size-4" />}>+ {team?.data?.length ?? '—'}+ </StatCard>+ </div>++ <Card>+ <CardHeader>+ <CardTitle>{t('home.selling_title')}</CardTitle>+ </CardHeader>+ <CardContent>+ <p className="text-muted-foreground text-sm">+ {profile.sellable ? t('home.selling_yes') : t('home.selling_no')}+ </p>+ </CardContent>+ </Card>+ </div>+ )+}++function StatCard({+ label,+ icon,+ children,+}: {+ label: string+ icon?: ReactNode+ children: ReactNode+}) {+ return (+ <Card>+ <CardHeader className="pb-2">+ <CardDescription className="flex items-center gap-2">+ {icon}+ {label}+ </CardDescription>+ </CardHeader>+ <CardContent>+ <div className="font-medium text-2xl">{children}</div>+ </CardContent>+ </Card>+ )+}diff --git a/packages/seller-dashboard/src/pages/onboarding.tsx b/packages/seller-dashboard/src/pages/onboarding.tsxindex 7d96f74b6f..c4e57cd3e4 100644--- a/packages/seller-dashboard/src/pages/onboarding.tsx+++ b/packages/seller-dashboard/src/pages/onboarding.tsx@@ -24,6 +24,7 @@ import { useTranslation } from 'react-i18next'import { toast } from 'sonner'import { sellerClient } from '../api-client'import { CenteredMessage } from '../components/centered-message'+import { SellerAddressCard, type SellerAddressKey } from '../components/seller-address-card'/*** What the marketplace asks of this seller before admitting them.@@ -182,6 +183,14 @@ function RequirementAction({ requirement }: { requirement: RequirementStatus })const queryClient = useQueryClient()const [note, setNote] = useState('')+ // Only the address kinds need it, and it is already loaded by the profile+ // page and the sidebar switcher — this reads the same cache entry.+ const { data: profile } = useQuery({+ queryKey: ['seller', sellerId, 'profile'],+ queryFn: () => sellerClient().profile.get(),+ enabled: Boolean(addressKeyFor(requirement.kind)),+ })+const invalidate = () =>queryClient.invalidateQueries({ queryKey: ['seller', sellerId, 'onboarding'] })@@ -237,7 +246,17 @@ function RequirementAction({ requirement }: { requirement: RequirementStatus }){rejection}{requirement.kind === 'accept_terms' && (- <div className="flex justify-start">+ <div className="flex flex-wrap items-center gap-2">+ {/* The terms themselves, when the marketplace configured a link.+ Accepting something a seller cannot read is not consent. */}+ {requirement.action_url && (+ <Button size="sm" variant="outline" asChild>+ <a href={requirement.action_url} target="_blank" rel="noreferrer">+ {t('onboarding.read_terms')}+ <ExternalLinkIcon className="size-4" />+ </a>+ </Button>+ )}<Button size="sm" disabled={acceptTerms.isPending} onClick={() => acceptTerms.mutate()}>{t('onboarding.accept_terms')}</Button>@@ -260,6 +279,17 @@ function RequirementAction({ requirement }: { requirement: RequirementStatus })</div>)}+ {/* Addresses are filled in here rather than on the profile page: a+ seller working through setup should not be sent away and lose their+ place. Same card either way, so the two cannot diverge. */}+ {addressKeyFor(requirement.kind) && profile && (+ <SellerAddressCard+ profile={profile}+ addressKey={addressKeyFor(requirement.kind)!}+ headless+ />+ )}+{/* Kinds whose work happens on a page this panel already has. Theserver cannot supply these: `action_url` is for somewhere it knowsabout (a provider's hosted flow), and it has no idea how this panel@@ -276,7 +306,8 @@ function RequirementAction({ requirement }: { requirement: RequirementStatus })</div>)}- {requirement.action_url && (+ {/* `accept_terms` renders its own link above, with different words. */}+ {requirement.action_url && requirement.kind !== 'accept_terms' && (<div className="flex justify-start"><Button size="sm" variant="outline" asChild><a href={requirement.action_url} target="_blank" rel="noreferrer">@@ -298,13 +329,17 @@ function RequirementAction({ requirement }: { requirement: RequirementStatus })* kind that is not here renders its description and any `action_url`, which* is what makes a provider's kind useful before this file knows it exists.*/+/** Kinds the seller satisfies by filling an address, rendered inline. */+function addressKeyFor(kind: string): SellerAddressKey | undefined {+ if (kind === 'billing_address' || kind === 'returns_address') return kind+ return undefined+}+function panelRoute(kind: string): string | undefined {switch (kind) {- case 'billing_address':- case 'returns_address':case 'complete_profile':case 'required_custom_fields':- return '/$sellerId'+ return '/$sellerId/profile'// `minimum_products` belongs here too, once the panel has a products// page — until then it falls through and reads as a plain instruction// rather than a link to nowhere.diff --git a/packages/seller-dashboard/src/pages/profile.tsx b/packages/seller-dashboard/src/pages/profile.tsxindex 376c58f75d..83418a1545 100644--- a/packages/seller-dashboard/src/pages/profile.tsx+++ b/packages/seller-dashboard/src/pages/profile.tsx@@ -31,6 +31,7 @@ import { useTranslation } from 'react-i18next'import { toast } from 'sonner'import { sellerClient } from '../api-client'import { CenteredMessage } from '../components/centered-message'+import { SellerAddressCard } from '../components/seller-address-card'interface ProfileValues {name: string@@ -90,6 +91,8 @@ export function ProfilePage() {<StandingCard profile={profile} /><AtAGlanceCard profile={profile} teamCount={team?.data?.length} /><ContactCard profile={profile} onEdit={() => setEditing(true)} />+ <SellerAddressCard profile={profile} addressKey="billing_address" />+ <SellerAddressCard profile={profile} addressKey="returns_address" /><SettlementCard profile={profile} /></>}diff --git a/packages/seller-dashboard/src/routeTree.gen.ts b/packages/seller-dashboard/src/routeTree.gen.tsindex b60866b5db..11d024b401 100644--- a/packages/seller-dashboard/src/routeTree.gen.ts+++ b/packages/seller-dashboard/src/routeTree.gen.ts@@ -16,6 +16,7 @@ import { Route as acceptInvitationDotinvitationIdRouteImport } from './routes/acimport { Route as authenticatedSellerIdRouteImport } from './routes/_authenticated/$sellerId'import { Route as IndexRouteImport } from './routes/_authenticated/$sellerId/index'import { Route as TeamRouteImport } from './routes/_authenticated/$sellerId/team'+import { Route as ProfileRouteImport } from './routes/_authenticated/$sellerId/profile'import { Route as OnboardingRouteImport } from './routes/_authenticated/$sellerId/onboarding'const loginRoute = loginRouteImport.update({@@ -53,6 +54,11 @@ const TeamRoute = TeamRouteImport.update({path: '/team',getParentRoute: () => authenticatedSellerIdRoute,} as any)+const ProfileRoute = ProfileRouteImport.update({+ id: '/profile',+ path: '/profile',+ getParentRoute: () => authenticatedSellerIdRoute,+} as any)const OnboardingRoute = OnboardingRouteImport.update({id: '/onboarding',path: '/onboarding',@@ -65,6 +71,7 @@ export interface FileRoutesByFullPath {'/$sellerId': typeof authenticatedSellerIdRouteWithChildren'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute'/$sellerId/onboarding': typeof OnboardingRoute+ '/$sellerId/profile': typeof ProfileRoute'/$sellerId/team': typeof TeamRoute'/$sellerId/': typeof IndexRoute}@@ -73,6 +80,7 @@ export interface FileRoutesByTo {'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute'/': typeof authenticatedIndexRoute'/$sellerId/onboarding': typeof OnboardingRoute+ '/$sellerId/profile': typeof ProfileRoute'/$sellerId/team': typeof TeamRoute'/$sellerId': typeof IndexRoute}@@ -84,6 +92,7 @@ export interface FileRoutesById {'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute'/_authenticated/': typeof authenticatedIndexRoute'/_authenticated/$sellerId/onboarding': typeof OnboardingRoute+ '/_authenticated/$sellerId/profile': typeof ProfileRoute'/_authenticated/$sellerId/team': typeof TeamRoute'/_authenticated/$sellerId/': typeof IndexRoute}@@ -95,6 +104,7 @@ export interface FileRouteTypes {| '/$sellerId'| '/accept-invitation/$invitationId'| '/$sellerId/onboarding'+ | '/$sellerId/profile'| '/$sellerId/team'| '/$sellerId/'fileRoutesByTo: FileRoutesByTo@@ -103,6 +113,7 @@ export interface FileRouteTypes {| '/accept-invitation/$invitationId'| '/'| '/$sellerId/onboarding'+ | '/$sellerId/profile'| '/$sellerId/team'| '/$sellerId'id:@@ -113,6 +124,7 @@ export interface FileRouteTypes {| '/accept-invitation/$invitationId'| '/_authenticated/'| '/_authenticated/$sellerId/onboarding'+ | '/_authenticated/$sellerId/profile'| '/_authenticated/$sellerId/team'| '/_authenticated/$sellerId/'fileRoutesById: FileRoutesById@@ -174,6 +186,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof TeamRouteImportparentRoute: typeof authenticatedSellerIdRoute}+ '/_authenticated/$sellerId/profile': {+ id: '/_authenticated/$sellerId/profile'+ path: '/profile'+ fullPath: '/$sellerId/profile'+ preLoaderRoute: typeof ProfileRouteImport+ parentRoute: typeof authenticatedSellerIdRoute+ }'/_authenticated/$sellerId/onboarding': {id: '/_authenticated/$sellerId/onboarding'path: '/onboarding'@@ -186,12 +205,14 @@ declare module '@tanstack/react-router' {interface authenticatedSellerIdRouteChildren {OnboardingRoute: typeof OnboardingRoute+ ProfileRoute: typeof ProfileRouteTeamRoute: typeof TeamRouteIndexRoute: typeof IndexRoute}const authenticatedSellerIdRouteChildren: authenticatedSellerIdRouteChildren = {OnboardingRoute: OnboardingRoute,+ ProfileRoute: ProfileRoute,TeamRoute: TeamRoute,IndexRoute: IndexRoute,}diff --git a/packages/seller-dashboard/src/routes/_authenticated/$sellerId/index.tsx b/packages/seller-dashboard/src/routes/_authenticated/$sellerId/index.tsxindex 8384c64817..b437ffd54b 100644--- a/packages/seller-dashboard/src/routes/_authenticated/$sellerId/index.tsx+++ b/packages/seller-dashboard/src/routes/_authenticated/$sellerId/index.tsx@@ -1,6 +1,6 @@import { createFileRoute } from '@tanstack/react-router'-import { ProfilePage } from '../../../pages/profile'+import { HomePage } from '../../../pages/home'export const Route = createFileRoute('/_authenticated/$sellerId/')({- component: ProfilePage,+ component: HomePage,})diff --git a/packages/seller-dashboard/src/routes/_authenticated/$sellerId/profile.tsx b/packages/seller-dashboard/src/routes/_authenticated/$sellerId/profile.tsxnew file mode 100644index 0000000000..b107238b38--- /dev/null+++ b/packages/seller-dashboard/src/routes/_authenticated/$sellerId/profile.tsx@@ -0,0 +1,6 @@+import { createFileRoute } from '@tanstack/react-router'+import { ProfilePage } from '../../../pages/profile'++export const Route = createFileRoute('/_authenticated/$sellerId/profile')({+ component: ProfilePage,+})diff --git a/packages/seller-sdk/src/index.ts b/packages/seller-sdk/src/index.tsindex 9cef674cbf..20faa7b6d7 100644--- a/packages/seller-sdk/src/index.ts+++ b/packages/seller-sdk/src/index.ts@@ -14,6 +14,7 @@ export type {ProfileUpdateParams,RequirementSubmissionParams,SellerAddressParams,+ SellerCountry,} from './seller-client'// Client class, for advanced use and subclassingexport { SellerClient } from './seller-client'diff --git a/packages/seller-sdk/src/seller-client.ts b/packages/seller-sdk/src/seller-client.tsindex a5aa15342f..ca63f9e07f 100644--- a/packages/seller-sdk/src/seller-client.ts+++ b/packages/seller-sdk/src/seller-client.ts@@ -122,6 +122,15 @@ export class SellerClient {this.request<void>('DELETE', `/team/${id}`, options),}+ /**+ * Countries for the panel's address forms — public reference data, the same+ * list the storefront serves.+ */+ readonly countries = {+ list: (options?: RequestOptions): Promise<{ data: SellerCountry[] }> =>+ this.request<{ data: SellerCountry[] }>('GET', '/countries', options),+ }+/*** What the marketplace asks of this seller before it will admit them.*@@ -210,6 +219,16 @@ export class SellerClient {}}+/** A country as the address form needs it. */+export interface SellerCountry {+ iso: string+ iso3: string+ name: string+ states_required?: boolean+ zipcode_required?: boolean+ states?: Array<{ abbr: string; name: string }>+}+/** What `/seller/onboarding` answers. */export interface OnboardingResponse {/** The seller's lifecycle status, e.g. `onboarding`, `ready_for_review`. */diff --git a/spree/api/app/controllers/spree/api/v3/seller/countries_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/countries_controller.rbnew file mode 100644index 0000000000..ebc5ced65f--- /dev/null+++ b/spree/api/app/controllers/spree/api/v3/seller/countries_controller.rb@@ -0,0 +1,38 @@+module Spree+ module Api+ module V3+ module Seller+ # Countries for the panel's address forms.+ #+ # Public reference data — the same list the storefront and the+ # operator's dashboard serve — so it is exempt from the key gate, as+ # its admin twin is. A seller filling in a billing address needs every+ # country, not the ones their marketplace happens to sell into.+ class CountriesController < Seller::BaseController+ skip_scope_check!++ # GET /api/v3/seller/countries+ #+ # Unpaginated: there are ~250 countries and an address dropdown needs+ # them all at once, which Pagy's global max_limit would prevent.+ def index+ countries = Spree::Country.all.sort_by(&:name)++ render json: {+ data: countries.map { |country| serialize_country(country) },+ meta: { count: countries.size }+ }+ end++ private++ def serialize_country(country)+ Spree.api.country_serializer.new(+ country, params: { store: current_store, expand: ['states'] }+ ).to_h+ end+ end+ end+ end+ end+enddiff --git a/spree/api/config/routes.rb b/spree/api/config/routes.rbindex 44f9d31788..1e7e23195d 100644--- a/spree/api/config/routes.rb+++ b/spree/api/config/routes.rb@@ -686,6 +686,10 @@ Spree::Core::Engine.add_routes do# shape every later one follows — rooted in the seller by the anchor.resources :products, only: [:index, :show, :create, :update, :destroy]+ # Reference data for the panel's address forms — the same list the+ # storefront serves, not narrowed to the marketplace's markets.+ resources :countries, only: [:index]+# What the marketplace asks of this seller. Singular: the checklist is# always `current_seller`'s, never an id from the request.resource :onboarding, only: [:show], controller: 'onboarding' dodiff --git a/spree/core/app/models/spree/seller_requirements/accept_terms.rb b/spree/core/app/models/spree/seller_requirements/accept_terms.rbindex 0617409285..383bbc3c36 100644--- a/spree/core/app/models/spree/seller_requirements/accept_terms.rb+++ b/spree/core/app/models/spree/seller_requirements/accept_terms.rb@@ -9,6 +9,12 @@ module Spree# the seller sees the requirement return to their checklist.class AcceptTerms < Spree::SellerRequirementpreference :terms_effective_from, :string, default: nil+ # Where the terms actually are. A URL rather than stored copy: a+ # marketplace already publishes its terms somewhere, and keeping a+ # second copy here would be the one that goes stale. Optional — a+ # marketplace that agrees terms out of band still uses this kind to+ # record that the seller accepted.+ preference :terms_url, :string, default: nil# A date nobody can parse would otherwise read as "no date at all", and# this requirement would quietly count sellers on years-old terms as@@ -33,6 +39,15 @@ module Spree# types means midnight where they trade, and interpreting "2026-01-01"# in UTC would move the deadline by hours for everyone else.#+ # The terms themselves, so the seller can read what they are accepting.+ # `action_url` is the checklist's existing "go here" channel, which the+ # panel already renders — no new field for one kind.+ #+ # @return [String, nil]+ def action_url(_seller)+ preferred_terms_url.presence+ end+# @return [ActiveSupport::TimeWithZone, nil]def effective_fromreturn nil if preferred_terms_effective_from.blank?diff --git a/spree/core/spec/models/spree/seller_requirements_spec.rb b/spree/core/spec/models/spree/seller_requirements_spec.rbindex 8d80b4f562..9d60d953c7 100644--- a/spree/core/spec/models/spree/seller_requirements_spec.rb+++ b/spree/core/spec/models/spree/seller_requirements_spec.rb@@ -11,6 +11,18 @@ RSpec.describe 'seller requirement kinds', type: :model doexpect(requirement.satisfied?(seller)).to be falseend+ # The seller panel renders this as "Read the terms" beside the accept+ # button — accepting something they cannot read is not consent.+ it 'points at the terms when the marketplace configured a link' do+ requirement.update!(preferred_terms_url: 'https://example.com/terms')++ expect(requirement.action_url(seller)).to eq('https://example.com/terms')+ end++ it 'has no link when none is configured' do+ expect(requirement.action_url(seller)).to be_nil+ end+it 'is met once they have' doseller.update!(terms_accepted_at: Time.current)