---
id: CAP-COM-CAT-003
title: Configure a store’s offered assortment
feature: FEAT-COM-CAT-01
product_area: commerce
module: catalog
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - 'services-commerce:docs/milestones/COMM-M1-set-up-what-you-sell.md#D3'
  - 'services-commerce:docs/milestones/plans/COMM-M1-plan.md#2. Scope (item 2)'
  - >-
    services-commerce:docs/milestones/plans/COMM-M1-plan.md#D3. Build the Stores
    screen?
purpose: >-
  Administrators establish a recognizable selling context with an assortment and
  payment policy.
outcomes:
  - The console supports store preparation and subsequent maintenance.
  - Category assortment determines the store offering.
concepts:
  - CON-COM-CAT-002
actors:
  - ACT-COM-001
  - ACT-COM-004
surfaces:
  - console
  - api
permissions:
  - key: commerce.stores.read
    where_checked: api
    scope: tenant
  - key: commerce.stores.create
    where_checked: api
    scope: tenant
  - key: commerce.stores.update
    where_checked: api
    scope: tenant
  - key: commerce.stores.delete
    where_checked: api
    scope: tenant
  - key: commerce.stores.bulk
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-COM-CAT-003-01
    proved_by: [ATS-COM-CAT-001-14, ATS-COM-CAT-002-07, ATS-COM-CAT-003-01, TST-COM-CAT-031]
    statement: >-
      Every store references a checkout policy in its workspace; an omitted or
      unknown policy produces a field-specific refusal.
    kind: validation
    enforced_at:
      - api
      - service
      - database
      - console
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/stores.e2e.spec.js#answers
      400 to an ordering profile the tenant does not have, naming the property
    origin: COMM-M1 D3 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
  - id: BR-CAP-COM-CAT-003-02
    proved_by: [ATS-COM-CAT-003-02, TST-COM-CAT-031]
    statement: >-
      Commerce rejects business-unit or currency fields on a store because its
      checkout policy supplies those values.
    kind: validation
    enforced_at:
      - api
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/stores.e2e.spec.js#answers
      400 to a currency or a business unit on the body: the store carries
      neither since D23
    origin: none
  - id: BR-CAP-COM-CAT-003-03
    proved_by: [ATS-COM-CAT-003-10]
    statement: >-
      Staff define an assortment as all categories, selected categories, or all
      categories except selected exclusions.
    kind: policy
    enforced_at:
      - api
      - database
      - console
    must_prove: false
    provenance: test
    source: >-
      services-commerce:modules/catalog/tests/integration/db/catalog-tables.table.integration.spec.js#refuses
      a store category rule outside all, only and all_but
    origin: COMM-M1 D3 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
  - id: BR-CAP-COM-CAT-003-04
    proved_by: [ATS-COM-CAT-003-03, ATS-COM-CAT-003-15, TST-COM-CAT-037]
    statement: >-
      Assortment references must resolve to categories in the store’s workspace;
      categories from another workspace are treated as unknown.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/integration/services/persistence/stores.integration.spec.js#refuses
      a category id the tenant does not have, 400 naming category_ids and the
      id, creating nothing
    origin: none
  - id: BR-CAP-COM-CAT-003-05
    proved_by: [ATS-COM-CAT-003-03, ATS-COM-CAT-003-11, ATS-COM-CAT-005-08, TST-COM-CAT-037]
    statement: >-
      The chosen home category must satisfy the store’s inclusion or exclusion
      rule.
    kind: validation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/integration/services/persistence/stores.integration.spec.js#refuses
      a home category an "all_but" rule leaves out, 400 naming home_category_id
    origin: COMM-M1 D3 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
  - id: BR-CAP-COM-CAT-003-06
    proved_by: []
    statement: >-
      Without configured purchasing roles, a store permits any affiliated
      contact to purchase for an organization.
    kind: policy
    enforced_at:
      - service
      - database
    must_prove: false
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/integration/services/persistence/stores.integration.spec.js#defaults
      the purchasing roles to none: any affiliated contact may buy for an
      organization
    origin: none
  - id: BR-CAP-COM-CAT-003-07
    proved_by: []
    statement: >-
      A store retains its supplied or name-derived identity, and creation under
      an occupied identity is refused.
    kind: validation
    enforced_at:
      - service
    must_prove: false
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/stores.e2e.spec.js#derives
      the id from the name when the request names none, and defaults the
      purchasing roles to none
    origin: none
  - id: BR-CAP-COM-CAT-003-08
    proved_by: [ATS-COM-CAT-003-04, ATS-COM-CAT-003-13, ATS-COM-CAT-003-14, TST-COM-CAT-037]
    statement: >-
      Commerce refuses removal of a store referenced by a checkout or order and
      identifies that store.
    kind: lifecycle
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/integration/services/persistence/stores.integration.spec.js#refuses
      deleting a store a checkout was opened in, naming the store
    origin: none
  - id: BR-CAP-COM-CAT-003-09
    proved_by: [ATS-COM-CAT-003-12, ATS-COM-CAT-003-16, ATS-COM-CAT-003-17, ATS-COM-CAT-005-11, ATS-COM-CAT-005-13, ATS-COM-CAT-006-19]
    statement: >-
      The shared asset pipeline retains a store’s default picture; replacement
      detaches the previous image for retirement, and store deletion detaches
      the current image.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: false
    provenance: test
    source: >-
      services-commerce:modules/catalog/tests/integration/services/assets/catalog-assets.integration.spec.js#detaches
      the store’s picture when the store is deleted
    origin: COMM-M1 D11 (docs/milestones/COMM-M1-set-up-what-you-sell.md)
  - id: BR-CAP-COM-CAT-003-10
    proved_by: [ATS-COM-CAT-003-09]
    statement: >-
      Saving a store preserves its two pricing-extension references without
      verifying that registered handlers exist for them.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-commerce:modules/configuration/services/persistence/stores.ts:storeColumns
    origin: none
  - id: BR-CAP-COM-CAT-003-11
    proved_by: [ATS-COM-CAT-003-05, ATS-COM-CAT-003-10, ATS-COM-CAT-003-13, ATS-COM-CAT-003-14, TST-COM-CAT-031]
    statement: >-
      Store replacement requires the complete record at its read version and
      rejects stale versions.
    kind: invariant
    enforced_at:
      - api
      - service
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/stores.e2e.spec.js#replaces
      a store at the version read, the purchasing roles with it, and answers 409
      to the stale version after
    origin: none
  - id: BR-CAP-COM-CAT-003-12
    proved_by: [ATS-COM-CAT-003-06, TST-COM-CAT-028]
    statement: >-
      Store inspection requires read permission; creating, replacing and
      deleting require the corresponding administrator permissions.
    kind: permission
    enforced_at:
      - api
      - console
    must_prove: true
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/configuration-security.e2e.spec.js#is
      refused the creates, 403 permission_missing
    origin: none
  - id: BR-CAP-COM-CAT-003-13
    proved_by: [ATS-COM-CAT-003-08, ATS-COM-CAT-003-13, ATS-COM-CAT-003-14]
    statement: >-
      A full lock prevents replacing a store, and either full or deletion-only
      locking prevents removing it.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: 'services-commerce:modules/configuration/services/persistence/stores.ts'
    origin: none
scenarios:
  - id: SC-CAP-COM-CAT-003-01
    given: Main and the Books and Apparel categories are configured
    when: Create Bookstore offering those categories with Books as home
    then: Its first saved version retains that policy and assortment
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/integration/services/persistence/stores.integration.spec.js#creates
      a store whose rule names categories the tenant has, and whose home
      category the rule admits
  - id: SC-CAP-COM-CAT-003-02
    given: Bookstore admits only Books
    when: Choose Apparel as its home category
    then: The home selection fails validation
    provenance: test
    source: >-
      services-commerce:modules/configuration/tests/e2e/stores.e2e.spec.js#answers
      400 to a home category outside the assortment, on a create and on a
      replacement, naming home_category_id
depends_on:
  - CAP-COM-CAT-001
  - CAP-COM-CAT-005
related:
  - CAP-COM-CAT-008
journeys:
  - JNY-COM-CAT-001
evidence:
  - >-
    Pinned service inputs: modules/configuration/aws/api/stores.routes.ts and
    .schemas.ts; services/persistence/stores.ts; db/stores.table.ts;
    tests/e2e/stores.e2e.spec.js; tests/integration (stores persistence,
    queries, table); modules/catalog/services/assets (store image)
  - >-
    Pinned console inputs: components/commerce/stores/**, lib/commerce/stores/**
    and tests, e2e/mock/commerce-view-edit.mock.spec.ts (Stores)
controls: [TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-CRY-001, TC-CRY-004, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-LOG-004, TC-LOG-005, TC-PI-001, TC-PI-003, TC-PI-005, TC-PRV-001, TC-PRV-002]
exercised_by: [FAS-COM-CAT-01-01, FAS-COM-CAT-01-02, FAS-COM-CAT-01-03, FAS-COM-CAT-01-04]
suites: [TST-COM-CAT-028, TST-COM-CAT-031, TST-COM-CAT-037]
---

# Configure a store’s offered assortment

## Purpose

Administrators establish a recognizable selling context with an assortment and payment policy.

## How It Works

Staff create the store after its policy and categories are available. They choose which shelves the offering includes and the shelf used as its starting point. The saved view brings those choices together with the policy reference and sort. Organization purchasing roles and extension references provide additional sale context. Invalid category choices are identified during saving, and a stale record cannot replace the current version. Earlier checkout and order references affect whether staff can remove the store. The product should verify extension references at configuration time.

## Relationships

The configure reusable sale-processing policies capability supplies related configuration or assessment used in this work.

The organize product shelves capability supplies related configuration or assessment used in this work.

The present the store’s available products capability supplies related configuration or assessment used in this work.
